Hello Code Gurus,
I am trying to create an ADL indicator that measures the instrument on Data1 against itself with the following code:
Code: Select all
inputs: period(14);
variables: ADL(0), HL(0), CLV(0);
HL = (high + low)/2;
CLV = ((close - low) - (high - close)) / (high - low) * volume;
ADL = ADL[1] + CLV;
plot1(Average(ADL, period), "ADL MA", green);
What I get basically works except that the total value for the ADL is accumulating as a running total as you can see in this screenshot, bottom right. Why is this happening and does it mean that the indicator will eventually max out as an output because it exceeds the MC max digits for same? I am attempting to replicate the native ADL indicator from TradingView, coded in PineScript, with this pared down version. Thanks for your insights!