[MT4指标]一键关闭所有单子
可以参考这个//+------------------------------------------------------------------+
//| DeleteAllPending.mq4 |
//| Copyright 2004, MetaQuotes Software Corp. |
//| http://www.metaquotes.net/ |
//|
//+------------------------------------------------------------------+
#property copyright "Copyright 2004, MetaQuotes Software Corp."
#property link "http://www.metaquotes.net/"
#property show_confirm
int totalPendingOrders = 0; // variable to count total pending Orders
//+------------------------------------------------------------------+
//| script "Delete All pending orders" |
//+------------------------------------------------------------------+
int start()
{
bool isDeleted; //To check order deleted is successful or not
int Order_Type, total;
//----
total=OrdersTotal(); //getting total orders including open and pending
//----
//+------------------------------------------------------------------+
//| counting total pending orders |
//+------------------------------------------------------------------+
for(int a=0; a