Relative volume scan after makert close and open


Category:
0
0

Hello,

Iwas thing of a scan that I run after the market close to chack stock with relative volume above 2 on the last 15min.

Aslo another that i run for relative volune above 2 15min after the market open.

I am flexible on varing the time

Thanks

Marked as spam
Posted by (Questions: 16, Answers: 12)
Asked on December 4, 2019 12:34 am
270 views
0
Private answer

I'm not sure why we would need to write any code to facilitate this. Just run the scan using a 15 min time frame. Then run the scan at the times you have determined are meaningful to you. If you can explain why that might not work it will perhaps give me some idea why a customized code solution is needed.

Marked as spam
Posted by (Questions: 37, Answers: 4118)
Answered on December 4, 2019 12:38 pm
0
I want it because i can run thr scan fir a specific time at any time even when that time has passed already. 15:45 through 16:00 08:30 through 09:45
( at December 4, 2019 12:48 pm)
0
Private answer

There is no such indicator on Thinkorswim named Relative Volume. The closest match to that name is RelativeVolumeStDev. If that is the study you are speaking of, then I will need to update the title of this question so that everyone else looking for a similar solution can find it.

So if you are speaking of RelativeVolumeStDev. Then the following code should do the trick. I did this mostly from memory and have only tested it for errors. Let me know if this does not produce the results you expect and I will test it out and make any corrections.

IMPORTANT NOTE: Scans always use Eastern Timezone, regardless of what time zone you are located.

input length = 60;
input startTime = 930;
input endTime = 945;
def targetPeriod = SecondsFromTime(startTime) >= 0 and SecondsTillTime(endTime) > 0;
input allowNegativeValues = no;
def rawRelVol = (volume - Average(volume, length)) / StDev(volume, length);
def relVol = if allowNegativeValues then rawRelVol else Max(0, rawRelVol);
rec trackRelVol = if targetPeriod and !targetPeriod[1] then relVol else if targetPeriod and relVol > trackRelVol[1] then relVol else trackRelVol[1];
plot scan = trackRelVol > 2;

Marked as spam
Posted by (Questions: 37, Answers: 4118)
Answered on December 4, 2019 7:39 pm