Forums › ProRealTime English forum › ProBuilder support › Indicator to display Asian time zones › Reply To: Indicator to display Asian time zones
03/26/2018 at 10:51 AM
#66423
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 25 26 27 28 29 30 31 32 |
DEFPARAM DrawOnLastBarOnly = True //Only display lines on the last bar (not to overstuff the chart with useless lines) // initialize variables at launchtime ONCE StartTime = 230000 //Start of Asian session ONCE EndTime = 080000 //End of Asian session ONCE AsianSession = 0 ONCE hh = 0 ONCE ll = 999999 // set variables at the beginning of every Asian session IF (time >= StartTime) OR (time < EndTime) AND (AsianSession = 0) THEN AsianSession = 1 hh = 0 ll = 999999 ENDIF // find Higher Highs and Lower Lows at each bar (while in the desired session) & colour Background IF AsianSession THEN hh = max(hh,high) ll = min(ll,low) backgroundcolor(220,220,220,255) //Grey Background ENDIF // initialize variables at the end of every Asian session IF (time >= EndTime) AND (time < StartTime) AND AsianSession THEN AsianSession = 0 ENDIF drawhline(hh)coloured(0,100,0,255) //Dark green for the Highest High drawhline(ll)coloured(139,0,0,255) //Dark Red for the Lowest Low RETURN |
It will display a grey background so that the session it is clearly defined and displays two lines for the highest high and the lowest low.
It’s up to you to adjust times and coloors to suit best your needs.
Roberto