♥ 0 |
Hi Pete, I am trying to build a scanner to find stocks where 30m candle is crossing previous month close. I am stuck right now as it does not allow me to use aggregation period for 30m time frame scan. How do I get previous month’s close in my code? Thank you. Sunil.
Marked as spam
|
Private answer
This sort of solution has already been provided in various forms, but not for the monthly time frame. The method is the same, we just use a function named "GetMonth()" in place of "GetDay()" or "GetWeek()". There is a limit to the amount of historical data available to the Study Filters of any scan. The historical data limit is based on the time frame selected. For the 30 minute time frame, the Study Filter is only able to look back about 11 trading days. This is not sufficient to accomplish what you have requested using the 30 minute time frame. Details Here: https://toslc.thinkorswim.com/center/howToTos/thinkManual/Scan/Stock-Hacker/studyfilters Of all the links to the Thinkorswim language reference, this one is the most commonly used in this forum. Many users of Thinkorswim are not aware of the historical data limits for Study Filters in custom scans. I can provide the code for this. However due to the limitations just explained, it will only work for time frames of 1 hour or higher. Anything less than 1 hour time frame will fail.
Marked as spam
|
Please log in to post questions.