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
double perceptron()
{
double w1 = x1 - 100;
double w2 = x2 - 100;
double w3 = x3 - 100;
double w4 = x4 - 100;
double a1 = iCustom(NULL,0, "Custom CCI", 0);
double a2 = iCustom(NULL,0, "Custom CCI", 7)
double a3 = iCustom(NULL,0, "Custom CCI", 14);//this is CCI
double a4=iMA(NULL,0,21,0,0,0);//this is Force Index
return(w1 * a1 + w2 * a2 + w3 * a3 + w4 * a4);
}
Hi, can someone please tell me if I've called the indicators in my EA correctly?
double perceptron()
{
double w1 = x1 - 100;
double w2 = x2 - 100;
double w3 = x3 - 100;
double w4 = x4 - 100;
double a1 = iCustom(NULL,0, "Custom CCI", 0);
double a2 = iCustom(NULL,0, "Custom CCI", 7)
double a3 = iCustom(NULL,0, "Custom CCI", 14);//this is CCI
double a4=iMA(NULL,0,21,0,0,0);//this is Force Index
return(w1 * a1 + w2 * a2 + w3 * a3 + w4 * a4);
}
no.
iCustom, like any other indicator call function, returns the indicator handle. Read the documentation.
Thank you! Then like this!? double a2 = iCCI(NULL,0,7, 0);
double a4=iForce(NULL,0,21,0,0);
The compiler accepts the previous version as well.
See an example of our custom Alligator indicator https://www.mql5.com/en/code/9
There:
Thank you! Then like this!? double a2 = iCCI(NULL,0,7, 0);
double a4=iForce(NULL,0,21,0,0);
The compiler will also be satisfied with the previous variant.
The compiler is just fine. I've got such a code fragment when porting one of the 4-compiler indukes:
It looked like this on 4:
I didn't manage to translate line-by-line because iMAOnArray is absent in 5, and I don't want to use include from beta. Well, at first I transferred 2*iMa.... I couldn't understand why the output turns out to be rubbish. I was getting mad. I was about to write to the forum. Then I figured it out - my habit has taken over. The compiler accepts it because the returned handle in 5 has data type Int (a number, in fact) and it can be multiplied by 2. But the output handle is a question and it won't work that way
I start trying to migrate the system to 5 and immediately get in trouble
Compile with 0 errors, but the script doesn't work :-(I start trying a system transfer to a five and it's an instant hitch
Compile with 0 errors, but the script doesn't work :-(
What do you mean by "script". Judging by the functions in the code, you have published EA code. Look at Transition with MQL4
What do you mean by the name "script". Judging by the functions in the code, you have published EA code. Look at the Transition with MQL4
Yes it is an EA, verbatim of course. I need to get a response from the server using wininet.dll
Yes, exactly an advisor, verbatim of course. I need to get a response from the server using wininet.dllTry to use Unicode versions of these functions. MQL5 uses Unicode encoding.
Try to use Unicode versions of these functions. MQL5 uses Unicode.
The point is that when I compile it during debugging it throws me back to the MQL editor without even giving an error. And when you just pull it to the chart, it doesn't even appear on it. I.e., neither debugging nor launching the EA gives errors anywhere