Navigation´╝ÜHome > Content >

_StopLossSetEverythingSymbol.mq4

Time: 2013-11-06 | Download file:_StopLossSetEverythingSymbol.mq4

//+------------------+
//| Close Everything |
//|------------------+

#property show_inputs

// used for verbose error logging
#include 


extern double mysl=194.75;

//+-------------+
//| Custom init |
//|-------------+
int init()
  {
   Comment(" ");
   Print("Init complete - script");
  }

//+----------------+
//| Custom DE-init |
//+----------------+
int deinit()
  {
   Comment(" ");
   Print("DE-Init complete - script");
  }


//+-----------+
//| Main      |
//+-----------+

int start()
  {
   // set all losses to extern
   int gle;
   int i;

   for( i=(OrdersTotal()-1); i>=0; i-- )
     {
      OrderSelect(i, SELECT_BY_POS);
      if( OrderSymbol()==Symbol() )
        {
         OrderModify(OrderTicket(),OrderOpenPrice(),mysl,OrderTakeProfit(), White);
         Sleep(500);
        }
     } //for

  } // start()


Recommend