Maybe my description was not understandable. Here is a picture to show you what I mean:
If I run the backtest, I get results from
double Min_15 = iMomentum(NULL,PERIOD_M15 ,20,PRICE_CLOSE,1);
But the result from another timeframe (different to Periode 15, choosen as backtest setting)
double H1 = iMomentum(NULL,PERIOD_H1 ,20,PRICE_CLOSE,1);
is always zero :(
Did someone run a backtest using calculatings on different timeframes? So it is possible and I only have to find the failure or is it not possible in general?
Don't know what you are doing but your code works for me . . .
double H1 = iMomentum(NULL,PERIOD_H1 ,20,PRICE_CLOSE,1); double Min_15 = iMomentum(NULL,PERIOD_M15 ,20,PRICE_CLOSE,1); Print("H1 = ",H1," Min_15 = ",Min_15);
gave me . . .
2011.07.25 10:50:40 2008.01.04 00:37 TestSpreadSMA GBPUSD,H1: H1 = 99.6113 Min_15 = 99.8633
on H1, and
2011.07.25 10:52:00 2008.01.04 00:18 TestSpreadSMA GBPUSD,M15: H1 = 99.6113 Min_15 = 99.8987
on M15
Show your code . . .
Hi RaptorUK,
thanks for your answer! It is not working for me (I am using exactly the code shown above). I only get a result for the choosen time period. Maybe it is because I am using tickdata and not the downloaded data from MT.
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
You agree to website policy and terms of use
Hi!
My EA calculates the momentum for 15 minute timeframe and 1 hour timeframe. I use:
If I choose period M15 (for the backtest) I get values for Min_15 and none for H1, if I choose period H1 it is the other way round.
Shall I choose period M15 and let the H1 momentum be calculatet using every fourth bar? Or is there a better way?
Thank you very much!