MarketInfo on offline client in portable mode returns "empty" values.

Back to topics list To post a new topic, please log in or register
avatar
7
filson 2014.04.09 12: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?

avatar
3134
qjol 2014.04.09 14:59 #
 

Read this topic

avatar
Moderator
3206
angevoyageur 2014.04.09 23: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.

avatar
7
filson 2014.05.04 23: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?

avatar
Moderator
3206
angevoyageur 2014.05.05 23: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.

avatar
7
filson 2014.05.08 13: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.

avatar
3134
qjol 2014.05.08 13:42 #
 

Maybe you signed up in the past try Password recovery

avatar
Moderator
3206
angevoyageur 2014.05.08 21:08 #
 
qjol:

Maybe you signed up in the past try Password recovery

I can confirm, this is the procedure to follow.

avatar
7
filson 2014.05.09 15:53 #
 
Thank you.
avatar
10
ivolux 2015.06.08 10: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

 

Back to topics list  

To add comments, please log in or register