hi.
when I use icustom indicator in my EA , in Visually backtest, add a new indicator window in each cycle or each tick. what should I do?
for example when I use iRSI(Symbol(),Period(),14) in back test, just draw one indicator RSI and every thing is OK . but when i change it to iCustom(Symbol(),Period(),"RSI",14) it add a new RSI window in each tick or each cycle! how can I solve this problem?
thanks.
double iCustom_buf[];
void OnTick()
{
string name="Examples\\RSI";
int handle_iCustom=iCustom(Symbol(),Period(),name,14);
//int handle_iCustom=iRSI(Symbol(),Period(),14,PRICE_CLOSE);
int err1=CopyBuffer(handle_iCustom,0,0,1,iCustom_buf);
Comment(iCustom_buf[0]);
}
You should only get the handle once in OnInit not every tick...
https://www.mql5.com/en/docs/indicators/icustom
- www.mql5.com
You should only get the handle once in OnInit not every tick...
https://www.mql5.com/en/docs/indicators/icustom
- 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.
when I use icustom indicator in my EA , in Visually backtest, add a new indicator window in each cycle or each tick. what should I do?
for example when I use iRSI(Symbol(),Period(),14) in back test, just draw one indicator RSI and every thing is OK . but when i change it to iCustom(Symbol(),Period(),"RSI",14) it add a new RSI window in each tick or each cycle! how can I solve this problem?
thanks.
double iCustom_buf[];
void OnTick()
{
string name="Examples\\RSI";
int handle_iCustom=iCustom(Symbol(),Period(),name,14);
//int handle_iCustom=iRSI(Symbol(),Period(),14,PRICE_CLOSE);
int err1=CopyBuffer(handle_iCustom,0,0,1,iCustom_buf);
Comment(iCustom_buf[0]);
}