Moving Average Gap Check? TOS ThinkScript Question


New member
I cannot seem to correctly put together a gap check code between two moving averages.

For example, if the SMA on the 10 day is 2.00 and the SMA on the 21 day is 1.00. I want to trigger if the gap is at least .50 between the two.

Any chance anyone can help?

Thank you in advance!


Well-known member
@Shmandull Here is something coded as a scan. I havent checked it in TOS; it could be wrong, and it might even throw error codes.

def sma1 = average(close,10);
def sma2 = average(close,21);

plot scan = sma1 > (sma2 + .50);

Similar threads