Multi TIme Frame Custom Scan


Category:
0
0

I have a custom indicator that counts the number of bars passed when the condition is true.

I am using that study in the Scan across 2 time frames

Condition 1 : BarCount > 0 on Daily Time Frame

Condition 2 :  BarCount = 1 or BarCount =2 in Two Hour Time Frame

When i run the scan i am getting incosistent results, If i run individually i get correct results, Can you please let me know if i am doing something wrong

Attachments:
Marked as spam
Posted by (Questions: 1, Answers: 1)
Asked on July 16, 2020 8:36 pm
103 views
0
Private answer

Sorry, I spent 14 min working with this and found only a couple of stocks that turn up in the scan results but don't belong. And I have no clue what the reason is. I did confirm those stocks will show up in the scan results when both time frames are include but also when only the 2 hour time frame is included. So there might be something wrong with the historical data for some stocks. What is really strange is that even the ParabolicSAR is on the wrong side for these invalid results.

Final note, there are MUCH simpler ways to check of the Hull moving average is trending up or down. Looking at your code I find no reason why such a complicated computation is required to find the direction of the Hull moving average. Seems to me to be a bit over-engineered. Remember that complexity breeds fragility. The most basic solutions are preferred and complexity should only be added when absolutely necessary.

For example the way the built-in study named "HullMovingAvg" changes the color based on direction is very basic:

HMA.AssignValueColor(if HMA > HMA[1] then HMA.color("Up") else HMA.color("Down"));

I am not suggesting that will fix the problem, but it sure is much easier to compute. (I ran way over time on this solution and don't have time to test it).

Marked as spam
Posted by (Questions: 37, Answers: 4090)
Answered on July 17, 2020 8:37 am
0
Thank you. Appreciate your help.
( at July 17, 2020 6:41 pm)