♥ 0 |
Pete I have a study that colors my bars red/green and yellow for neutral…I was looking to scan for stock that are all red or green in multiple time frames…I would only get results if the 5,10,15,20,30,1hr.2hr,4hr and daily are all geeen. Or a variation of that…
DefineGlobalColor(“Long”, Color.GREEN); input DMIlength = 14; input volumeAveragingLength = 20; input enableAlerts = NO; plot scan = if long then 1 else if short then -1 else 0; This is is a picture with my MTF indicator showing all are in line except the Daily.
Marked as spam
|
Private answer
For custom scans, there is nothing you can do to the code to accomplish this. The signals of a scan exist for a single time frame that is assigned at the Study Filter level. (which is a level that lies above the code). The code for a Study Filter is not able to reference secondary aggregation periods. The only way you can create scans that reference multiple time frames (MTF) is to apply multiple Study Filters with the same code and set each Study Filter to a different time frame. A perfect example of this is shown in the following article: https://www.hahn-tech.com/thinkorswim-mtf-macd-scan/
Marked as spam
|
Please log in to post questions.