So since I have started looking at charts with extended hours taken off, I also ran across this little indicator online that adjusts a moving average in relation to the overnight gap that occurs. What I am hoping for is if someone could do the same thing, but for indicators, specifically the MACD, Stoch RSI, and DMI. Could be potentially helpful for those using charts with extended hours off, as those gap make charts difficult to read.
Code:
input AvgType = AverageType.EXPONENTIAL;
input Length = 8;
def avg;
def newDay = GetYYYYMMDD() <> GetYYYYMMDD()[1];
def todaysOpen = open(period = AggregationPeriod.DAY);
def yesterdaysClose = close(period = AggregationPeriod.DAY)[1];
def gapCount = gapCount[1] + newDay;
def gap = if newDay and gapCount > 1 then todaysOpen - yesterdaysClose else gap[1];
def accum = if newDay then accum[1] + gap else accum[1];
def relC = close - accum;
avg = MovingAverage(AvgType, relC, Length);
plot avg_gl = avg + accum;