HELP needed : SymbolinfoTick and StrategyTester

 

Hello,

I tried to compare results of optimization and result from an EA in Live mode.

To be able to have same result in both mode, we need to share the same prices between StrategyTester and EA running in Live mode (even on past data), and I realized that values sent bu SymbolInfoTick and CopyTicksRange or CopyTicks are differents :

I should do something wrong, any idea?


Best regards,


Same EA in Strategy Tester and Live trading

//+------------------------------------------------------------------+
//|                                      och_test_SymbolInfoTick.mq5 |
//|                        Copyright 2021, MetaQuotes Software Corp. |
//|                                             https://www.mql5.com |
//+------------------------------------------------------------------+
#property copyright "Copyright 2021, MetaQuotes Software Corp."
#property link      "https://www.mql5.com"
#property version   "1.00"

bool     run_once = true;
MqlTick  tick;
MqlTick  ticks[];
int ticks_count=0;
//+------------------------------------------------------------------+
//| Expert initialization function                                   |
//+------------------------------------------------------------------+
int OnInit()
  {
//---
   
//---
   return(INIT_SUCCEEDED);
  }
//+------------------------------------------------------------------+
//| Expert deinitialization function                                 |
//+------------------------------------------------------------------+
void OnDeinit(const int reason)
  {
//---
   
  }
//+------------------------------------------------------------------+
//| Expert tick function                                             |
//+------------------------------------------------------------------+
void OnTick()
  {
//---
      if(MQLInfoInteger(MQL_TESTER)){
         if(run_once) Print("EA is runing on Testing mode.");
         ::SymbolInfoTick(Symbol(), tick);
         if(tick.time>=D'2021.01.04 11:44' && tick.time <= D'2021.01.04 11:46'){
            PrintFormat("tick_id=%d, tick.time = %s, tick.ask = %.3f, tick.bid = %.3f", ticks_count, TimeToString(tick.time, TIME_DATE|TIME_SECONDS), tick.ask, tick.bid);
            ticks_count++;
         }
      }
      
   if(run_once){
      if(!MQLInfoInteger(MQL_TESTER)){
         Print("EA is running in Live mode.");
         ticks_count = CopyTicksRange(Symbol(), ticks, COPY_TICKS_ALL, D'2021.01.04 11:44' * 1000, D'2021.01.04 11:46' * 1000);
         for(int i=0;i<ticks_count;i++)
            PrintFormat("tick_id=%d, tick.time = %s, tick.ask = %.3f, tick.bid = %.3f", i, TimeToString(ticks[i].time, TIME_DATE|TIME_SECONDS), ticks[i].ask, ticks[i].bid);
      }
   }
   
   run_once = false;
   
  }
//+------------------------------------------------------------------+
 
ServerName?
 
fxsaber:
ServerName?

Hi fxsaber,

Thanks a lot for your reply.

I am using your Virtual/Report library (I turned it multi_currency) and I learned a lot using your code!

Servername : Pepperstone-demo

Regards,

och


 
och:

Servername : Pepperstone-demo

Mode: Every tick based on real ticks.

 

Thanks fxsaber, for the time spent.

I will have to review my Strategy Tester settings ...

Best regards,

och

 

No way, I double check Period and Modelling...

It seems there is akind of unexpected commission or spread added...





Commission should not interfer as I am just asking for prices/tick values...

I don't understand.


Regards,

och

 
och:

MT5 b2844.

 
fxsaber:

MT5 b2844.

I am getting crasy!

From this morning I cannot even download ticks from the UI anymore :

I can click on request button, no ticks are downloaded fro GBPJPY, EURJPY, ... It works for EURUSD.




Then I upgrade the Terminal Desktop Client. I am now using the 2844 version : 


Same behaviour...


Regards,

och

 
HDD/SSD free space?
 
fxsaber:
HDD/SSD free space?

Indeed...
I am using a portable version with a Symbolic link on a OneDrive folder for the MQL5 folder (to share source code automatically between stations - I know there are more academic solution...) and the OneDrive folder have 328Mo free... So that might be the reason.

Thanks for your support.


Regards,

och

 
och:

I am getting crasy!

From this morning I cannot even download ticks from the UI anymore :

I can click on request button, no ticks are downloaded fro GBPJPY, EURJPY, ... It works for EURUSD.

I have a similar problem.
Reason: