double cci[]; for(int i=0;i<3;i++) { cci[i]=iCCI(NULL,0,14,PRICE_TYPICAL,i); if(cci[1]>cci[0] && cci[1]>100 && cci[2]<cci[1] && cci[0]<cci[1]) return true; }
Your arrays have no size, therefor you can't store into them. You would know that had you used strict. Always use strict. Fixing the warnings will save you hours of debugging.
Program Properties (#property) - Preprocessor - Language Basics - MQL4 Reference- Fill your arrays completely before examining them.
- Simplify your code. Increase Order after stoploss - MQL4 and MetaTrader 4 - MQL4 programming forum № 3
Volume[1]>Volume[0])
This condition will always be true at the start of a new bar.if (OrdersTotal()<1) { return (false); } else if (OrdersTotal()>0)
Unnecessary. If there are no orders, the for loop exits immediately.
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
Hi guys,
Im having some trouble with an EA in MT4. Its just a basic one, but when started in the tester, doesn`t trade at all. This is the code. Thank you in advance!