- Please edit your (original) post and use the CODE
button (Alt-S)! (For large amounts of code, attach it.)
General rules and best pratices of the Forum. - General - MQL5 programming forum
Messages Editor -
double signal[]; ⋮ if(A>0) signal[0] = +1;
Signal has no size — you can't assign to it. - Signal has no purpose — just create the result.
result = (A>0 ? +1 : -1) + (B>0 ? +1 : -1) ⋮ + (E>0 ? +1 : -1);
William Roeder:
- Please edit your (original) post and use the CODE
button (Alt-S)! (For large amounts of code, attach it.)
General rules and best pratices of the Forum. - General - MQL5 programming forum
Messages Editor - Signal has no size — you can't assign to it.
- Signal has no purpose — just create the result.
double signal[]; ⋮ if(A>0) signal[0] = +1; if(B>0) signal[ 1] = +1; if(C>0) signal[ 2] = -1; if(D>0) signal[ 3] = -1; if(E>0) signal[ 4] = -1;
In this case how would you sum signals from different functions?

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
I need to use 5 different indicators and to summarize their result in a signal for buy/sell order. Here is a simple example of my idea. My difficulty is the connected with the hierarchy of the code in the functions. May you recommend me a way for summarizing the result? I suggest one of the ways is counting, but I am not really sure how to apply this on several functions.
void OnTick()
//If the value > 0 => buy; If the value < 0 => sell
Result = signal[0] + signal[1] + signal[2] + signal[3] + signal[4] +