Problems reading DT-ZigZag-Lauer with iCustom - page 2

 
fx_maddin:
What can I do with the information or how I need to change the code?

I don't think it's a repainting issue are you are looking at bar 1 not bar 0 . . .


Did you notice on your screen shot that you have missing arrows ? I wonder if it is an issue with using Bars as part of your object names . . . try using an incrementing Index number instead . . . like this.

int depth = 5;
int GrossPeriod = 240;  
int Index = 0;       //  globally declared,  if not make it static

double Lauer_BUY = iCustom(NULL,0,"DT-ZigZag-Lauer",depth,GrossPeriod,0,1);
double Lauer_SELL = iCustom(NULL,0,"DT-ZigZag-Lauer",depth,GrossPeriod,1,1);

if (Lauer_BUY > 0) {
   LauerSignal = "BUY";
   ObjectCreate("LBUY_"+Index, OBJ_ARROW, 0, Time[1], Lauer_BUY + 35 * Point);
   ObjectSet("LBUY_"+Index, OBJPROP_ARROWCODE, SYMBOL_ARROWUP);
   ObjectSet("LBUY_"+Index, OBJPROP_COLOR, Blue);
   Index++;
}
else if (Lauer_SELL > 0) {
   GPLauerSignal = "SELL";
   ObjectCreate("LSELL_"+Index, OBJ_ARROW, 0, Time[1], Lauer_SELL - 35 * Point);
   ObjectSet("LSELL_"+Index, OBJPROP_ARROWCODE, SYMBOL_ARROWDOWN);
   ObjectSet("LSELL_"+Index, OBJPROP_COLOR, Red);
   Index++;
}
 
RaptorUK:


Did you notice on your screen shot that you have missing arrows ?


Yes I notice this, but I think it is an performance issue in the backtest. I looked at my CPU monitor at every new bar and the CPU was at 100% for up to 60 seconds until the EA draw my arrow.
So I think everytime the EA call iCustom the indicator will be initilized...

I changed my code like in your suggestion.

I try also changing try to looking Bar 0 instead Bar 1 - but still wrong result :-(

 
fx_maddin:


Yes I notice this, but I think it is an performance issue in the backtest. I looked at my CPU monitor at every new bar and the CPU was at 100% for up to 60 seconds until the EA draw my arrow.
So I think everytime the EA call iCustom the indicator will be initilized...

I changed my code like in your suggestion.

I try also changing try to looking Bar 0 instead Bar 1 - but still wrong result :-(

The Strategy Tester runs as fast as your CPU will allow . . . it never runs too fast for the CPU to keep up.
 
RaptorUK:
The Strategy Tester runs as fast as your CPU will allow . . . it never runs too fast for the CPU to keep up.


Ok, but what can I do, to get the correct values from the indicator?
 
fx_maddin:

Ok, but what can I do, to get the correct values from the indicator?
You are probably getting the correct values from the Indicator . . . you are probably not displaying them correctly, but you need to systematically diagnose where the issue(s) lie, I think you may have more than one problem.
 
Currently . . . . I suspect that the Indicator is not displaying correctly in the Strategy Tester . . . try your code on Demo/Live on M1 or M5 and let it run for a few hours.
 

Is there any way to improve the performance of the iCustom Call?

The EA runs on EURUSD M1 Chart and my CPU are cooking some eggs :-(

 
fx_maddin:

Is there any way to improve the performance of the iCustom Call?

The EA runs on EURUSD M1 Chart and my CPU are cooking some eggs :-(

Yes, only call it once per bar . . . ;-)
Files:
fx_maddin.mq4  2 kb
 
RaptorUK:
Yes, only call it once per bar . . . ;-)


Thanks a lot. The performance is better now, but I have still strange results.

And I found another issue this morning:

This screen was taken yesterday (15.10. ~16'o'clock CET). This morning everything seems to be god because there are red dots and red arrows as expected.

After reloading the MetaTrader the dots are blue. This seems an repaint issue!? But in Backtest was no repaint at all.

 
fx_maddin:


Thanks a lot. The performance is better now, but I have still strange results.

And I found another issue this morning:

This screen was taken yesterday (15.10. ~16'o'clock CET). This morning everything seems to be god because there are red dots and red arrows as expected.

After reloading the MetaTrader the dots are blue. This seems an repaint issue!? But in Backtest was no repaint at all.

IMO you need to be cautious using Indicators directly in the Strategy Tester.

From what I see on my chart the Indicator is doing strange things, but the EA is getting the correct data from the Indicator, so the arrows match the dots.

Reason: