# Hello Guys How i'm searching for some code or way to detect if the bar (candle) draw (break) high first or low first

Hello Guys How i'm searching for some code or way to detect if the bar (candle) draw (break) high first or low first - or how to get the time when the candle was at hiesght price and what time the candle on the lowest price

Ahmed Zaki:
Hello Guys How i'm searching for some code or way to detect if the bar (candle) draw (break) high first or low first - or how to get the time when the candle was at hiesght price and what time the candle on the lowest price

What have you tried ?

Show your attempt if you need coding help.

just use indicators to find out the upper and lower limits of the candle

Ahmed Zaki:
Hello Guys How i'm searching for some code or way to detect if the bar (candle) draw (break) high first or low first - or how to get the time when the candle was at hiesght price and what time the candle on the lowest price

So for a new bar you want to know how many times it formed a new high and how many times it formed a new low ?

One way is to check the lowest available timeframe , or the ticks the broker provides .

You'll have to go m1 bar by m1 bar or tick by tick after the open time of the bar because the ohlc data does not contain time of high and time of low.

Ahmed Zaki i'm searching for some code or way to detect if the bar (candle) draw (break) high first or low first - or how to get the time when the candle was at hiesght price and what time the candle on the lowest price
1. Remember that it can make a low, then a high, then a lower low, etc. “low first” is ambiguous. When it makes the lowest low,, is not.
2. Use the M1 bars. Find the indexes of the lowest low/the highest high, and you have your result.
Reason: