Download MetaTrader 5
To add comments, please log in or register
Freelance service: the safe way to order a trading robot. Try it!
sunshineh
1064
sunshineh 2016.03.08 08:57 

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
5953
Carl Schreiber 2016.03.08 09:14  
Have you checked the tester's journal tab for e.g. array out range or zero devide...?
sunshineh
1064
sunshineh 2016.03.08 09:56  
Yes, that's working fine and I also a few see my testing results as Print-Messages there. 
Carl Schreiber
5953
Carl Schreiber 2016.03.08 10:31  

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
7947
Keith Watford 2016.03.08 10:57  
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
1064
sunshineh 2016.03.09 22:11  

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
1064
sunshineh 2016.03.10 09:40  

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