Advertisement
andypartridge47

Volty Expan Close Strategy

Dec 8th, 2024
39
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.47 KB | None | 0 0
  1. //@version=5
  2. strategy("Volty Expan Close Strategy", overlay=true)
  3.  
  4. // Inputs
  5. length = input.int(5, title="Length")
  6. numATRs = input.float(0.4, title="Number of ATRs")
  7.  
  8. // Calculate ATR
  9. atrs = ta.sma(ta.tr, length) * numATRs
  10.  
  11. // Entry conditions
  12. if (not na(close[length]))
  13. // Long entry
  14. strategy.entry("Long", strategy.long, stop=close + atrs, comment="Long")
  15. // Short entry
  16. strategy.entry("Short", strategy.short, stop=close - atrs, comment="Short")
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement