Modelling on Different Timeframe of a Symbol Tested

 
Hello I am blocked on a simple thing...

I am using the strategy tester with PERIOD H1.

And I want to calcultate height of M1 candles.

So I have entered

if (nbBuy>=1) {
  double height=iHigh(Symbol(),1,1)-iLow(Symbol(),1,1)
  Print(DoubleToStr(height,2));
  }

But the calcul return 0.00.

If I want to acces to this type of calculation, I have to set strategy tester to M1 ?

And would it be the same in on line trading ?

Thanks for your support
 
On MT5: Unless the chart is that specific pair/TF, you must Synchronize the terminal Data from the Server.
          Timeseries and Indicators Access /  Data Access - Reference on algorithmic/automated trading language for MetaTrader 5
 
whroeder1:
On MT5: Unless the chart is that specific pair/TF, you must Synchronize the terminal Data from the Server.
          Timeseries and Indicators Access /  Data Access - Reference on algorithmic/automated trading language for MetaTrader 5

Many, thanks but  I am using MT4.


And TickStory to generate fxt file.


Is it the same answer ?

 
Pierre DELAHAYE:

Many, thanks but  I am using MT4.


And TickStory to generate fxt file.


Is it the same answer ?

No, it isn't.  You probably do not have historical M1 data for the period tested.  Regards-
 
Pierre DELAHAYE: Many, thanks but  I am using MT4. And TickStory to generate fxt file. Is it the same answer ?

When using 3rd party tick data tools, such as via TickStory, you must generate both the FXT file as well as all the HST files (for all time-frames) and set them all to "read-only", otherwise the broker data will override the files.

Also, you have to handle 4066/4073 errors in your code, especially when using the EA live, but also on Strategy Tester as it sometimes still happens even with the data present.

 
Pierre DELAHAYE: Many, thanks but  I am using MT4.
  1. Why did you post your MT4 question in the Root / MT5 EA section instead of the MQL4 section, (bottom of the Root page?)
              General rules and best pratices of the Forum. - General - MQL5 programming forum

  2. On MT4: Unless the current chart is the specific pair/TF referenced, you must handle 4066/4073 errors.
              Download history in MQL4 EA - MQL4 and MetaTrader 4 - MQL4 programming forum

  3. If you don't have any history, here's how you can get all available from your broker.
 

Many thanks,


the problem has been resolved with a new and clean re-generation of fxt files.


thanks for your support and time spent.

 
whroeder1:
On MT5: Unless the chart is that specific pair/TF, you must Synchronize the terminal Data from the Server.
          Timeseries and Indicators Access /  Data Access - Reference on algorithmic/automated trading language for MetaTrader 5
The topic is about MT4 but for your information your answer doesn't apply to the Strategy Tester, this is done automatically.
 
Alain Verleyen: The topic is about MT4 but for your information your answer doesn't apply to the Strategy Tester, this is done automatically.

The topic was posted on MT5 (#1.) Then OP said it was MT4 (#5.) Topic has moved.

Reason: