CCI break-out alert


0
0

Mr. Hahn,

Would it possible to write a new code that could be added to the TOS CCI indicator with alert.

I would like it to alert with an arrow break-out signal when CCI crosses over or below the overbought line.

It currently only alerts when crossing the zero line. Thanks

 

Marked as spam
Posted by (Questions: 3, Answers: 1)
Asked on January 9, 2020 8:34 pm
632 views
0
Private answer

Copy the full code from the CCI study in Thinkorswim and paste it into a new custom study. Then locate and modify the following lines of code:

plot UpSignal = if CCI crosses above ZeroLine then ZeroLine else Double.Nan;
plot DownSignal = if CCI crosses below ZeroLine then ZeroLine else Double.Nan;

... and change them to this:

plot UpSignal = if CCI crosses above OverBought then OverBought else Double.Nan;
plot DownSignal = if CCI crosses below OverSold then OverSold else Double.Nan;

And if you wanted to add alerts you can include the following below the final line of code from the original study:

Alert(UpSignal, "CCI Cross OB", Alert.BAR, Sound.RING);
Alert(DownSignal, "CCI Cross OS", Alert.BAR, Sound.RING);

Marked as spam
Posted by (Questions: 37, Answers: 4084)
Answered on January 10, 2020 12:32 pm