halfwaydecent
New member
Hello. I'm exploring a strategy that requires comparing the 1- or 5-min VWAP to the daily ATR. It's a go-to strategy from The Rumers, and it shows promise on the chart using the study:
However, I forgot when converting this to a scanner that secondary aggregations are not allowed. I would love to find a workaround, but there don't appear to be any. If that's the case, are there other platforms that would allow a scanner version of this?
Code:
def isToday = GetLastDay() == GetDay();
def RTH = SecondsFromTime(0930) >= 0 and SecondsTillTime(1600) >= 0;
def agg = AggregationPeriod.DAY;
input lengthDaily = 14;
input averageType = AverageType.WILDERS;
def ATR = MovingAverage(averageType, TrueRange(high(period = agg), close(period = agg), low(period = agg)), lengthDaily);
def VWAP = reference VWAP("num dev dn" = -2.0, "num dev up" = 2.0, "time frame" = "DAY");
def diffValid = Max(VWAP, close) - Min(VWAP, close) > ATR * 0.2;
def doubleGreen = close > open and close[1] > open[1];
def valid = isToday and RTH and diffValid and doubleGreen and close > high[1] and VWAP > close;
AddChartBubble(valid, high, "!", Color.WHITE);
However, I forgot when converting this to a scanner that secondary aggregations are not allowed. I would love to find a workaround, but there don't appear to be any. If that's the case, are there other platforms that would allow a scanner version of this?