double ExtMapBuffer2[]; int ExtMapBuffer3[]; : SetIndexBuffer(2, ExtMapBuffer3);
Buffers must be a double, bool SetIndexBuffer( int index, double array[])
Detailed explanation of iCustom - MQL4 forum
- Guys, please help. The Wife has just told me she is taking up Mixed Martial Arts!!You've already lost.
#property indicator_buffers 2
If you are using 3 buffers then you better tell the system you are using 3 not 2!
Quite why so many people call the indicator buffers ExternalMapBufferN
baffles me. It's just a name. Why not use something relevant?
LowerFractalBuffer
UpperFractalBuffer
BuySellOutput
for example.
Guys, I have shown the revised code at the head of this post. Thanks for your help with this as always.
The Indicator seems to be working fine but I am still not trading. I have highlighted where I think the problem is but I have no idea what the problem is or how to fix it. Can someone point me in the right direction as I have spent so many hours just staring at this code and am going slowly insane!
Willforth:
I have highlighted where I think the problem is but I have no idea what the problem is or how to fix it.
Is this voodoo debugging? " I can feel it using the force".
Debugging is not guesswork, at least it is educated guesswork. You might assume it is something or other then test it to see if the guess was right.
In that for loop you do not actually set ExtMapBuffer to anything if the tests are not true. I would be happier if at the top of the loop you set it to 0, for example, then let a condition change it to either 1 or 2.
If the indicator is working you should see the 1 or 2 values changing in the indicator readout. Then you need to check those values get to the EA with comments or print statements. Once you have established that, you are on a strong footing.
First, this is a simple admission: I am feeling like I'm crap at this coding 'Milarkey' at the moment, but I am not giving up!!
Do not give up! I am going through the same frustrations, but I WILL persevere.
Am currently dancing round the room and sending a disparaging email to the Wife for mocking me! IT WORKS!!!!!!!!! Indicator was generating the right data but iCustom was wrong.....
I took your advice and found a way to check the output of the Indicator....the Indicator was fine....it took me most of my day but I found the problem....
In the Indicator...
SetIndexBuffer(2, ExtMapBuffer3);
In the EA....
double iFeed=iCustom(NULL,0,"Indicator",3,0);
Wrong Buffer!!!!
I am now in the process of seeing if the EA adds to the Bank Balance or subtracts (Demo...of course).
Thanks for all your help and support Guys
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
You agree to website policy and terms of use
First, this is a simple admission: I am feeling like I'm crap at this coding 'Milarkey' at the moment, but I am not giving up!!
The following is a mash-up of code which I have stitched together whilst I am learning. What I am trying to achieve is link the Indicator to the EA so it will trade according to the Indicator signals.
Within the Indicator (cleverly called "Indicator") I have added a third buffer called "ExtMapBuffer3" In this, I want to get the indicator to set 1 for a Buy and 2 for a sell
Within the EA (fiendishly called "Indicator Trader"), I am using iCustom to pull the information into the EA using the following "int iFeed=iCustom(NULL,0,"Indicator",3,0);"
Needless to say, the EA is not trading and, in accordance with the rules of seniority in my home, I am kicking a toy cat and the wife is kicking me!! So please, before she calls the Neighbours to join in the violence and to engender a short lived feeling of equality in my home, can anyone help!?
This is the relevant source code for the EA
And this is the revised code for the Indicator which sees to be working fine.
Guys, please help. The Wife has just told me she is taking up Mixed Martial Arts!!