KevinSammy
Member
Hello,
I am attempting to create a scanner to buy when shorts are potentially trapped.
My thought is to wait for the price to close below the 9ema, where shorts might jump in.
Then in the next 5 minutes, if the price goes above the 9ema I will buy in hopes that shorts are trapped.
I created the code, but am having trouble with getting the condition to check within the last 5 minutes. Can someone please help with this?
Thanks in advance!!
def ema9 = MovAvgExponential(close, 9, 0, no);
def CloseBelowNine = close < ema9;
def LastPrice = close;
def input bars_away = 5;
def input bars_count = yes;
def BuyOverNine = LastPrice crosses above CloseBelowNine and bars_away;
plot scan =BuyOverNine ;
I am attempting to create a scanner to buy when shorts are potentially trapped.
My thought is to wait for the price to close below the 9ema, where shorts might jump in.
Then in the next 5 minutes, if the price goes above the 9ema I will buy in hopes that shorts are trapped.
I created the code, but am having trouble with getting the condition to check within the last 5 minutes. Can someone please help with this?
Thanks in advance!!
def ema9 = MovAvgExponential(close, 9, 0, no);
def CloseBelowNine = close < ema9;
def LastPrice = close;
def input bars_away = 5;
def input bars_count = yes;
def BuyOverNine = LastPrice crosses above CloseBelowNine and bars_away;
plot scan =BuyOverNine ;