Download MetaTrader 5

Working in live-test but only sometimes in backtesting

To add comments, please log in or register
sunshineh
1250
sunshineh  

Hi, 

I have an indicator which works very fine in live test. It has to calculate quite a lot and draw some objects in the chart.

But when I do a visual backtest, the indicator sometimes starts showing me the right objects and after a time it shows nothing.

Could it be, that the OnCalculate function in backtesting is calling to fast, so that the indicator hasn't been finished with calculating? 

Carl Schreiber
7364
Carl Schreiber  
Have you checked the tester's journal tab for e.g. array out range or zero devide...?
sunshineh
1250
sunshineh  
Yes, that's working fine and I also a few see my testing results as Print-Messages there. 
Carl Schreiber
7364
Carl Schreiber  

sunshineh:

But when I do a visual backtest, the indicator sometimes starts showing me the right objects and after a time it shows nothing.

Then put some Print() like:

if ( Time[0] >= D'2015.11.12 09:00' )
    Print();
or use Comment(..) to see what's happening.
Keith Watford
Moderator
10614
Keith Watford  
It could be the way that the objects are named. If they are not named with the Time of the relevant bar time included, the name could be repeated and so a new object with the same name will not be created.
sunshineh
1250
sunshineh  

Thanks for your tipps. 

The strange part is, that it works the days before, without changing anything!

So I choose different names for the object and also my comment shows the correct time, so I see everything it working. 

Also my print messages are working.

 

It happens, when I calculate the values from M15  and want to draw it into my M5 chart. 

But has been working fine already... 

sunshineh
1250
sunshineh  

Hi,

now I found the same problem, with this indicator

https://www.mql5.com/en/code/8033

When I put it on my chart during visual backtesting(M5), and that the TF from the MTF Stochastic Indicator to 15, than I sometimes the values are shown correctly from M15 and the most time only the clock from the indicator is running, but NO line :-(

It's strange!

How can I solve that problem, because testing and fetching and drawing values from another timeframe is an important point for me!!

To add comments, please log in or register