OPEN-SOURCE SCRIPT

atr stop loss for double SMA v6

826
Strategy Name
atr stop loss for double SMA v6
Credit: This v6 update is based on Daveatt’s “BEST ATR Stop Multiple Strategy.”
Core Logic

Entry: Go long when the 15-period SMA crosses above the 45-period SMA; go short on the inverse cross.

Stop-Loss: On entry, compute ATR(14)×2.0 and set a fixed stop at entry ± that amount. Stop remains static until hit.

Trend Tracking: Uses barssince() to ensure only one active long or short position; stop is only active while that trend persists.

Visualization

Plots fast/slow SMA lines in teal/orange.

On each entry bar, displays a label showing “ATR value” and “ATR×multiple” positioned at the 30-bar low (long) or high (short).

Draws an “×” at the stop-price level in green (long) or red (short) while the position is open.

Execution Settings

Initial Capital: $100 000, Size = 100 shares per trade.

Commission: 0.075% per trade.

Pyramiding: 1.

Calculations: Only on bar close (no intra-bar ticks).

Usage Notes

Static ATR stop adapts to volatility but does not trail.

Ideal for trending, liquid markets (stocks, futures, FX).

Adjust SMA lengths or ATR multiple for faster/slower signals.

면책사항

이 정보와 게시물은 TradingView에서 제공하거나 보증하는 금융, 투자, 거래 또는 기타 유형의 조언이나 권고 사항을 의미하거나 구성하지 않습니다. 자세한 내용은 이용 약관을 참고하세요.