Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- //@version=5
- strategy("Volty Expan Close Strategy", overlay=true)
- // Inputs
- length = input.int(5, title="Length")
- numATRs = input.float(0.4, title="Number of ATRs")
- // Calculate ATR
- atrs = ta.sma(ta.tr, length) * numATRs
- // Entry conditions
- if (not na(close[length]))
- // Long entry
- strategy.entry("Long", strategy.long, stop=close + atrs, comment="Long")
- // Short entry
- strategy.entry("Short", strategy.short, stop=close - atrs, comment="Short")
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement