oliahmed:
error in compile: 'MathAbs' - parameter passed as reference, variable expected
double bodyPipsBullSum = sumSelectiveCandles(MathAbs(Close[1] - Open[1]), 1, bodyPipsBull);
double bodyPipsBearSum = sumSelectiveCandles(MathAbs(Close[1] - Open[1]), 1, bodyPipsBear);
Your issue is following:
sumSelectiveCandle is probably defined as follows:
sumSelectiveCandle(double& var1, ...);
As you see it is with ampersand, this means it's a reference and has to be filled with a variable.
double my_var = 1.0;
sumSelectiveCandle(my_var, ...);
When you do a subtraction, you have no variable to store the result, therefore you cannot fill the reference (double&).
You first need to store the result in a variable and then pass that variable to the function call.
oliahmed: error in compile: 'MathAbs' - parameter passed as reference, variable expected
It's been that way for at least five years. Do what it says.
double body = Close[1] - Open[1], bodySize = MathAbs(body); double bodyPipsBullSum = sumSelectiveCandles(bodySize, 1, bodyPipsBull); double bodyPipsBearSum = sumSelectiveCandles(bodySize, 1, bodyPipsBear);
My coding is now error free but when I compiled the coding it removed from the chart
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
error in compile: 'MathAbs' - parameter passed as reference, variable expected