Hey,
I'm a little stuck here while making a modification in broker interface. Now I need to write a function that correctly recalculate the OHLC prices of candles in metatrader platform.
Metatrader 3 chart combines both Bid and Ask price in the same candle (High of candle is the highest
ask price, Low is the lowest bid price, Open and Close = Bid + Ask / 2). What I'd like to do here is to recalculate candle OHLC to be based in Bid price only. It seems easy, but...
The problem here is how to calculate the Open and Close price when the result of
Bid + Ask / 2 is need to be round up (has a value smaller in a pip). Example, Bid + Ask /2 of EURUSD = 1.24485. This price cannot be display on chart, so what is the way to round it? I've observed this for a day now, and i'm still very confused. Sometimes, MetaTrader round it down to 1.2448, but sometimes round it up to 1.2449.
Hope you can help me with this.
