I'm trying to draw a rectangle based on specific time and their corresponding high/low values.
So far I came up with this:
protected override void OnBarUpdate() { if (ToTime(Time[0]) >= 10000 && ToTime(Time[0]) <= 100000) { DrawRectangle("Tokyo_" + Time[0].ToString("MM/dd/yyyy"), false, 2, High[2], 1, Low[2], Color.Transparent, Color.Cyan, 3); } if (ToTime(Time[0]) >= 90000 && ToTime(Time[0]) <= 180000) { DrawRectangle("London_" + Time[0].ToString("MM/dd/yyyy"), false, 2, High[2], 1, Low[2], Color.Transparent, Color.Yellow, 3); } if (ToTime(Time[0]) >= 140000 && ToTime(Time[0]) <= 230000) { DrawRectangle("NewYork_" + Time[0].ToString("MM/dd/yyyy"), false, 2, High[2], 1, Low[2], Color.Transparent, Color.Fuchsia, 3); } }
Is there some function like FindHighByTime(time) to find the high price of the bar of the time I gave? And ofcourse also something like FindLowByTime.
Or maybe something like NumberOfBarsSinceTime(time).. If I have the number of bars, the I can use Highest[<and use the value the last function gave me>]
Looking forward to your suggestions.
Comment