Support/Resistance for all timeframes
Forums › ProRealTime English forum › ProBuilder support › Support/Resistance for all timeframes
- This topic has 13 replies, 6 voices, and was last updated 4 years ago by robertogozzi.
-
-
12/06/2018 at 12:22 PM #86430
Hello Nicolas and others,
Is it possible to make an indicator that does the following on all timeframes.
At a price bar preceded by 4 higher lows and followed by 2 higher lows, then display a green support line. It starts at the lowest low and stops until the line is later crossed or when a new support is formed later.The same for a red resistance line at a price bar with 4 lower Highs before and followed by 2 lower Highs.
The 4 or 2 lower/higher bars do not have to have an order, the only criterion is lower / higher
I hope you can help me, it turned out to be an excellent help in my previous software.
12/06/2018 at 3:19 PM #8644212/06/2018 at 4:58 PM #8646012/07/2018 at 11:47 AM #86502There you go:
1234567891011121314151617181920DEFPARAM CalculateOnLastBars = 1000//DEFPARAM DrawOnLastBarOnly = truePivotBAR = 2 //2 bars AFTER pivotLookBack = 4 //3 bars BEFORE pivotBarLookBack = PivotBAR + 1IF low[PivotBAR] < lowest[LookBack](low)[BarLookBack] THENIF low[PivotBAR] = lowest[BarLookBack](low) THENMySupport = BarIndex - PivotBARSupportPrice = low[PivotBAR]ENDIFENDIFIF high[PivotBAR] > highest[LookBack](high)[BarLookBack] THENIF high[PivotBAR] = highest[BarLookBack](high) THENMyResistance = BarIndex - PivotBARResistancePrice = high[PivotBAR]//high[BarIndex - MyResistance]ENDIFENDIFDRAWSEGMENT(MyResistance,ResistancePrice,BarIndex,ResistancePrice) COLOURED(255,0,0,255)DRAWSEGMENT(MySupport,SupportPrice,BarIndex,SupportPrice) COLOURED(0,128,0,255)RETURNPic X1 shows the outcome.
If you prefer pic X2 just uncomment line 2.
12/07/2018 at 12:18 PM #8651005/02/2019 at 11:36 AM #9752005/02/2019 at 12:17 PM #97528Uncommenting line 2 does a similar job easily, can this do?
05/02/2019 at 1:12 PM #97533Uncommenting line 2 does a similar job easily, can this do?
Well , not exactly…if uncommenting line 2 it will just draw the latest S/R. I mean I would like it to extend ALL the S/R lines for X bars . Why you may ask? I work on the 15 min TF and I found that the S/R are usually valid for 1 or 2 days, that its like 100/200 bars in a 15m TF. (pls check pic of the DAX today with hand drawn S/R)
05/02/2019 at 1:35 PM #97537Added the code to here Snippet Link Library
1 user thanked author for this post.
05/02/2019 at 2:35 PM #97540PRT does not support arrays so it’s difficult to draw many lines in the past.
I modified the above code to show, in addition to the most recent S & R lines, the previous ones too.
You can add more if you need, with some coding effort.
1234567891011121314151617181920212223242526DEFPARAM CalculateOnLastBars = 1000DEFPARAM DrawOnLastBarOnly = truePivotBAR = 2 //2 bars AFTER pivotLookBack = 4 //3 bars BEFORE pivotBarLookBack = PivotBAR + 1IF low[PivotBAR] < lowest[LookBack](low)[BarLookBack] THENIF low[PivotBAR] = lowest[BarLookBack](low) THENPrevSupp = MySupportPrevSuppPrice = SupportPriceMySupport = BarIndex - PivotBARSupportPrice = low[PivotBAR]ENDIFENDIFIF high[PivotBAR] > highest[LookBack](high)[BarLookBack] THENIF high[PivotBAR] = highest[BarLookBack](high) THENPrevRes = MyResistancePrevResPrice = ResistancePriceMyResistance = BarIndex - PivotBARResistancePrice = high[PivotBAR]ENDIFENDIFDRAWSEGMENT(PrevRes,PrevResPrice,BarIndex,PrevResPrice) COLOURED(255,0,0,255)DRAWSEGMENT(PrevSupp,PrevSuppPrice,BarIndex,PrevSuppPrice) COLOURED(0,128,0,255)DRAWSEGMENT(MyResistance,ResistancePrice,BarIndex,ResistancePrice) COLOURED(255,0,0,255)DRAWSEGMENT(MySupport,SupportPrice,BarIndex,SupportPrice) COLOURED(0,128,0,255)RETURN05/02/2019 at 3:11 PM #9754610/09/2020 at 9:16 AM #14683310/09/2020 at 10:03 AM #146842Only post in the language of the forumthat you are posting in. For example English only in the English speaking forums and French only in the French speaking forums.
Thank you 🙂
10/09/2020 at 10:08 AM #146843As a common rule, I’d say:
- If you go LONG below SupportPrice
- If you go SHORT above ResistancePrice.
How many pips is just a matter of personal choices and and risk aversion attitude.
-
AuthorPosts
Find exclusive trading pro-tools on