i cannot see any error, you are only querying closed bars that shouldn't change anymore if the indicator does not repaint. a bug in mt4 is unlikely since thousands of others would have experienced the same problems too in this case. A bug or design flaw somewhere in your code is more likely. Did you try to slowly run it in visual mode to see what actually happens at these moments?
the following works for me:
check how many 'IndexBuffers' there are in the Custom Indicator, then call that specific Buffer number in iCustom in the second last value, ie number 1 for buffer 1. the last number is the shift value for the indicator.
see below:
double L_1 =iCustom(NULL,0,"rocseparate",H,P2,B,A,1,0); // the second last number, "1" is for buffer no.1hope it works.
That's it. You can see that I have matched the input parameter set of
the indicator within the function call to iCustom, yet the values of the
plotted indicator do not match the values from the function call. The
values returned from iCustom are causing trades to be signaled
incorrectly.
Is this a bug within iCustom/MT4? Is there a work-around? This problem is confounding, and makes the EA useless, which is unfortunate, because it shows such promise.
You appear to have matched the call correctly. (Indicator code at http://www.fxfisherman.com/forums/forex-metatrader/system-coding/2947-slope-system-ea.html) Three external int's and three buffers (up=0, dn=1, IMA)Is this a bug within iCustom/MT4? Is there a work-around? This problem is confounding, and makes the EA useless, which is unfortunate, because it shows such promise.
It is NOT a bug within iCustom/MT4. It IS a bug in YOUR code.
What is the problem, you don't say. What are the values, you don't say. Looking at the code I see
if (trend[x]>0) { Uptrend[x] = ExtMapBuffer[x]; if (trend[x+1]<0) Uptrend[x+1]=ExtMapBuffer[x+1]; Dntrend[x] = EMPTY_VALUE; }Are you checking for EMPTY_VALUES?
Do you really want to check bar0, that may change many times until bar end?

You are missing trading opportunities:
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
Registration
Log in
You agree to website policy and terms of use
If you do not have an account, please register
At the end of the backtest, the plotted indicator's values are different from the values in the EA's Print statements, which are obtained from iCustom. The plotted indicator clearly indicates that no trade should have been signaled, yet the values from iCustom are signaling trades, causing the EA to move in and out of positions inappropriately. Needless to say, this is a huge problem - I cannot trust the EA to properly trade the system.
Here are snippets of the pertinent code:
That's it. You can see that I have matched the input parameter set of the indicator within the function call to iCustom, yet the values of the plotted indicator do not match the values from the function call. The values returned from iCustom are causing trades to be signaled incorrectly.
Is this a bug within iCustom/MT4? Is there a work-around? This problem is confounding, and makes the EA useless, which is unfortunate, because it shows such promise.
All help is greatly appreciated.
scratchman