Global Variables deleted when Expert Advisor trade on Offline chart!?

 

Hello,

I use Expert Advisor which trades on Offline chart with no problem at all. However my Expert Advisor uses Global Variables and if terminal is closed all Global Variables are deleted! I have tried my EA on Standard chart and GV are NOT deleted if terminal is closed and re-opened. How to solve this problem?

 
MINTA:

Hello,

I use Expert Advisor which trades on Offline chart with no problem at all. However my Expert Advisor uses Global Variables and if terminal is closed all Global Variables are deleted! I have tried my EA on Standard chart and GV are NOT deleted if terminal is closed and re-opened. How to solve this problem?

Maybe posting some of the relevant code might help.
 

https://www.mql5.com/ru/forum/100028/page58#94290

This explains how EA works with Offline chart.

FILES:

iNDICATOR: SYNBAR CREATES OFFLINE CHART THAT IS UPDATED EVERY TICK.

https://www.mql5.com/ru/forum/100028/page58#94290

EXPERT ADVISOR: OSC_TEST. Put any global variable. It works fine with standard chart and delete in offline.

https://www.mql5.com/en/articles/1514

ATTACHED IS WINUSER32. REPLACE WITH THIS ONE IN EXPERTS/INCLUDE DIRECTORY. This is needed to update chart every tick.

Files:
winuser32.mqh  18 kb
 
MINTA:

https://www.mql5.com/ru/forum/100028/page58#94290

This explains how EA works with Offline chart.

FILES:

iNDICATOR: SYNBAR CREATES OFFLINE CHART THAT IS UPDATED EVERY TICK.

https://www.mql5.com/ru/forum/100028/page58#94290

EXPERT ADVISOR: OSC_TEST. Put any global variable. It works fine with standard chart and delete in offline.

Sadly the first two links are to Russian text which I can't read :-(

 
MINTA:

Hello,

I use Expert Advisor which trades on Offline chart with no problem at all. However my Expert Advisor uses Global Variables and if terminal is closed all Global Variables are deleted! I have tried my EA on Standard chart and GV are NOT deleted if terminal is closed and re-opened. How to solve this problem?

Looks like you will need to save the data to a txt file instead of global variables for offline testing.
Reason: