Sajjad Hossain Sagor:
I need to check if MACD value is negative or positive...
I need to check if MACD value is negative or positive...
how do i do that? what function available or what custom code do you suggest?
Just need 'if' statement (reference):
double dValue = iMACD(NULL, PERIOD_CURRENT, 12, 26, 9, PRICE_CLOSE, MODE_MAIN, i); if (dValue>0) { /* do something */ } else if (dValue<0) { /* do other thing */ }

Conditional Operator if-else - Operators - Language Basics - MQL4 Reference
- docs.mql4.com
If the expression is true, operator1 is executed and control is given to the operator that follows operator2 (operator2 is not executed). If the expression is false, operator2 is executed.

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
how do i do that? what function available or what custom code do you suggest?