Download MetaTrader 5
To add comments, please log in or register
1000 developers are involved in Freelance service activity. Sign up!
filson
37
filson 2014.04.09 10:50 

Hey,

Using MT4 build 610 from Alpari in offline mode with the /portable runtime switch, I've hit several cases where MarketInfo() don't return meaningful values.

These few script lines shows what I get:

double tick_value = MarketInfo(Symbol(), MODE_TICKVALUE);
Print("Tick value : ",tick_value);                                   // Offline tick_value == 0.0

string lot_step = DoubleToStr(MarketInfo(Symbol(), MODE_LOTSTEP));   // Offline lot_step == 0
Print("Lot step : ",lot_step);

string min_lot = DoubleToStr(MarketInfo(Symbol(), MODE_MINLOT));     // Offline min_lot == 0
Print("Min. lots : ", min_lot);
   
string max_lot = DoubleToStr(MarketInfo(Symbol(), MODE_MAXLOT));     // Offline max_lot == 0.
Print("Max. lots : ", max_lot);


double risk = AccountBalance() * 2.0 / 100.0;                        // Offline AccountBalance() returns 0
Print("Risk : ", risk);

The above ofcourse works perfectly well in online mode, when there's a Trade tab visible in the client.

MT4 is installed outside the %Program Files% path.


https://forum.mql4.com/46922 and https://forum.mql4.com/57278 somewhat approaches the issue I'm seeing but leaves me no further to a solution.

Staying in online mode opens up a whole new lot of issues with testing I'd most certainly want to avoid.

Perhaps you've found a solution you'd like to share?

qjol
3243
qjol 2014.04.09 12:59  

Read this topic

Alain Verleyen
Moderator
28518
Alain Verleyen 2014.04.09 21:10  
filson:

Hey,

Using MT4 build 610 from Alpari in offline mode with the /portable runtime switch, I've hit several cases where MarketInfo() don't return meaningful values.

These few script lines shows what I get:

The above ofcourse works perfectly well in online mode, when there's a Trade tab visible in the client.

MT4 is installed outside the %Program Files% path.


https://forum.mql4.com/46922 and https://forum.mql4.com/57278 somewhat approaches the issue I'm seeing but leaves me no further to a solution.

Staying in online mode opens up a whole new lot of issues with testing I'd most certainly want to avoid.

Perhaps you've found a solution you'd like to share?

Current build(s) are 625/628, which are correcting a lot of problems from build 610.
filson
37
filson 2014.05.04 21:21  

I've updated to build 646 (latest as of today).

That does not solve the problem, angevoyageur.


I'll try the script fai made (i suppose that's what you refer to, qjol), although it seems written only for spread data.

Spread is increadibly important but it's not the only thing I need. MODE_TICKVALUE is of even higher priority.


Is the issue with missing offline MarketInfo data only relevant for scripts or does it also hamper offline Strategy Tester work?

Alain Verleyen
Moderator
28518
Alain Verleyen 2014.05.05 21:25  
filson:

I've updated to build 646 (latest as of today).

That does not solve the problem, angevoyageur.


I'll try the script fai made (i suppose that's what you refer to, qjol), although it seems written only for spread data.

Spread is increadibly important but it's not the only thing I need. MODE_TICKVALUE is of even higher priority.


Is the issue with missing offline MarketInfo data only relevant for scripts or does it also hamper offline Strategy Tester work?

If you found a bug with MT4, please report it to ServiceDesk of Metaquotes.
filson
37
filson 2014.05.08 11:29  

Thank you angevoyageur.

Could you link my mql4 account to the mql5 login so I can get the Service Desk/New Request bit in my profile?

Currently I get an invalid login error when using this account to log into mql5.com, and an username and email already in use when trying to register on mql5.

qjol
3243
qjol 2014.05.08 11:42  

Maybe you signed up in the past try Password recovery

Alain Verleyen
Moderator
28518
Alain Verleyen 2014.05.08 19:08  
qjol:

Maybe you signed up in the past try Password recovery

I can confirm, this is the procedure to follow.
filson
37
filson 2014.05.09 13:53  
Thank you.
Ivo Luhse
660
Ivo Luhse 2015.06.08 08:03  

Hi filson. 

Did you got this resolved?

I have exactly the same issue and can't seem to find a solution anywhere on the web.

When I run EA backtest Online its all good, but when running back test in offline I can't get  correct lot step and tick value so have wrong lot sizes for my trades.

When I run your script it returns 0 values

 

/
To add comments, please log in or register