Same EA runs completly different on two different version of MT4

 

Hello,

I made an EA on MT version 4.00 Build 228 and then opened a Demo account. The Demo account version of MT is 4.00 Build 229.

The EA that got ported to Build 229 only had 3 changes total that dealt with the formatting of stop loss since Build 229 displays prices on EURUSD as 1.3xxxx.

On Build 228 it displays them as 1.3xxx

Build 228:

extern int StopLoss = 20;
        
StopLossLong=NormalizeDouble(Ask-StopLoss*Point,4);
ticketLong=OrderSend(Symbol(),OP_BUY,Lots,Ask,3,StopLossLong,0,"",1242,0,Green);
StopLossShort=NormalizeDouble(Bid+StopLoss*Point,4);
ticketShort=OrderSend(Symbol(),OP_SELL,Lots,Bid,3,StopLossShort,0,"",1242,0,Red);

Build 229:

extern int StopLoss = 200;
     
StopLossLong=Ask-StopLoss*Point;
ticketLong=OrderSend(Symbol(),OP_BUY,Lots,Ask,3,StopLossLong,0,"",1242,0,Green);  
StopLossShort=Bid+StopLoss*Point;
ticketShort=OrderSend(Symbol(),OP_SELL,Lots,Bid,3,StopLossShort,0,"",1242,0,Red);

Active orders get placed with the right SL on both Build 228 and 229 but the outcomes are way different.

Does anyone know how to change the price of Build 229 of 1.3xxxx to the classic 1.3xxx? Otherwise anyone know why the difference?

 
geo1242:

[...] Build 229 displays prices on EURUSD as 1.3xxxx. On Build 228 it displays them as 1.3xxx [...]

You sure you got your facts right? Sounds like u are using 2 different brokers... The number of Digits is a property of the Server, not the Terminal.
 
Some brokers have both 4 digit and 5 digit servers. IBFX had both for some time.
extern int StopLoss = 200;
StopLossLong=Ask-StopLoss*Point;
Your EA should adjust TP, SL, and slippage for 5 digit brokers:
//++++ These are adjusted for 5 digit brokers.
double  pips2points,    // slippage  3 pips    3=points    30=points
        pips2dbl;       // Stoploss 15 pips    0.0015      0.00150
int     Digits.pips;    // DoubleToStr(dbl/pips2dbl, Digits.pips)
int init(){
    if (Digits == 5 || Digits == 3){    // Adjust for five (5) digit brokers.
                pips2dbl    = Point*10; pips2points = 10;   Digits.pips = 1;
    } else {    pips2dbl    = Point;    pips2points =  1;   Digits.pips = 0; }
    // OrderSend(... Slippage.Pips * pips2points, Bid - StopLossPips * pips2dbl
 
WHRoeder:
Some brokers have both 4 digit and 5 digit servers. IBFX had both for some time.
Really...? But surely these 2 servers have a different srv file (I mean u need to select a different server in the 'Login' window)?
 
gordon:
Really...? But surely these 2 servers have a different srv file (I mean u need to select a different server in the 'Login' window)?
Exactly. User selected.
 
WHRoeder:
Exactly. User selected.
In that case it has nothing to do with the update to 229, it's due to connecting to a completely different server/account. The OP claims that a Terminal update brought this change; I find that hard to believe.
 

Build 228 is my actual account Build 229 is the Demo from the same broker. When i try the credentials in Build228 they won't connect, keeps saying invalid account. I tried looking under the options tab and I can't see the Demo servers address, in hopes of adding it to the Build228.


But that still doesn't explain why the EA runs different on the two different data sets?

 
geo1242:

Build 228 is my actual account Build 229 is the Demo from the same broker. When i try the credentials in Build228 they won't connect, keeps saying invalid account. I tried looking under the options tab and I can't see the Demo servers address, in hopes of adding it to the Build228.


But that still doesn't explain why the EA runs different on the two different data sets?


only change Stoploss and Takeprofit for 5 Digit Brokers will not be enough...

Also Slippage for Example, Trailingstops etc will need adjustment (ticketLong=OrderSend(Symbol(),OP_BUY,Lots,Ask,3,StopLossLong,0,"",1242,0,Green))

Maybe some orders was not fullfilled about to less slippage?

 
geo1242:

Build 228 is my actual account Build 229 is the Demo from the same broker. When i try the credentials in Build228 they won't connect, keeps saying invalid account. I tried looking under the options tab and I can't see the Demo servers address, in hopes of adding it to the Build228.

But that still doesn't explain why the EA runs different on the two different data sets?

I doubt it has anything to do with which Terminal build you are using. Demo and Live servers are 2 different servers. Apparently your broker has different 'Digits' setting for each (this is not very common...), which explains why your EA behaves differently on each.

Regarding why u can't log onto the Demo account - are u sure u selected the right server in the 'Login' window? Maybe the account has been deleted? Did you contact your broker's support...?
Reason: