Opening Volume Study and Scan


Category:
0
0

Hey there!

I have some fairly crude code, but it gets me what I want. I can grab the volume of the first 20 minutes with this, and it will show up on my label.

However, when I try to scan using the plot in my study and set it to search for > 20, it seems to return very random results. I cannot figure out why.

When I do this: CF_OpenVolume().”OpenVol” is greater than or equal to 20

  • It forces me to use ‘D’, as opposed to 10min (which is where my chart is usually set)

Any thoughts where I am going wrong?

Attachments:
Marked as spam
Posted by (Questions: 4, Answers: 6)
Asked on December 27, 2020 8:19 pm
121 views
1
Private answer

The problem is that your code is referencing the daily time frame. This is known as a "secondary aggregation period". These are not supported in Study Filters on Thinkorswim. This code cannot be used as a scan for anything except the daily time frame. You will need to re-write the code so that is works without the secondary aggregation periods.

What does the secondary aggregation period look like in your code?

volume(period = "DAY")

There is no simple solution to fix this. Meaning that in order to fix this would take far longer than the brief 15 minutes I permit for free solutions in the Q&A Forum.

Marked as spam
Posted by (Questions: 37, Answers: 4118)
Answered on December 28, 2020 9:02 am
0
Thanks for the response. One last question: Do you know of anywhere I can pay someone to help me code this?
( at December 29, 2020 9:54 am)
0
That is a service that I offer. I don't advertise it because I already have more than enough custom projects to work on. You will find that there are limitations when trying to build a scan for this. The intraday time frames of a scan are only able to go back about 6 or 7 days to compute historical values of this type. So instead of a 30 day average volume you would only be able to compute the average volume over the last 6 or 7 days.
( at December 29, 2020 4:13 pm)