Hi
Can someone help with this issue. I am using the CCI as a overbought and oversold condition below -100 oversold and above 100 overbought. When the CCI value < -100 then the strategy stops because the indicator returns a negative value perhaps someone can make a suggestion as to how I can code around this?
Thanks
Johann
This code works correctly, no matter tha value CCI returns:
x = CCI[20](typicalPrice)
IF x > 50 then
buy at market
ELSIF x < -50 then
sellshort at market
endif
//graph x
Thanks Roberto I will try it.
x = CCI[20](typicalPrice)
y = Average[10](CCI[20](typicalPrice))
IF x > 100 and x > y then
buy at market
ELSIF x < -100 and x < y then
sellshort at market
endif
Hi Roberto, so this example should be ok?
JSParticipant
Senior
DefParam CumulateOrders = False
x = CCI[20](typicalPrice)
y = Average[10](CCI[20](typicalPrice))
IF x > 250 and x > y then
buy at market
ELSIF x < -250 and x < y then
sellshort at market
endif
It works fine…
After optimization x > 250… 😉