How to import bid/ask from another currency pair? - page 6

 

It perfectly worked! Thank you!
But it is very slow. How can I speed it up?
Does print function slowdown the process?

 
HosseinKOGO:

It perfectly worked! Thank you!
But it is very slow. How can I speed it up?
Does print function slowdown the process?

Yes. Should remove those that prints for info rather than errors.

 
Seng Joo Thio:

Yes. Should remove those that prints for info rather than errors.

When I removed information prints, the journal revealed a new error which I guess print function would skipped it before as there were a lot of other info to print.
I have no idea about this error :D  If you have any idea, I appreciate it!

2019.05.15 13:59:03.551 2018.01.02 00:29:45   MyEA! GBPAUD,H4: CTicksInfo::getTick - Potential data gap detected between 2018.01.02 00:27:11 and 2018.01.02 00:29:45 for GBPUSD
2019.05.15 13:59:03.551 2018.01.02 00:29:45   MyEA! GBPAUD,H4: CTicksInfo::getTick - Potential data gap detected between 2018.01.02 00:27:11 and 2018.01.02 00:29:45 for GBPAUD
2019.05.15 13:59:03.271 2018.01.02 00:25:13   MyEA! GBPAUD,H4: CTicksInfo::getTick - Potential data gap detected between 2018.01.02 00:15:14 and 2018.01.02 00:25:13 for GBPUSD
2019.05.15 13:59:03.271 2018.01.02 00:25:13   MyEA! GBPAUD,H4: CTicksInfo::getTick - Potential data gap detected between 2018.01.02 00:15:14 and 2018.01.02 00:25:13 for GBPAUD
2019.05.15 13:59:03.200 2018.01.02 00:15:14   MyEA! GBPAUD,H4: CTicksInfo::getTick - Potential data gap detected between 2018.01.02 00:14:11 and 2018.01.02 00:15:14 for GBPUSD
2019.05.15 13:59:03.200 2018.01.02 00:15:14   MyEA! GBPAUD,H4: CTicksInfo::getTick - Potential data gap detected between 2018.01.02 00:14:11 and 2018.01.02 00:15:14 for GBPAUD
2019.05.15 13:59:03.060 2018.01.02 00:14:09   MyEA! GBPAUD,H4: CTicksInfo::getTick - Potential data gap detected between 2018.01.02 00:12:23 and 2018.01.02 00:14:09 for GBPUSD
2019.05.15 13:59:03.060 2018.01.02 00:14:09   MyEA! GBPAUD,H4: CTicksInfo::getTick - Potential data gap detected between 2018.01.02 00:12:23 and 2018.01.02 00:14:09 for GBPAUD
2019.05.15 13:59:02.429 2018.01.02 00:12:06   MyEA! GBPAUD,H4: CTicksInfo::getTick - Potential data gap detected between 2018.01.02 00:06:22 and 2018.01.02 00:12:06 for GBPUSD
2019.05.15 13:59:02.429 2018.01.02 00:12:06   MyEA! GBPAUD,H4: CTicksInfo::getTick - Potential data gap detected between 2018.01.02 00:06:22 and 2018.01.02 00:12:06 for GBPAUD


I've just deleted these lines below from my OnTick function:

   tickCount++;
   //Print ("=== Now process tick ", tickCount);
   MqlTick myTick;
   
    
   if (ticksInfo.getTick(_Symbol,myTick)==false)
   //printTick (_Symbol,myTick);
   //else
   Print (_Symbol, " Error");

   if (ticksInfo.getTick(SecondPair,myTick))
   {
   //printTick (SecondPair,myTick);
   Ask2 = myTick.ask;
   Bid2 = myTick.bid;
   }
   else
   Print (SecondPair, " Error");
   
   if (ticksInfo.getTick(ThirdPair,myTick))
   {
   //printTick (ThirdPair,myTick);
   Ask3 = myTick.ask;
   Bid3 = myTick.bid;
   }
   else
   Print (ThirdPair, " Error");
 
HosseinKOGO:

When I removed information prints, the journal revealed a new error which I guess print function would skipped it before as there were a lot of other info to print.
I have no idea about this error :D  If you have any idea, I appreciate it!

I've just deleted these lines below from my OnTick function:

These are error messages - telling you the time gaps between ticks were larger than 1 min, but less than 1 day (which is likely due to holidays or weekends). So you can either (1) set your strategy tests to skip those periods, or (2) just ignore these messages - just bear in mind there were that could affect your test results.

Or... replace attached file. change this to other numbers to represent the minimum gap in seconds that you're willing to accept:

#define MAXSECONDSOFGAP 60
Files:
TicksInfo.mqh  5 kb
Reason: