Strategy Tester, Offline Charts, ChartSetSymbolPeriod() and RefreshRates() in MT4

 

Hi,

I've searched the internet in general and this forum and I cannot find an answer to my problem(s).

I am trying to run an EA (M1) in the Strategy Tester (ST) and have an offline chart (M5) update beside it but I am getting no-where after several weeks of trying to figure this out.  HELP!

  1. Select visual mode in ST
  2. Start EA in ST
  3. Pause EA 
  4. Drop the PeriodConverter.mq4 script (that was installed with MT4) onto paused chart and select 5 as the 'period multiplier factor'
  5. "Terminal/Expert" tab CTRL-T show a few thousand records have been written
  6. Open the offline chart just created
    1. nothing extra is written in the Terminal/Expert nor ST/Journal logs (RefreshRates() apparently returns false)
  7. Unpause EA
  8. EA runs fine but nothing happens with the offline chart

A few print statements in the PeriodConverter code reveals that RefreshRates() always returns false so the offline chart is never found. 

If I comment out the check for RefreshRates(), so it executes the code where it finds the chartID of the offline chart and executes ChartSetSymbolPeriod(), it doesn't make any difference.

I know there is some way to get this working because FxBlue has it working.

Any assistance would be greatly appreciated.

Thanks,

Neil

Files:
 
NeilG:

Hi,

I've searched the internet in general and this forum and I cannot find an answer to my problem(s).

I am trying to run an EA (M1) in the Strategy Tester (ST) and have an offline chart (M5) update beside it but I am getting no-where after several weeks of trying to figure this out.  HELP!

  1. Select visual mode in ST
  2. Start EA in ST
  3. Pause EA 
  4. Drop the PeriodConverter.mq4 script (that was installed with MT4) onto paused chart and select 5 as the 'period multiplier factor'
  5. "Terminal/Expert" tab CTRL-T show a few thousand records have been written
  6. Open the offline chart just created
    1. nothing extra is written in the Terminal/Expert nor ST/Journal logs (RefreshRates() apparently returns false)
  7. Unpause EA
  8. EA runs fine but nothing happens with the offline chart

A few print statements in the PeriodConverter code reveals that RefreshRates() always returns false so the offline chart is never found. 

If I comment out the check for RefreshRates(), so it executes the code where it finds the chartID of the offline chart and executes ChartSetSymbolPeriod(), it doesn't make any difference.

I know there is some way to get this working because FxBlue has it working.

Any assistance would be greatly appreciated.

Thanks,

Neil

Not sure what RefreshRates is supposed to do in this particular case. However, your attached source file uses ChartFirst() and ChartNext() commands for finding the other chart handle, which do not work from the Strategy Tester environment. 

 

Hi Neil,

Did you manage to get this to work? I'm trying to do the same thing, but am stuck where you were 2 yrs ago!

Regards

Narayan

 
Step 4 before anything else.
Reason: