six pend cancel

Author: developed by Wen Tao Xiong
Profit factor:
0.00
Orders Execution
Checks for the total of open ordersIt automatically opens orders when conditions are reached
1 Views
0 Downloads
0 Favorites
six pend cancel
ÿþ//+------------------------------------------------------------------+

//|                                                   six pend cancel.mq5 |

//|                                        lQO÷S Luyuanmw ®_áO wentxiong |

//|                                        http://www.popoding.club/ |

//+------------------------------------------------------------------+

#property copyright "developed by Wen Tao Xiong"

#property link      "https://www.mql5.com/zh/users/xiongsir/seller"

#property version   "1.00"

//+------------------------------------------------------------------+

//| Script program start function                                    |

//+------------------------------------------------------------------+

void OnStart()

  {

//---

   for(int i = 0; i < OrdersTotal(); i++)

     {

      ulong ord_ticket = OrderGetTicket(i);

      ulong ord_magic = OrderGetInteger(ORDER_MAGIC);

      datetime ord_time = (datetime)OrderGetInteger(ORDER_TIME_SETUP);

      string ord_symbol = OrderGetString(ORDER_SYMBOL);

      ENUM_ORDER_TYPE ord_type = (ENUM_ORDER_TYPE)OrderGetInteger(ORDER_TYPE);



      //agöN,ÖSˆm@b	gEURUSD,buy top \buy limit  

      //magic  

      if((ord_symbol == "EURUSD" && ord_type == ORDER_TYPE_BUY_STOP) ||

         (ord_symbol == "EURUSD" && ord_type == ORDER_TYPE_BUY_LIMIT))

        {



         //ÖSˆmÍd\O

         MqlTradeRequest request = {1};

         MqlTradeResult result = {1};



         request.action = TRADE_ACTION_REMOVE;

         request.order = ord_ticket;



         //ÑS÷‹Bl

         if(!OrderSend(request,result))

           {

            printf("OrderSend Error : %d",GetLastError());

           }





        }



     }





  }

//+------------------------------------------------------------------+

Comments