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
Because you don't check crossover but just the position of SignalMA. If you want to check crossover you should compare the previous position with the current position.
OrderClosePrice() returns close price. If you close the order for example at 1.23000 the OrderClosePrice() will return 1.23000. If the order is still open the OrderClosePrice() returns 0.0 . Similar to OrderCloseTime()
OK, but you never use "Pips" in your code behind the block.
! is a negation.
https://www.mql5.com/en/docs/basis/operators/if
I was told that ClosePrice if the order stills running will return the price that would close at if it's closed at that moment
You should want your money back :D
https://docs.mql4.com/trading/ordercloseprice
Any suggestions? How can I make the EA differentiate between position of SIGNALMA and SIGNALMA crossover?
For example:
What's the Magic Number for?
You should use Magic Number, because you can recognize by Magic Number what EA has opened the Order. Usually you don't want to close Orders opened by another EA.
Yep, I just noticed that I posted a draft version, later this day I'll update with the actual "final" code before modifying anything upon the suggestions as I want to learn more about why it's bad before making any changes so I can learn more:D
OrderClosePrice() returns close price. If you close the order for example at 1.23000 the OrderClosePrice() will return 1.23000. If the order is still open the OrderClosePrice() returns 0.0 . Similar to OrderCloseTime()
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.
www.mql5.com/en/forum/158890/page3#comment_3812636
Symbol Doesn't equal Ordersymbol when another currency is added to another seperate chart . - MQL4 and MetaTrader 4 - MQL4 programming forum
How to manage JPY pairs with parameters? - MQL4 and MetaTrader 4 - MQL4 programming forum
Slippage defined in index points - Currency Pairs - Expert Advisors and Automated Trading - MQL5 programming forum