Advertisement
Guest User

CCI strategy

a guest
Oct 7th, 2015
94
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.72 KB | None | 0 0
  1. strategy("4H CCI Strategy 1.3", overlay=true)
  2. length = input( 11 )
  3. overSold = input( -150 )
  4. overBought = input( +150 )
  5. price1 = high
  6. price2 = low
  7. ucci = cci(price1, length)
  8. dcci = cci(price2, length)
  9. vcci = cci(ohlc4, 11)
  10. tp = input(title="TP in ticks", type=integer, defval=3000, minval=1, maxval=100000)
  11. sl = input(title="SL in ticks", type=integer, defval=1000, minval=1, maxval=100000)
  12. if (not na(vcci))
  13. if (crossover(dcci, overSold))
  14. strategy.entry("CCILE", strategy.long, comment="CCILE")
  15. strategy.exit(id="CCILE", profit = tp, loss = sl)
  16. if (crossunder(ucci, overBought))
  17. strategy.entry("CCISE", strategy.short, comment="CCISE")
  18. strategy.exit(id="CCISE", profit = tp, loss = sl)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement