OHLC Bar Construction Between Brokers

 

I think most MT4 programmers have had EA that performs well with one Broker, but not so well with another Broker. One of my EA takes High and Low values as a Bar is developing to calculate order entry position. And as such, Bar OHLC values between Brokers with different server times are very different.

Is there a way to code an EA that can take another Broker's server time of when a Bar opens and by server time conversion calculate converted OHLC values for a TimeFrame range?

Example:

TimeFrame - D1

Broker #1 - GMT/Server Time difference = -2, EA test results good.

Broker #2 - GMT/Server Time difference = 0, EA test results bad.

Broker #1 Bar Open Price is 22:00 GMT and Bar Close Price is 21:59 GMT next day.

Broker #2 Bar Open Price is 00:00 GMT and Bar Close Price is 23:59 GMT same day.

An EA code that could run in Broker #2 and calcuate an Open Price at 22:00 GMT and a Close Price 21:59 next day. Then continually find High and Low prices as they develop within this D1 time period.

Thanking you in advance.

 
no,  naturally,  different broker has different price, not only time different.
 
Yes it's possible to create such an EA to produce similar bars. Not an exact one as each broker has slightly different pricing.
To create such a bar, you have to use lower time frame. In this case you can use TFH1.
Compute daily OHLC from 24 OHLC of hourly bars.
Reason: