Tester: modelling and TF

 

Hi,

i would know if there is any correlation in Tester about "modelling" option and timeframe option.

That is, can I be sure that if I choose the "real tick based on real ticks" modelling, I will get the same ticks regardless of the timeframe chosen? I ask because I tried running a test on M1 and another on H4, with the same indicator, but on H4 it is much faster, as if it were not receiving the same ticks in this case.

The indicator I want to test is based on ticks, not bars, so which option should I choose? 

Thanks

 

If you choose "real tick based on real ticks", you will should get the same tick data irrespective of time-frame, provided that (and this is important) ...

  1. the testing period is within the period of available historical tick data,
  2. there are no gaps or data-mismatch between the tick data and the OHLC bar data.
Should points 1 or 2 not be assured, then the Strategy Tester will generate virtual ticks which will cause the results to be affected by the selected time-frame.
 
antony23:

i would know if there is any correlation in Tester about "modelling" option and timeframe option.

That is, can I be sure that if I choose the "real tick based on real ticks" modelling, I will get the same ticks regardless of the timeframe chosen? I ask because I tried running a test on M1 and another on H4, with the same indicator, but on H4 it is much faster, as if it were not receiving the same ticks in this case.

The indicator I want to test is based on ticks, not bars, so which option should I choose? 

How exactly did you test the indicator? Visual mode and invocation from an expert have some differencies. To make sure the indicator is always calculated on every tick it's better to ensure its code contains the directive #property tester_everytick_calculate
 
Stanislav Korotky #:
How exactly did you test the indicator? Visual mode and invocation from an expert have some differencies. To make sure the indicator is always calculated on every tick it's better to ensure its code contains the directive #property tester_everytick_calculate
The test is done trough an expert. I get the indicator hanlde using iCustom inside the expert, and then add it to chart using ChartIndicatorAdd (adding or not on the cart is configurable by expert inputs parameter).  Should i add that property to have indicator calculated on each tick?
 
Fernando Carreiro #:

If you choose "real tick based on real ticks", you will should get the same tick data irrespective of time-frame, provided that (and this is important) ...

  1. the testing period is within the period of available historical tick data,
  2. there are no gaps or data-mismatch between the tick data and the OHLC bar data.
Should points 1 or 2 not be assured, then the Strategy Tester will generate virtual ticks which will cause the results to be affected by the selected time-frame.

Should not the virtual ticks be generated only using one-minute timeframe? At least i read so in documentantion, i didn't read the "generated ticks" are affected by timeframe. See here: https://www.metatrader5.com/en/terminal/help/algotrading/tick_generation

Real and Generated Ticks - Algorithmic Trading, Trading Robots - MetaTrader 5 Help
Real and Generated Ticks - Algorithmic Trading, Trading Robots - MetaTrader 5 Help
  • www.metatrader5.com
Ticks are required for testing and optimizing Expert Advisors, because they use tick data for operation. Testing can be performed on real ticks...
 
antony23 #Should not the virtual ticks be generated only using one-minute timeframe? At least i read so in documentantion, i didn't read the "generated ticks" are affected by timeframe. See here: https://www.metatrader5.com/en/terminal/help/algotrading/tick_generation

In theory, yes! However, in practice, I have had "weird" experiences in the past (for reasons unknown). So, draw your own conclusions!

EDIT: However, please note that in my case, it could have been simply some silly mistake on my part, just as it can be in your case. So, check your code completely to my make sure there are no bugs in the code logic that could cause the issue.

 
Fernando Carreiro #:

In theory, yes! However, in practice, I have had "weird" experiences in the past (for reasons unknown). So, draw your own conclusions!

EDIT: However, please note that in my case, it could have been simply some silly mistake on my part, just as it can be in your case. So, check your code completely to my make sure there are no bugs in the code logic that could cause the issue.

Reading again the link, it writes "one-minute records", that are not the M1 bars, but are the "one-minute" records stored in .hcc files, used by terminal to build the timeframes, including M1. So it explain why using one timeframe or an other change the ticks generated.
 
antony23 #:
The test is done trough an expert. I get the indicator hanlde using iCustom inside the expert, and then add it to chart using ChartIndicatorAdd (adding or not on the cart is configurable by expert inputs parameter).  Should i add that property to have indicator calculated on each tick?
I think it may help for your requirement. Write the directive in the header of your indicator, compile, and then the indicator will always work on every tick. Without it, indicator is calculated only upon explicit request from EA, for example, when CopyBuffer is called. This is done for the sake of efficiency. Of course, indicators are also calculated on every tick if you run them in a single visual test mode and on online charts. More info on this is available in the docs.