Initial Balance Stop Drawing at 230000
- This topic has 2 replies, 2 voices, and was last updated 1 year ago by .
Viewing 3 posts - 1 through 3 (of 3 total)
Viewing 3 posts - 1 through 3 (of 3 total)
Forums › ProRealTime English forum › ProBuilder support › Initial Balance Stop Drawing at 230000
hi, this a code to draw the Initial balance in my time zone, i need it to stop drawing when market closes .
Some Help?
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 |
DEFPARAM DrawOnLastBarOnly = true //timeframe(1 hour)// I declare the timeframe, if not this will give the high and low of the first candle of the timefrae selected StartTime = 143000// this is my zone start time EndTime = 153000 IF OpenTime = StartTime OR ((OpenTime > StartTime) AND (OpenTime < OpenTime[1])) THEN myBar = BarIndex HH = high LL = low ENDIF IF (OpenTime >= StartTime) AND (OpenTime <= EndTime) THEN HH = max(HH,high) LL = min(LL,low) ENDIF IF OpenTime >= EndTime THEN DrawSegment(myBar,HH,BarIndex,HH) coloured("Green",255) DrawSegment(myBar,LL,BarIndex,LL) coloured("Red",255) //lastsig = 1 ENDIF //if Endtime > 220000 then //lastsig = 0 //endif RETURN HH AS "IB 1Hr High",LL AS "IB 1Hr Low" |
Hi,
here’s one possible way to do it, on one hand keeping your combo drawonlastbaronly=true & drawsegments for live, and on the other hand keeping hh and ll values in the return line to have them available for color zone customisation in the properties window (assuming you want to keep the color zone as per your attached image even if the zone stops at midnight your timezone):
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 //timeframe(1 hour)// I declare the timeframe, if not this will give the high and low of the first candle of the timefrae selected StartTime = 143000// this is my zone start time EndTime = 153000 IF OpenTime = StartTime OR ((OpenTime > StartTime) AND (OpenTime < OpenTime[1])) THEN myBar = BarIndex HH = high LL = low ENDIF IF (OpenTime >= StartTime) AND (OpenTime <= EndTime) THEN HH = max(HH,high) LL = min(LL,low) ENDIF alpha=0 IF OpenTime >= EndTime then DrawSegment(myBar,HH,BarIndex,HH) coloured("Green",255) DrawSegment(myBar,LL,BarIndex,LL) coloured("Red",255) //lastsig = 1 alpha=255 elsif opentime<StartTime then hh=ll ENDIF //if Endtime > 220000 then //lastsig = 0 //endif RETURN HH coloured("Green",alpha) AS "IB 1Hr High", LL coloured("Red",alpha) AS "IB 1Hr Low" |