New Members: Be sure to confirm your email address by clicking on the link that was sent to your email inbox. You will not be able to post messages until you click that link.
Hello, I am writing a script for pullbacks. Seems I am having issues when trying to add the inside day to my scan. I am trying to accomplish 3 days of lower daily lows, or two days of daily lower lows and an inside day. Thanks in advance
[type is stock]
and [country = US]
and [ [exchange is NYSE]
or [exchange is NASDAQ] ]
and [Volume > 500,000]
and [Close > 10]
and [Close > sma(20)]
and [Close > sma(50)]
and [ [Low IS BELOW 1 day ago low]
and [1 day ago Low IS BELOW 2 days ago low]
or [Low IS BELOW 1 day ago low]
and [1 day ago Low IS BELOW 2 days ago low]
and [High IS BELOW 1 day ago High]
and [Low IS ABOVE 1 day ago Low] ]
0
Comments
See if this re-grouping does it. I've added a pair of brackets around the two lines of the first "or" condition and another pair around the four lines of the second "or" condition.
P.S. I only checked the brackets, not the logic of each line.
[type is stock]
and [country = US]
and [ [exchange is NYSE]
or [exchange is NASDAQ] ]
and [Volume > 500,000]
and [Close > 10]
and [Close > sma(20)]
and [Close > sma(50)]
and
[ // begin "or"
[ // first "or" group
[Low IS BELOW 1 day ago low]
and [1 day ago Low IS BELOW 2 days ago low]
] // end first or group
or
[ // begin second "or" group
[Low IS BELOW 1 day ago low]
and [1 day ago Low IS BELOW 2 days ago low]
and [High IS BELOW 1 day ago High]
and [Low IS ABOVE 1 day ago Low]
] // end second or group
] // end "or"
[type is stock]
and [country = US]
and [ [exchange is NYSE]
or [exchange is NASDAQ] ]
and [Volume > 500,000]
and [Close > 10]
and [Close > sma(20)]
and [Close > sma(50)]
and
[[Low IS BELOW 1 day ago low]
and [1 day ago Low IS BELOW 2 days ago low]]
or
[[Low IS BELOW 1 day ago low]
and [1 day ago Low IS BELOW 2 days ago low]
and [High IS BELOW 1 day ago High]
and [Low IS ABOVE 1 day ago Low]]
I am very new to writing scripts. Thx
If your version has the same placement of brackets, then it's the same.
The slashes // are comment symbols, meaning the scan engine does not read anything after // on the same line.
Also, the scan engine allows blank lines - it figures out where the opening and closing brackets are and which goes with which even across multiple lines. So you can space out the scan lines as I did for readability. But everyone is different and your way is fine if it works for you.