Time when accdist moved below accdist high


Category:
0
0

Hi Pete:

I’ve trying to code the accdist indicator to tell me when it moves off of the high or low. Here is my code

declare lower;
input length = 5;
def CLV = CloseLocationValue();
def spxvol = close(“$TVOLSPC”) – open(“$TVOLSPC”);
def rutvol = close(“$TVOLRLC”) – open(“$TVOLRLC”);
def vol = if (GetSymbol() == “SPX”) then spxvol else
if (GetSymbol() == “RUT”) then rutvol else 0;
plot AccDist = TotalSum(vol * CLV);
def xaccdisthigh = Highest(AccDist, length);
def xaccdistlow = Lowest(AccDist, length);

Thanks in advance

 

Shawn

Marked as spam
Posted by (Questions: 1, Answers: 0)
Asked on October 2, 2019 9:03 pm
65 views
0
I'm not sure exactly what you are requesting. You posted this in the Chart Studies topic. So first guess is that you want a chart study solution. However you posted code that already does this. The only thing lacking is to convert those last two lines from def to plot. So you can see when the plot moves back up from it's low or back down from its high. What did I miss?
( at October 4, 2019 9:22 am)
0
Final notice. Need some more details before a solution can be provided. I will remove this from the forum unless those details are provided.
( at October 11, 2019 8:06 am)