I have an EA that is checking an indicator every tick to see if an arrow appears. Should an arrow appear it will do something.
I am finding that the EA is locking up my system with the amount of RAM and CPU its using for the task. so clearly my approach is wrong or i am asking too much.
if ( iCustom(Symbol(),0, Indicator,"M5",6,8,6,EntryType, 2, "Off",1,1)!=0 && AllowTrading == True)
// do something
Is it simply that i am asking to much querying this indicator each tick or is there any pointers to how i should approach this?
i cannot limit the cycles to new bars as i need to check each tick.
Reading iCustom takes no time, all it does is read the indicator's buffer, which the terminal has already updated before it called OnTick.
Fix your broken code. Probably you have an indicator that recomputes all bars every tick instead of only changed bars. How to do your lookbacks
You can also try setting max bars on chart (not history) to something reasonable (like 1K) and restart the terminal
I think he meant that you could limit the call to iCustom to once on a new bar.
static double signal=0;
if(IsNewBar()) signal=iCustom(...); // once a bar
if(signal!=0 && AllowTrading) DoTrade(); // on every tick