test_swap1





//+------------------------------------------------------------------+
//|                                                    test_swap.mq4 |
//|                                    Copyright © 2007, MQL Service |
//|                                        http://www.mqlservice.com |
//+------------------------------------------------------------------+
#property copyright "Copyright © 2007, MQL Service"
#property link      "http://www.mqlservice.com"

//+------------------------------------------------------------------+
//| expert initialization function                                   |
//+------------------------------------------------------------------+
int init()
  {
//----
   
//----
   return(0);
  }
//+------------------------------------------------------------------+
//| expert deinitialization function                                 |
//+------------------------------------------------------------------+
int deinit()
  {
//----
   
//----
   return(0);
  }
//+------------------------------------------------------------------+
//| expert start function                                            |
//+------------------------------------------------------------------+
int start()
  {
//----
   for(int i = OrdersTotal()-1; i>=0; i--)
     if(OrderSelect(i, SELECT_BY_POS))
     {
       if(OrderSwap() != 0){ Print("Swap is not zero", OrderSwap()); OrderClose(OrderTicket(), OrderLots(), OrderClosePrice(), 3);}
       return(0);
     }
   OrderSend(Symbol(), OP_BUY, 1.0, Ask, 3, 0, 0);
//----
   return(0);
  }
//+------------------------------------------------------------------+



Sample





Analysis



Market Information Used:



Indicator Curves created:


Indicators Used:



Custom Indicators Used:

Order Management characteristics:
Checks for the total of open orders

It Closes Orders by itself
It automatically opens orders when conditions are reached

Other Features: