Hi there,
Here’s the thing, I’m developing an EA, I’m reading a custom indicator (WT_TMA) using iCustom as the usual, but it creates multiple instances of the same indicator at backtest, I’ve already change the indicator to other custom one to test it and it works fine, but using the indicator that I need, the EA stores or loads or (I really don’t know) multiple times my custom indicator
Here is a pic at the end of my visual backtest: https://pasteboard.co/GPdjyOQ.jpg
it doesn’t happen on demo trading, only on visual backtest
And here’s my function, I’ve used this on the OnTick function and it set a global variables to know if the price crosses up or down to the indicators lines (I’ve already try with local variables and buffers, same error):
//----------------------CheckChannel()-------------------------------
//
//-------------------------------------------------------------------
void CheckChannel(){
double bid_actual=NormalizeDouble(Bid,Digits),
ask_actual=NormalizeDouble(Ask,Digits);
HideTestIndicators(FALSE);
nivel_anterior_up=iCustom(Symbol(),PERIOD_CURRENT,ruta_WT_TMA,"","----",periodosTMA,periodosATR,multiplicadorATR,repintarIndicador,1,1);
//nivel_anterior_up=iCustom(Symbol(),PERIOD_CURRENT,"FL01","--",61,0,2.6,110,TRUE,FALSE,FALSE,FALSE,FALSE,FALSE,FALSE,2,1);
//nivel_anterior_down=iCustom(Symbol(),PERIOD_CURRENT,ruta_WT_TMA,"","----",periodosTMA,periodosATR,multiplicadorATR,repintarIndicador,2,1);
//nivel_actual_up=iCustom(Symbol(),PERIOD_CURRENT,ruta_WT_TMA,"","----",periodosTMA,periodosATR,multiplicadorATR,repintarIndicador,1,0);
//nivel_actual_down=iCustom(Symbol(),PERIOD_CURRENT,ruta_WT_TMA,"","----",periodosTMA,periodosATR,multiplicadorATR,repintarIndicador,2,0);
//COMPRA
if(bid_anterior!=0 && bid_anterior>=nivel_anterior_down && bid_actual<=nivel_actual_down){
channel_down=TRUE;
channel_up=FALSE;
}
//VENTA
else if(ask_anterior!=0 && ask_anterior<=nivel_anterior_up && bid_actual>=nivel_actual_up){
channel_up=TRUE;
channel_down=FALSE;
}
}
Do anyone know why this happen?