-
if(IsNewBar()){ //--- Pool indicatori high_ha_1 = iCustom(Symbol(),timeframe,"Heiken Ashi",0,1);
Does IsNewBar adjust with timeframe?
-
On MT4: Unless the current chart is that specific symbol(s)/TF(s) referenced, you must handle 4066/4073 errors before accessing candle/indicator values.
Download history in MQL4 EA - MQL4 programming forum - Page 3 #26.4 (2019) -
vwap_daily = iCustom(Symbol(),timeframe,nome_indicatore,23,1); //"Trend Indicator" trend_long = iCustom(Symbol(),timeframe,nome_indicatore,16,1); //"Momentum Verde" trend_short = iCustom(Symbol(),timeframe,nome_indicatore,17,1); //"Momentum Rosso"
I doubt your indicators have 16+ buffers.
-
Does IsNewBar adjust with timeframe?
-
On MT4: Unless the current chart is that specific symbol(s)/TF(s) referenced, you must handle 4066/4073 errors before accessing candle/indicator values.
Download history in MQL4 EA - MQL4 programming forum - Page 3 #26.4 (2019) - I doubt your indicators have 16+ buffers.
Hi,
this is IsNewBar()
//+------------------------------------------------------------------+ bool IsNewBar(){ if(BARS != Bars(Symbol(),timeframe)){ BARS = Bars(Symbol(),timeframe); return true; } return false; }
about the Buffer, I know they are many, but as you can see from the first image, when I first load the EA the values are read correctly. Same value printed in the Comment as in the Data Window.
If I "manually" count the Buffer position from the Data Window panel, starting from 0, it return Buffer 23, 16 and 17.
The current chart is the same as the "timeframe" input field, it is set to PERIOD_CURRENT
After a couple of new bars, the Comment print EMPTY_VALUE
Hi
Maybe it’s connected to the indicator itself, for example the values on the indicator cannot be calculated properly at the very beginning of the new bar. Try to add some “waiting time” and obtain the data a bit later and see if that helps. Because when you start the EA I assume it’s not exactly at the start of new bar. And new bar functions run everything just after the bar is started, so that might be the reason.
Have a nice day👍📊
Hi
Maybe it’s connected to the indicator itself, for example the values on the indicator cannot be calculated properly at the very beginning of the new bar. Try to add some “waiting time” and obtain the data a bit later and see if that helps. Because when you start the EA I assume it’s not exactly at the start of new bar. And new bar functions run everything just after the bar is started, so that might be the reason.
Have a nice day👍📊
Hi,
I tried to put a Sleep from 3 to 10 seconds before reading iCustom, I also tried to read with Shift 0 or Shift 1 but nothing to do, after some new bars the value that returns me is always 2147483647

- 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, this EA must read a custom indicator with iCustom, when I charge the EA for the first time it read correctly the Buffers, but after a couple of bars the same reading returns EMPTY_VALUE, as you can see from the Comment.
See photos Pre (when EA is loaded) and Post (after a couple of new bars)
Anyone have any idea how I can fix this?