List of Stocks below ATR Stop Line
Forums › ProRealTime English forum › ProScreener support › List of Stocks below ATR Stop Line
- This topic has 7 replies, 2 voices, and was last updated 6 years ago by rowestock.
-
-
07/23/2018 at 8:24 PM #76550
List of Stocks/Instruments above/below ATR Stop Line
The code below is the ATR stop line indicator (very similar to “Supertrend”).
I would like to create a screener which finds stocks which are trading:
- Above their ATR stop line
- Below their ATR stop line
Can someone help?
Many thanks 🙂
ATR Stop Line123456789101112131415161718192021222324252627282930313233// Périodep = 10// Average True Range XATRx = AverageTrueRange[p](close) * 3.0// ATRts = ATR Trailing Stop// Inversion de tendanceIF close crosses over ATRts THENATRts = close - ATRxr=0g=200ELSIF close crosses under ATRts THENATRts = close + ATRxr=200g=0ENDIF// Cacul de l'ATRts lors de la même tendanceIF close > ATRts THENATRnew = close - ATRxIF ATRnew > ATRts THENATRts = ATRnewENDIFELSIF close < ATRts THENATRnew = close + ATRxIF ATRnew < ATRts THENATRts = ATRnewENDIFENDIFreturn ATRts coloured(r,g,0) as "ATR Trailing Stop"07/23/2018 at 11:29 PM #76560This is the code, but it will return tons of lines, you’ll have to filter them!
ATR stop screener1234567891011121314151617181920212223242526272829303132333435363738// Périodep = 10// Average True Range XATRx = AverageTrueRange[p](close) * 3.0// ATRts = ATR Trailing Stop// Inversion de tendanceIF close crosses over ATRts THENATRts = close - ATRx//r=0//g=200ELSIF close crosses under ATRts THENATRts = close + ATRx//r=200//g=0ENDIF// Cacul de l'ATRts lors de la même tendanceIF close > ATRts THENATRnew = close - ATRxIF ATRnew > ATRts THENATRts = ATRnewENDIFELSIF close < ATRts THENATRnew = close + ATRxIF ATRnew < ATRts THENATRts = ATRnewENDIFENDIFx = 0IF close > ATRts THENx = 1ELSEx = 2ENDIFSCREENER [x] (x AS "1=above/2=below")07/24/2018 at 12:18 AM #76561Excellent thanks Roberto. Is there a way to make the list more than 50 results? See screenshot.
Also, is there a way to see the 1 & 2 (Above & Below) results in one window? I can only separate the results of the screener using the “creation by programming” tab.
07/24/2018 at 10:07 AM #76582That limit cannot be changed, as of this version of PRT.
You could duplicate the screener and have one of them return only 1’s and the other only 2’s. This way you’ll double the list, but will also double the screeners you’ll have to open.
If you don’t have problems with the number of screeners open, you can select commodities on one of them, currencies on a duplicate, and so on!
There’s no workaround.
You could, for example, only stocks NOT above/below, but those where a crossing over/under is occurring, replacing lines 33-37 with:
12345IF close CROSSES OVER ATRts THENx = 1ELSIF close CROSSES UNDER ATRts THENx = 2ENDIFor scan those stocks that are not just above/below now, but have been above/below for at least the last 3 bars, or setting an increasing number to sort them, one screener showing the first 50 lines, another one another 50 lines… I’ll work on that!
filters are the only chance to get less than 50 lines!
07/24/2018 at 11:40 AM #76595This is the version with CROSSOVERs
ATR stop screener with CROSSOVERs123456789101112131415161718192021222324252627282930313233343536373839// Périodep = 10// Average True Range XATRx = AverageTrueRange[p](close) * 3.0// ATRts = ATR Trailing Stop// Inversion de tendanceIF close crosses over ATRts THENATRts = close - ATRx//r=0//g=200ELSIF close crosses under ATRts THENATRts = close + ATRx//r=200//g=0ENDIF// Cacul de l'ATRts lors de la même tendanceIF close > ATRts THENATRnew = close - ATRxIF ATRnew > ATRts THENATRts = ATRnewENDIFELSIF close < ATRts THENATRnew = close + ATRxIF ATRnew < ATRts THENATRts = ATRnewENDIFENDIFx = 0IF close CROSSES OVER ATRts THENx = 1ELSIF close CROSSES UNDER ATRts THENx = 2ENDIFSCREENER [x] (x AS "1=above/2=below")07/24/2018 at 11:43 AM #7659607/24/2018 at 11:47 AM #76597This is the version scanning for Stocks/Pairs being Above/Below for the latest 40 bars:
ATR stop screener using SUMMATION12345678910111213141516171819202122232425262728293031323334353637383940// Périodep = 10// Average True Range XATRx = AverageTrueRange[p](close) * 3.0// ATRts = ATR Trailing Stop// Inversion de tendanceIF close crosses over ATRts THENATRts = close - ATRx//r=0//g=200ELSIF close crosses under ATRts THENATRts = close + ATRx//r=200//g=0ENDIF// Cacul de l'ATRts lors de la même tendanceIF close > ATRts THENATRnew = close - ATRxIF ATRnew > ATRts THENATRts = ATRnewENDIFELSIF close < ATRts THENATRnew = close + ATRxIF ATRnew < ATRts THENATRts = ATRnewENDIFENDIFLookBack = 40x = 0IF summation[LookBack](close > ATRts) = LookBack THENx = 1ELSIF summation[LookBack](close < ATRts) = LookBack THENx = 2ENDIFSCREENER [x] (x AS "1=above/2=below")I could not find a way to set a count to limit display to the first 50 lines, or the second 50 lines, and so on…
I’ll try to find a way, but remind me within, say, 10 days.
07/24/2018 at 11:48 AM #76598 -
AuthorPosts
Find exclusive trading pro-tools on