Draw lines and areas. Label lines
Forums › ProRealTime English forum › ProBuilder support › Draw lines and areas. Label lines
- This topic has 5 replies, 2 voices, and was last updated 13 hours ago by
theunpredictable.
-
-
12/17/2025 at 10:14 AM #25459912345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152// =======================================// DAILY-WERTE// =======================================timeframe(daily)// Tages-EröffnungdailyOpen = Open// Linien-Levelup65 = dailyOpen + 65up75 = dailyOpen + 75up115 = dailyOpen + 115up125 = dailyOpen + 125up160 = dailyOpen + 160down65 = dailyOpen - 65down75 = dailyopen - 75down115 = dailyOpen - 115down125 = dailyOpen - 125down160 = dailyOpen - 160// =======================================// ZURÜCK ZU M15// =======================================timeframe(default)// Linien nur von 08:00 bis 13:00 anzeigenIF Time >= 080000 AND Time <= 130000 THEN// ===== OBERHALB DES OPENS =====DRAWSEGMENT(barindex, up65, barindex + 1, up65) COLOURED(255,0,0)style(line,2)DRAWSEGMENT(barindex, up75, barindex + 1, up75) COLOURED(255,0,0)style(dottedline,2)DRAWSEGMENT(barindex, up115, barindex + 1, up115) COLOURED(255,0,0)style(line,2)DRAWSEGMENT(barindex, up125, barindex + 1, up125) COLOURED(255,0,0)style(dottedline, 2)DRAWSEGMENT(barindex, up160, barindex + 1, up160) COLOURED(0,0,0)style(line,2)DRAWRECTANGLE(barindex, down65, barindex+1, down75) fillcolor(200,200,255,230) coloured(200,200,255,230)DRAWRECTANGLE(barindex, down115, barindex+1, down125) fillcolor(200,200,255,230) coloured(200,200,255,230)DRAWRECTANGLE(barindex, up65, barindex+1, up75) fillcolor(200,200,255,230) coloured(200,200,255,230)DRAWRECTANGLE(barindex, up115, barindex+1, up125) fillcolor(200,200,255,230) coloured(200,200,255,230)// ===== UNTERHALB DES OPENS =====DRAWSEGMENT(barindex, down65, barindex + 1, down65) COLOURED(0,0,255)style(line,2)DRAWSEGMENT(barindex, down75, barindex + 1, down75) COLOURED(0,0,255)style(dottedline,2)DRAWSEGMENT(barindex, down115, barindex + 1, down115) COLOURED(0,0,255)style(line,2)DRAWSEGMENT(barindex, down125, barindex + 1, down125) COLOURED(0,0,255)style(dottedline,2)DRAWSEGMENT(barindex, down160, barindex + 1, down160) COLOURED(0,0,0)style(line,2)ENDIFRETURN
Hello everyone, I have been trying to build an indicator for lines and zones derived from the day’s opening price. I am able to draw lines, but I am unable to display the price value of the line on the right side of the line. I also haven’t been able to figure out how to fill in the zones cleanly. Does anyone have a simple trick for how to do this?
Thx in advance…
Best regards,
Björn
12/17/2025 at 10:37 AM #254603Use DrawText, like this example of your first line plotted:
12345// ===== OBERHALB DES OPENS =====DRAWSEGMENT(barindex, up65, barindex + 1, up65) COLOURED(255,0,0)style(line,2)IF IsLastBarUpdate THENDrawText("#up65#", barindex + 3, up65, dialog, bold, 10) COLOURED(255,0,0)ENDIFmore details at https://www.prorealcode.com/documentation/drawtext/.
2 users thanked author for this post.
12/17/2025 at 10:40 AM #25460412/17/2025 at 10:43 AM #254606Thank you for the very fast reply.
The line is now labeled, but each finished candle generates a new number.
Can this number, which is determined from the opening price in the morning, be displayed only once for the entire day?Regards, Björn
12/17/2025 at 6:27 PM #254616Add this line at the very beginning of your code:
1DEFPARAM DrawOnLastBarOnly = truebut this will remove all previous segments and rectangles.
If this is fine for you, then it’s the best solution, otherwise you will need to use two copies of the same indicator, one that draws all the segments and rectangles (it’s the one you are using now), the other one is the same, but will only plot the text at each new bar, which is this one:
1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162DEFPARAM DrawOnLastBarOnly = true// =======================================// DAILY-WERTE// =======================================timeframe(daily)// Tages-EröffnungdailyOpen = Open// Linien-Levelup65 = dailyOpen + 65up75 = dailyOpen + 75up115 = dailyOpen + 115up125 = dailyOpen + 125up160 = dailyOpen + 160down65 = dailyOpen - 65down75 = dailyopen - 75down115 = dailyOpen - 115down125 = dailyOpen - 125down160 = dailyOpen - 160// =======================================// ZURÜCK ZU M15// =======================================timeframe(default)// Linien nur von 08:00 bis 13:00 anzeigenIF Time >= 080000 AND Time <= 190000 THEN// ===== OBERHALB DES OPENS =====//DRAWSEGMENT(barindex, up65, barindex + 1, up65) COLOURED(255,0,0)style(line,2)DrawText("#up65#", barindex + 3, up65, dialog, bold, 10) COLOURED(255,0,0)//DRAWSEGMENT(barindex, up75, barindex + 1, up75) COLOURED(255,0,0)style(dottedline,2)DrawText("#up75#", barindex + 3, up75, dialog, bold, 10) COLOURED(255,0,0)//DRAWSEGMENT(barindex, up115, barindex + 1, up115) COLOURED(255,0,0)style(line,2)DrawText("#up115#", barindex + 3, up115, dialog, bold, 10) COLOURED(255,0,0)//DRAWSEGMENT(barindex, up125, barindex + 1, up125) COLOURED(255,0,0)style(dottedline, 2)DrawText("#up125#", barindex + 3, up125, dialog, bold, 10) COLOURED(255,0,0)//DRAWSEGMENT(barindex, up160, barindex + 1, up160) COLOURED(0,0,0)style(line,2)DrawText("#up160#", barindex + 3, up160, dialog, bold, 10) COLOURED(255,0,0)//DRAWRECTANGLE(barindex, down65, barindex+1, down75) fillcolor(200,200,255,230) coloured(200,200,255,230)//DRAWRECTANGLE(barindex, down115, barindex+1, down125) fillcolor(200,200,255,230) coloured(200,200,255,230)//DRAWRECTANGLE(barindex, up65, barindex+1, up75) fillcolor(200,200,255,230) coloured(200,200,255,230)//DRAWRECTANGLE(barindex, up115, barindex+1, up125) fillcolor(200,200,255,230) coloured(200,200,255,230)// ===== UNTERHALB DES OPENS =====//DRAWSEGMENT(barindex, down65, barindex + 1, down65) COLOURED(0,0,255)style(line,2)DrawText("#down65#", barindex + 3, down65, dialog, bold, 10) COLOURED(255,0,0)//DRAWSEGMENT(barindex, down75, barindex + 1, down75) COLOURED(0,0,255)style(dottedline,2)DrawText("#down75#", barindex + 3, down75, dialog, bold, 10) COLOURED(255,0,0)//DRAWSEGMENT(barindex, down115, barindex + 1, down115) COLOURED(0,0,255)style(line,2)DrawText("#down115#", barindex + 3, down115, dialog, bold, 10) COLOURED(255,0,0)//DRAWSEGMENT(barindex, down125, barindex + 1, down125) COLOURED(0,0,255)style(dottedline,2)DrawText("#down125#", barindex + 3, down125, dialog, bold, 10) COLOURED(255,0,0)//DRAWSEGMENT(barindex, down160, barindex + 1, down160) COLOURED(0,0,0)style(line,2)DrawText("#down160#", barindex + 3, down160, dialog, bold, 10) COLOURED(255,0,0)ENDIFRETURNadd both the indicators on your chart (using different names).
1 user thanked author for this post.
12/17/2025 at 7:26 PM #254617Thank you very much.
I will take the way with two copies of the Indi.
This will work for me.Best regards,
Björn1 user thanked author for this post.
-
AuthorPosts
Find exclusive trading pro-tools on