FrameNext not able to retrieve previous frames inserted with FrameAdd

 
Hello, my target is to save from Expert Advisors two different sets of information in order to work with that data offline.

To do that, I used FrameAdd to save the data. Having two different arrays I used two different IDs:

FrameAdd("Stati",4,(double)dati_rep.numperiodi, dati_rep.datiperiodi);
FrameAdd("Stati",7,(double)dati_rep.numopdett,dati_rep.listaop);

I noticed that later I was not able to retrieve part of the data I previously saved with FrameAdd. To debug, I took example from Alain Verleyen's code:

if(!FrameNext(pass,name,id,value,data))
      printf("Error #%i with FrameNext",GetLastError());
   else
      printf("%s : new frame pass:%llu name:%s id:%lli value:%f",__FUNCTION__,pass,name,id,value);

It works fine for the first data sets - from a certain point in advance I see the following:

2019.07.04 15:55:06.555 FusoNewConf (EURUSD,H1) OnTesterPass : new frame pass:1508 name:Stati id:4 value:25.000000
2019.07.04 15:55:09.719 FusoNewConf (EURUSD,H1) OnTesterPass : new frame pass:1508 name:Stati id:7 value:67.000000
2019.07.04 15:55:12.914 FusoNewConf (EURUSD,H1) OnTesterPass : new frame pass:2216 name:Stati id:4 value:25.000000
2019.07.04 15:55:16.157 FusoNewConf (EURUSD,H1) OnTesterPass : new frame pass:2216 name:Stati id:7 value:107.000000
2019.07.04 15:55:19.515 FusoNewConf (EURUSD,H1) OnTesterPass : new frame pass:74 name:Stati id:4 value:25.000000
2019.07.04 15:55:22.953 FusoNewConf (EURUSD,H1) OnTesterPass : new frame pass:74 name:Stati id:7 value:90.000000
2019.07.04 15:55:25.282 FusoNewConf (EURUSD,H1) OnTesterPass : new frame pass:0 name: id:0 value:0.000000
2019.07.04 15:55:25.306 FusoNewConf (EURUSD,H1) OnTesterPass : new frame pass:0 name: id:0 value:0.000000
2019.07.04 15:55:25.306 FusoNewConf (EURUSD,H1) OnTesterPass : new frame pass:0 name: id:0 value:0.000000
2019.07.04 15:55:25.348 FusoNewConf (EURUSD,H1) OnTesterPass : new frame pass:0 name: id:0 value:0.000000
2019.07.04 15:55:25.349 FusoNewConf (EURUSD,H1) OnTesterPass : new frame pass:0 name: id:0 value:0.000000
2019.07.04 15:55:25.521 FusoNewConf (EURUSD,H1) OnTesterPass : new frame pass:0 name: id:0 value:0.000000

So I am not able to retrieve part of the data I previously saved with FrameAdd. 

What I checked so far is that neither FrameAdd nor FrameNext return errors.

I noticed also that file FusoNewConf.EURUSD.H1.0.mqd (where the frames are saved) grew up to 5 GB.

Any clue please? Did I save too many data? Are there any constrains I'm not aware?

Thank you in advance

 
afusetti:
Hello, my target is to save from Expert Advisors two different sets of information in order to work with that data offline.

To do that, I used FrameAdd to save the data. Having two different arrays I used two different IDs:

I noticed that later I was not able to retrieve part of the data I previously saved with FrameAdd. To debug, I took example from Alain Verleyen's code:

It works fine for the first data sets - from a certain point in advance I see the following:

So I am not able to retrieve part of the data I previously saved with FrameAdd. 

What I checked so far is that neither FrameAdd nor FrameNext return errors.

I noticed also that file FusoNewConf.EURUSD.H1.0.mqd (where the frames are saved) grew up to 5 GB.

Any clue please? Did I save too many data? Are there any constrains I'm not aware?

Thank you in advance

You need to use a loop :

while(FrameNext(pass,name,id,value,data))
{
  ...
  printf("%s : new frame pass:%llu name:%s id:%lli value:%f",__FUNCTION__,pass,name,id,value);
}

if(_LastError!=0) printf("Error #%i with FrameNext",GetLastError());
   
 

For anyone who can't get their Frameadd/Framenext code to work or output print statements in OnTesterPass() then make sure you don't have to many chart windows open.  I couldn't get anything to output until  I cleared all the open charts using Alt-W.

Now it works as intended.

Reason: