Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- strategy("My strategy", overlay=false)
- //INPUTS//
- length = input.int(49, minval=1, title="CCI LENGTH", group = "CCI")
- src_CCI = high
- //CALCULATIONS//
- ma = ta.sma(src_CCI, length)
- cci = (src_CCI - ma) / (0.015 * ta.dev(src_CCI, length))
- //TRADE CONDITIONS//
- CCI_LONG = cci > 90
- CCI_SHORT = cci < -90
- if (CCI_LONG)
- strategy.entry("My Long Entry Id", strategy.long)
- if (CCI_SHORT)
- strategy.entry("My Short Entry Id", strategy.short)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement