Hello Smart MQL coders,
I need some help with this News Breakout EA. Just started learning mql days ago. My idea for this EA is to create both a pending sell and pending buy order at a distance from the price at a certain news release time.
I am having problem coding to close out other opposite pending order when one pending order is filled. (SEE THE RED WORDS)
I tried to count from the pool, to see if there is an OP_SELL or OP_BUY order with the same magic number as the EA. If there is, close out the opposite pending order.
There is also something wrong with the counting function, can anyone help me to clean that up?
<CODE DELETED>
Please read some other posts before posting . . .
Please edit your post . . . please use the SRC button to post code: How to use the SRC button.
- Use SRC
- What are Function return values ? How do I use them ? - MQL4 forum
OrderSelect(BuyTicket,SELECT_BY_TICKET); if(OrderCloseTime() == 0
You are selecting out of the order pool, not history. OCT all ALWAYS be zeroreturn(OrderCount); } if(Counter > 0) <== This will never be done because you have already returned (above)
.

- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
You agree to website policy and terms of use
Hello Smart MQL coders,
I need some help with this News Breakout EA. Just started learning mql days ago. My idea for this EA is to create both a pending sell and pending buy order at a distance from the price at a certain news release time.
I am having problem coding to close out other opposite pending order when one pending order is filled. (SEE THE RED WORDS)
I tried to count from the pool, to see if there is an OP_SELL or OP_BUY order with the same magic number as the EA. If there is, close out the opposite pending order.
There is also something wrong with the counting function, can anyone help me to clean that up?