Price within x percent of high volume candle of past 10 days


Category:
0
0

Hi Pete!  Sorry for all the posts on the forum, I hope at least my questions are unique and challenging.  In TOS is it possible to get the close of the candle of the highest volume in the last 10 days (y).  I know you can just use last to get the last price and it’s easy enough to say within x % of two values I just don’t know how to get the value of the close of the candle with the most volume from the last 10 days.

 

Thanks!

Marked as spam
Posted by (Questions: 5, Answers: 3)
Asked on April 7, 2020 6:32 pm
84 views
0
Private answer

I think this will work. I only tested it for errors but did not test it for results.

input lookbackBars = 10;
input withinPercent = 2.0;
def highestVolume = Highest(volume, lookbackBars);
rec highestVolumeHigh = if volume == highestVolume then high else highestVolumeHigh[1];
plot scan = close > highestVolumeHigh * (1 - withinPercent * 0.01) and close < highestVolumeHigh * (1 + withinPercent * 0.01);

Marked as spam
Posted by (Questions: 37, Answers: 4118)
Answered on April 8, 2020 7:18 am