Help me. How to close Order Pending

 

When the condition (buy/sell) is met, order 1 (Buy/Sell) will be jumped with tp= 30 pips and sl = 30 and order 2 will be set with tp=30pips, sl = 30pips, order 3 with tp=30pips, sl = 30pips (same direction as order 1) and 20pips and 40pips away from order 1 respectively. If order 1 is closed with the tp of order 1, then delete pending orders 2 and 3. If order 1 is closed with the sl of order 1, then keep orders 2, 3. Then, if pending order 2 is opened and closed with the tp of order 2, delete order 3; otherwise, if pending order 2 is opened and closed with the SL of order 2, keep order 3. Thanks all. My english is bad Thanks for help me with code mql4

Documentation on MQL5: Constants, Enumerations and Structures / Trade Constants / Trade Operation Types
Documentation on MQL5: Constants, Enumerations and Structures / Trade Constants / Trade Operation Types
  • www.mql5.com
Trade Operation Types - Trade Constants - Constants, Enumerations and Structures - MQL5 Reference - Reference on algorithmic/automated trading language for MetaTrader 5
 
Your topic has been moved to the section: MQL4 and MetaTrader 4
Please consider which section is most appropriate — https://www.mql5.com/en/forum/172166/page6#comment_49114893
 
  • Usually people who can't code don't receive free help on this forum.
  • If you show your attempts and describe your problem clearly, you will most probably receive an answer from the community. Use the CODE button (Alt-S) when inserting code.
  • To learn MQL programming, you can research the many available Articles on the subject, or examples in the Codebase, as well as reference the online Documentation.
  • If you do not want to learn to code, that is not a problem. You can either look at the Codebase if something free already exists, or in the Market for paid products (also sometimes free). However, recommendations or suggestions for Market products are not allowed on the forum, so you will have to do your own research.
  • Finally, you also have the option to hire a programmer in the Freelance section.
 

Thanks bro


Fernando Carreiro #:
  • Usually people who can't code don't receive free help on this forum.
  • If you show your attempts and describe your problem clearly, you will most probably receive an answer from the community. Use the CODE button (Alt-S) when inserting code.
  • To learn MQL programming, you can research the many available Articles on the subject, or examples in the Codebase, as well as reference the online Documentation.
  • If you do not want to learn to code, that is not a problem. You can either look at the Codebase if something free already exists, or in the Market for paid products (also sometimes free). However, recommendations or suggestions for Market products are not allowed on the forum, so you will have to do your own research.
  • Finally, you also have the option to hire a programmer in the Freelance section.
Reason: