I was wondering if it's possible to make a scan limited to a certain time period in the day. Specifically the first 15 mins after open. I want the scan to only output stocks that are exhibiting the filters I've set only at that exact time period in the day.
So I have a MTF MACD indicator that Hahn Tech publicly released. The histogram turns red or green if the Current, Mid, and Long term time frames are in conjunction. It took me some time to make a scan for it, but I got around TOS's "second aggregation not allowed". But I only want the scan to be limited to the first 15 mins of market open.
Could this thinkScript work, if I entered it correctly to the scan code? Or is there something better/easier?:
So I have a MTF MACD indicator that Hahn Tech publicly released. The histogram turns red or green if the Current, Mid, and Long term time frames are in conjunction. It took me some time to make a scan for it, but I got around TOS's "second aggregation not allowed". But I only want the scan to be limited to the first 15 mins of market open.
Could this thinkScript work, if I entered it correctly to the scan code? Or is there something better/easier?:
Code:
input OpenTime = 930;
input DurationMinutes = 15;
def durationSec = DurationMinutes * 60;
def secondsPassed = SecondsFromTime(OpenTime);
def within = if secondsPassed >= 0 and secondsPassed <= durationSec then close else Double.NaN;