Advertisement
danucante

Untitled

Nov 10th, 2023
127
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.45 KB | None | 0 0
  1. strategy("My strategy", overlay=false)
  2. //INPUTS//
  3. length = input.int(49, minval=1, title="CCI LENGTH", group = "CCI")
  4. src_CCI = high
  5.  
  6. //CALCULATIONS//
  7. ma = ta.sma(src_CCI, length)
  8. cci = (src_CCI - ma) / (0.015 * ta.dev(src_CCI, length))
  9.  
  10. //TRADE CONDITIONS//
  11. CCI_LONG = cci > 90
  12. CCI_SHORT = cci < -90
  13.  
  14.  
  15. if (CCI_LONG)
  16. strategy.entry("My Long Entry Id", strategy.long)
  17.  
  18.  
  19. if (CCI_SHORT)
  20. strategy.entry("My Short Entry Id", strategy.short)
  21.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement