Scan Current 30 Min HIGH within 0.5 percent of Previous 30 Min LOW


Category:
0
0

Hello,

Can you please help me to code for scan where current 30 Min bar HIGH within 0.5 percent of Previous 30 Min bar LOW.

Thanks in advance!

 

 

Marked as spam
Posted by (Questions: 7, Answers: 8)
Asked on December 18, 2018 11:58 am
68 views
0
Private answer

When you construct a scan you set the time frame using the built-in settings. So the code itself will not address the request for 30 min bar. You will simply set the Study Filter to 30 min time frame and insert the code.

plot scan = (high >= low[1] and high <= low[1] * 1.005) or (high <= low[1] and high >= low[1] * 0.995);

Important note. I have interpreted your request literally. “within 0.5 percent”. Which means the high may be below the previous bar’s low as well as being above it, so long as the percentage difference is less than or equal to 0.5%. If you intended to state: “greater than previous low but within 0.5% of the previous low”. This code will need to be modified.

Marked as spam
Posted by (Questions: 37, Answers: 4087)
Answered on December 18, 2018 2:48 pm