Text Above Candles for Swing High and Swing Low
Forums › ProRealTime English forum › ProBuilder support › Text Above Candles for Swing High and Swing Low
- This topic has 24 replies, 5 voices, and was last updated 2 years ago by ZeroCafeine.
-
-
09/12/2022 at 3:15 PM #20062709/12/2022 at 3:36 PM #20062809/12/2022 at 3:42 PM #20063009/12/2022 at 4:25 PM #20063809/12/2022 at 4:39 PM #20063909/12/2022 at 5:08 PM #20064209/12/2022 at 5:21 PM #20064509/12/2022 at 5:28 PM #20064609/12/2022 at 5:28 PM #20064709/12/2022 at 7:15 PM #200655Swing High Swing Low123456789101112131415xPeriod = 20If High[1] = Highest[xPeriod](High) and High[2] < High[1] and High < High[1] thenSwingHigh = High[1]DrawArrowUP(BarIndex-1,High[1]+10) Coloured(0,255,0)DrawText("#SwingHigh#", BarIndex-1, High[1]+30,Dialog,Bold,15) Coloured(0,255,0)EndIfIf Low[1] = Lowest[xPeriod](Low) and Low[2] > Low[1] and Low > Low[1] thenSwingLow = Low[1]DrawArrowDown(BarIndex-1,Low[1]-10) Coloured(255,0,0)DrawText("#SwingLow#", BarIndex-1, Low[1]-30,Dialog,Bold,15) Coloured(255,0,0)EndIfReturn
Hi @Kole96
Swing High:
- Find the Highest High over the past 20 periods (the period is adjustable).
- Check if the previous candle makes a lower High than the Highest High.
- Check if the next candle makes a lower High than the Highest High
In principle, they are simple conditions that can possibly be extended with additional conditions for more adjacent candles. There are now three candles involved in a swing and you could expand this to, for example, 5 candles.
Swing Low is the mirror image of Swing High
3 users thanked author for this post.
09/12/2022 at 9:05 PM #20066009/13/2022 at 5:30 PM #200725hi every one hi @JS
I do some modification, but it’s just for learning and helping, what do you think about my code about : ù
– Drawing button, do you think it’s a goods idea, do have some tips ?
– about IF condition, I aded tomuch condition, do you think it’s more helper for prt CPU or more complicated this way ?1234567891011121314151617181920212223242526272829// Atributs :OffsetArrow = nOffsetA * pipsizeOffsetText = nOffsetT * pipsizePipi = pipsize// SwingHigh ConditionC1 = High[1] = Highest[xPeriod](High) and High[2] < High[1] and High < High[1]// SwingLow ConditionC2 = Low[1] = Lowest[xPeriod](Low) and Low[2] > Low[1] and Low > Low[1]IF C1 ThenIF DrawingText ThenDrawText("#SwingHigh#", BarIndex-1, High[1]+OffsetText,Dialog,Bold,15) Coloured(0,255,0)ENDIFIF DrawingArrow ThenDrawArrowUP(BarIndex-1,High[1]+OffsetArrow) Coloured(0,255,0)ENDIFENDIFIF C2 ThenIF DrawingText ThenDrawText("#SwingLow#", BarIndex-1, Low[1]-OffsetText,Dialog,Bold,15) Coloured(255,0,0)ENDIFIF DrawingArrow ThenDrawArrowDown(BarIndex-1,Low[1]-OffsetArrow) Coloured(255,0,0)ENDIFENDIFReturn
@Kole96 I hope this way with offset * pipsize will help you, tks to @robertogozzi he helped me one time with this tips2 users thanked author for this post.
09/13/2022 at 5:41 PM #200727other question, I just trayed to use this code on a Daily chat but with Weekly time frame, and I got all the text and the arrow only in the bigining of the chat, how to solve this problem ? I think we have to get the position of weekly candle for draw ?
1 user thanked author for this post.
09/13/2022 at 6:33 PM #200733At first glance I can’t find anything wrong.Try increasing the units up to 5K, or even more.
You should post the ITF file, as some variables are missing, so I can test it thoroughly.
1 user thanked author for this post.
09/13/2022 at 7:25 PM #200736so this the ITF file “Temps – Swing High”, it’s working correctly like on the Photo 01
but this ITF file “Temps – Swing High Weekly” with the instruction in line one with TimeFrame (Weekly) on the Daily chart I have the Photo 02 :
1TimeFrame (Weekly)the Idea it’s just to use the idea of SwingHigh and SwingLow on a daily chart with weekly value
-
AuthorPosts
Find exclusive trading pro-tools on