♥ 0 |
First, thanks a ton for this forum. I’m already successfully using some custom scripts you’ve provided in other posts within my scans. What I can’t seem to figure out is the following for a TOS scan: How can I tell my scan to find stocks if they meet my filter criteria AND ONLY if they meet the criteria within the last 2 hours of regular market hours. Currently I have some daily dollar volume scans running throughout the day, and stocks will appear on them as the $ volume threshold is met… but I would like to duplicate one of these scans and tell it show me only the stocks that meet the thresh hold in the last 2 hours of the day (and not before). Technically, these stocks are showing up on the scans I already have, but by the end of the day, they’re mixed in with 20+ other stocks that were added throughout the morning and they’re difficult to separate (or know exactly when they appear). If I could create a scan for just those last 2 hours, the moment a stock pops up on it, I will know it’s what I’m looking for. Any help is appreciated, thanks! Jake RESOLVED
Marked as spam
|
Amazing, thanks so much. Installed just now and will see how it goes later today!
Ok, so you will need to apply my code directly to your volume study filter instead of adding this code as a separate study filter. But you did not provide the code for your volume filter and I cannot give you an exact solution. Basically, what you have for the plot statement on your volume filter, you will need to add the code for the “last two hour” filter.
So if you have this for volume filter:
plot scan = myVolumeFilter;
You would add my code and apply it to the end of your volume filter. Like this:
def sessionEnd =SecondsTillTime(1500)
Currently, the scan I’m trying from my last comment — with the sessionEnd element added to the $ volume scan — is showing the same stocks as the original scan (and during mid-day trading). Hmmm, still not sure on what needs to change.
Here is the scan link: http://tos.mx/FAEL70
def volumeDollars = Round(volume * hlc3, 0);
def newDay = GetDay() GetDay()[1];
rec todaysVolumeDollars = if newDay then volumeDollars else todaysVolumeDollars[1] + volumeDollars;
def sessionEnd =SecondsTillTime(1500) <= 0;
def targetZone = sessionEnd[-1] or sessionEnd;
plot scan = todaysVolumeDollars > 15000 and targetZone;