Horizontal lines, start time, end time
- This topic has 5 replies, 2 voices, and was last updated 5 years ago by .
Viewing 6 posts - 1 through 6 (of 6 total)
Viewing 6 posts - 1 through 6 (of 6 total)
Similar topics:
Forums › ProRealTime English forum › ProBuilder support › Horizontal lines, start time, end time
Hi! I want to make an indicator to plot horizontal lines with manual input, but between specific times of the day. In detail, I want to have the option to put my preferred start time and end time of the day, and on those duration to have the option to put manual my prices for horizontal lines. As an extra, I will be happy if these lines has auto dynamic color (green>last price, red<last price) versus the last price. The lines I want to end at the end time. Something like the pivot points.. Can someone help me, please..
There you go:
|
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 |
//DEFPARAM DrawOnLastBarOnly = true //FromHour = 0 //ToHour = 120000 //Price = 0 ONCE PlotFlag = 0 IF (OpenTime = FromHour) OR ((OpenTime > FromHour) AND (OpenTime[1] < FromHour)) THEN PlotFlag = 1 StartBar = BarIndex ENDIF IF PlotFlag > 0 THEN EndBar = BarIndex r = 255 //Red g = 0 IF close > Price THEN r = 0 g = 202 //Green ENDIF DRAWSEGMENT(StartBar,Price,EndBar,Price) coloured(r,g,0,255) ENDIF IF ((OpenTime >= ToHour) OR (Price <= 0)) AND (PlotFlag = 1) THEN PlotFlag = 0 EndBar = BarIndex ENDIF RETURN |
You can import the attached ITF file with variables already set for the properties. If you pefer to Copy & Paste remove comments from lines 2-4.
Hey robertogozzi
It is possible to add a little text to that horizontal lines??????
There you go, replace XXXXXX with your text:
|
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 |
DEFPARAM DrawOnLastBarOnly = true //FromHour = 0 //ToHour = 120000 //Price = 0 //Distance = 10 ONCE PlotFlag = 0 IF (OpenTime = FromHour) OR ((OpenTime > FromHour) AND (OpenTime[1] < FromHour)) THEN PlotFlag = 1 StartBar = BarIndex ENDIF IF PlotFlag > 0 THEN EndBar = BarIndex r = 255 //Red g = 0 IF close > Price THEN r = 0 g = 202 //Green ENDIF DRAWSEGMENT(StartBar,Price,EndBar,Price) coloured(r,g,0,255) DRAWTEXT("XXXXXX",BarIndex,Price + Distance * PipSize) ENDIF IF ((OpenTime >= ToHour) OR (Price <= 0)) AND (PlotFlag = 1) THEN PlotFlag = 0 EndBar = BarIndex ENDIF RETURN |
I added variable Distance to plot the text at a distance from the line (it can be negative to plot below the line).
Find exclusive trading pro-tools on