Hi, i'm trying to create an EA that enters a trade depending on whether the signal line is above or below the main line on the stochastic indicator. I would like it to close the current order when the lines cross but I do not know how to do it. I am using an optimal lot size calcultor so each trade has a different lot size depending on the stop loss but when I close the order I would like it to close the whole order.
- OrderClose activated by Stochastic
- Inability to close trade using EA
- OrderClose generating more orders
-
double bbLossUpper = iBands(NULL,0,bbPeriod,bandStdLossExit,0,PRICE_CLOSE,MODE_UPPER,0);
Why did you post your MT4 question in the MT5 EA section instead of the MQL4 section, (bottom of the Root page)?
General rules and best pratices of the Forum. - General - MQL5 programming forum?
Next time, post in the correct place. The moderators will likely move this thread there soon. - Francesco Pareti: I would like it to close the current order when the lines cross but I do not know how to do it.
Look for a cross.
double aPrev = …(i+1), aCurr = …(i), bPrev = …(i+1), bCurr = …(i); bool wasUp = aPrev > bPrev, isUp = aCurr > bCurr, isCross = isUp != wasUp;
Show us your attempt (using the CODE button) and state the nature of your problem.
No free help (2017)
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