I would like to save the final "Value.Set" in the code and then use it for comparing change in direction as follows
if Value[0] > Value[1] and Value[1] < Value[2]
then change color of the plot line to Green and give Sound Alert
else
if Value[0] < Value[1] and Value[1] > Value[2]
then change color of the plot line to Red and give Sound Alert.
[0] represents current bar, [1] = last bar and [2] = 2 bars ago.
Please see attached image
Unfortunately, I could not attach the TSI code here due to size limitation.

Comment