Flat base consolidation 2
Forums › ProRealTime English forum › ProScreener support › Flat base consolidation 2
- This topic has 16 replies, 1 voice, and was last updated 3 months ago by IAmShareCrazy.
-
-
01/05/2018 at 6:37 PM #57418
HeLLo everybody! First of all thank you as always for your help and incredible work Nicolas
I have been using your screener flat base consolidation in daily chart and it is really helpful. This screener is helping me to indentify healthy trends and let me open position in the correct moment.
As you well know, in a trend the price consolidates forming a range expansion (flat base consolidation). When the price is in the range during a long time and the breakout happens, normally there is a big rally. The screener that you did works very well in daily charts when the range is small but it doesn´t work in a weekly chart or not identify charts in which the price has been in the range during 6 months or one year (several weeks)I would like to ask you for a flat base consolidation screener which identify charts where the price is in a long time range in a trend.Thank you very much123456789TIMEFRAME(weekly)fast = average[10](close)slow = average[40](close)spread = ((fast/slow)-1)*100flatrange = ABS((lowest[5](low)-highest[5](high))/close)*100c1 = fast>slow AND spread>10 AND close>fast AND flatrange<=15SCREENER[c1]01/06/2018 at 10:49 AM #57487Hi Talero125 … have you tried increasing flatrange to a suitable value to fit your requirement for consolidation over weeks / months / years?
Or have I misunderstood your problem?
1flatrange<=15Cheers
GraHalPS Please use the <> button to insert code as then it will be all nice and formatted and Nicolas and the Mods will be all nice and happy! 🙂
01/06/2018 at 11:17 AM #57492Also as your Screener code is a weekly Timeframe and you say … “not identify charts in which the price has been in the range during 6 months”
I think you need to change this …
1flatrange = ABS((lowest[5](low)–highest[5](high))/close)*100To This
1flatrange = ABS((lowest[26](low)–highest[26](high))/close)*100Or change Timeframe to ‘Months’ and your FlatRange would be (by default) 5 months.
Hope that helps? Try it and let us know please?
01/06/2018 at 11:37 AM #5749401/06/2018 at 5:16 PM #57510Thanks GraHal.
I think that looking for a flat range that has existed during 6 months is not compatible with the “spread” condition made between the 2 moving averages. This condition is made to know that the trend is bullish and well formed. So only a “small” flat range should be looked within this first “spread” condition. You can enlarge the period during the range has been identified, but not too far in the past or you will get only a few results and not really significant.
I refine the code by adding a “delay” (adjustable variable) for the flat range testing, because by playing with the code I realize that sometimes a breakout is occurring in the current candle and could modify what we looked for (the consolidation).
I also add a ‘stillinrange’ condition to ensure that the price hasn’t break the range:
no breakout123456789101112TIMEFRAME(weekly)fast = average[10](close)slow = average[40](close)spread = ((fast/slow)-1)*100delay = 1flatrange = ABS((lowest[10](low)[delay]-highest[10](high)[delay])/close)*100c1 = fast>slow AND spread>10 AND close>fast AND flatrange<=15stillinrange = close<highest[10](high)[delay]SCREENER[c1 and stillinrange](flatrange)This second version add a “breakout” condition of our flat base consolidation, you are right this screener is very powerful in a weekly timeframe:
range breakout123456789101112TIMEFRAME(weekly)fast = average[10](close)slow = average[40](close)spread = ((fast/slow)-1)*100delay = 1flatrange = ABS((lowest[10](low)[delay]-highest[10](high)[delay])/close)*100c1 = fast>slow AND spread>10 AND close>fast AND flatrange<=15breakout = close crosses over highest[10](high)[delay]SCREENER[c1 and breakout](flatrange)1 user thanked author for this post.
01/07/2018 at 10:47 AM #57568Thank you for your comments
Thinking about it, I exchanged the 10 and 40 moving avarage for 50 and 100. Futhermore, I added 200 moving average and spreadtwo<10. (look at the code).The idea is that all the moving averages are together. If the moving averages are together is due to the price has been in the same range many time. The disadvantage is that the code identify a lot of charts which are not in a uptrend. However, the code detects charts like Walt Disney (Walt Disney is the type of chart that I am looking for). After a very big rally, it has been consolidating for 2 years and if the breakout happens probably it will have a big rally.
What do you guys think about it?
Do you have any idea to improve this code so that detects only the charts with this pattern in a uptrend?
123456789101112TIMEFRAME(weekly)fast = average[50](close)slow = average[100](close)veryslow = average[200](close)spread = ((fast/slow)-1)*100spreadtwo = ((slow/veryslow)-1)*100flatrange = ABS((lowest[50](low)-highest[50](high))/close)c1 = fast>slow AND spread<10 AND close>fast AND flatrange<20 and spreadtwo<10SCREENER[c1]01/07/2018 at 11:12 AM #57572> For clarity of messages on ProRealCode’s forums, please use the “insert code PRT” button to separate the text of the code part! Thank you! <<
The price range you drawn on this Walt Disney price chart is purely visual and your own assumption that it were a flat range. If you zoom in into this period, you’ll not get the same picture. This is why it is very difficult to ‘code’ what is a range or not and how to make it “universal” for all stocks.
04/23/2018 at 8:53 PM #69021Bonjour
Merci pour votre aide pour la création de code.
Serai il possible d’avoir ces deux codes dans le cas d’une ventre à découvert en phase distribution ?
123456789101112TIMEFRAME(weekly)fast = average[10](close)slow = average[40](close)spread = ((fast/slow)–1)*100delay = 1flatrange = ABS((lowest[10](low)[delay]–highest[10](high)[delay])/close)*100c1 = fast>slow AND spread>10 AND close>fast AND flatrange<=15stillinrange = close<highest[10](high)[delay]SCREENER[c1 and stillinrange](flatrange)range breakout
123456789101112TIMEFRAME(weekly)fast = average[10](close)slow = average[40](close)spread = ((fast/slow)–1)*100delay = 1flatrange = ABS((lowest[10](low)[delay]–highest[10](high)[delay])/close)*100c1 = fast>slow AND spread>10 AND close>fast AND flatrange<=15breakout = close crosses over highest[10](high)[delay]SCREENER[c1 and breakout](flatrange)Merci
07/01/2018 at 8:35 AM #7497907/01/2018 at 8:40 AM #74980Je n’ai pas eu de réponse depuis y a t’il un souci avec ma question ?
English only in the English speaking forum please. 🙂
07/01/2018 at 10:06 AM #7498907/01/2018 at 10:22 AM #7499107/01/2018 at 11:37 AM #7499407/30/2018 at 1:42 PM #77076Thanks All.
I’ve been looking into something similar that scans for flat trading ranges or multi timeframe lows. I believe Nick Radge has advocated something similar. Maybe the inclusion of a rate of change (ROC) indicator? Radge looks for weekly charts that have 20 week ROC >30% as these have left ranges for some reason(news, technical etc) and close > 20 week high.
Maybe the inclusion of this element and then we could look at adding this to an automated strategy for backtesting results to see if it has merit? Maybe a starting account of £10,000 and system buys any stock that breaks out from ‘n’ period range and has ROC >30. Buy one contract with stop at [n] ATR(n) (or as Radge recommends, 40% below entry price if SP500 is trending up, 10% if SP500 is trending down) and take profits at [n] x ATR or other level (% based maybe). Could a ‘max gap’ code be added that eliminates any stock that ‘gaps-up’ > n(15)% for example (as gaps as often filled).
It’s a pity that PRT does not allow the integration of fundamental data into the scans (such as eliminate any stock with ROA or ROE < 5%). Maybe a suggestion for the future esp for IG Index clients as IG would have this data anyway?!
02/29/2024 at 9:19 PM #229007This looks very promising when combined with Dan Zanger criteria. Thanks for your input Nicolas as I am using the breakout screener
-
AuthorPosts
Find exclusive trading pro-tools on