I know you're looking to fix your scaling issue but I use a plot cycle average that is similar. It might help...? It definitely shows the zero point of the market for whatever resolution you're looking at. It's not a stand alone solution but in the photo it looks like it could be! But, I use MAs, S&R, Murray Math and pivots to determine high probability trades. There's two lengths of the average is in the 2nd pane (lower), the cyan and yellow stair stepping lines. I look for confluence between two of my criteria in order to get in. See how price retraced to the yellow average (on bottom chart) and murray math agreed (long wick in overnight session). Also on the 5 min chart on top price retraced to the MA and murray math also agreed! Best of luck!
inputs:
len (4);
variables:
theavg(0),
highBarsAgo(1),
possibleHighBarsAgo(1),
possibleHigh(-2),
hightoBeat(-1),
barsSincePaint(1),
lowBarsAgo(1),
possibleLowBarsAgo(1),
possibleLow(10000001),
lowtoBeat(10000000),
triggerPriceSell(-1),
triggerPriceBuy(1000000),
trend(1),
_UP(1),
_DOWN(-1),
_ON(1),
_OFF(-1),
s_low(1),
s_high(1);
//************************* ************************* *
//****** Find and plot the highest swing high *******
//************************* ************************* *
if trend = _UP then begin
if swingHighBar(1,H,2,barsSi ncePaint+2) > -1 then begin
possibleHighBarsAgo = swingHighBar(1,H,1,barsSi ncePaint+2);
possibleHigh = H[possibleHighBarsAgo];
end;
if possibleHigh >= hightoBeat then begin
highBarsAgo = possibleHighBarsAgo;
hightoBeat = possibleHigh;
triggerPriceSell = L[HighBarsAgo - 1];
end;
if C < triggerPriceSell and
highest(high,highBarsAgo) < hightoBeat then begin
//plotpb[highBarsAgo](H[highBarsAgo],L[highBarsAgo],"");
trend = _DOWN;
barsSincePaint = highBarsAgo-1;
hightoBeat = -1;
lowtoBeat = 10000000;
triggerPriceBuy = 10000000;
triggerPriceSell = -1;
highBarsAgo = 1;
possibleHigh = -2;
s_high = L[HighBarsAgo - 1];
theavg = average((( s_low + s_high) /2 ), len);
end;
end;
//************************* ************************* *
//****** Find and plot the lowest swing low *********
//************************* ************************* *
if trend = _DOWN then begin
if swingLowBar(1,L,2,barsSin cePaint+2) > -1 then begin
possibleLowBarsAgo = swingLowBar(1,L,2,barsSin cePaint+2);
possibleLow = L[possibleLowBarsAgo];
end;
if possibleLow <= lowtoBeat then begin
lowBarsAgo = possibleLowBarsAgo;
lowtoBeat = possibleLow;
triggerPriceBuy = H[LowBarsAgo - 1];
end;
if C > triggerPriceBuy and
lowest(L,lowBarsAgo) > lowtoBeat then begin
//plotpb[lowBarsAgo](H[lowBarsAgo],L[lowBarsAgo],"");
trend = _UP;
barsSincePaint = lowBarsAgo-1;
possibleLow = 10000001;
lowtoBeat = 10000000;
hightoBeat = -1;
triggerPriceBuy = 10000000;
triggerPriceSell = -1;
lowBarsAgo = 1;
s_low = H[LowBarsAgo - 1];
theavg = average((( s_low + s_high) /2 ), len);
end;
end;
Plot3(theavg, "Avg" ) ;
barsSincePaint = barsSincePaint+1;
if trend = _UP then highBarsAgo = highBarsAgo + 1;
if trend = _DOWN then lowBarsAgo = lowBarsAgo + 1;
