//+------------------------------------------------------------------+
//|                                                 Pending Long.mq4 |
//|                                  Copyright © 2009, Steve Hopwood |
//|                              http://www.hopwood3.freeserve.co.uk |
//+------------------------------------------------------------------+
#property copyright "Copyright © 2009, Steve Hopwood"
#property link      "http://www.hopwood3.freeserve.co.uk"
#property show_inputs
#include <WinUser32.mqh>
#include <stdlib.mqh>

extern double  Lot=0.4;
extern double  EntryPrice;
extern int     StopLoss=60;
extern int     TakeProfit=25;

//+------------------------------------------------------------------+
//| script program start function                                    |
//+------------------------------------------------------------------+
int start()
  {
//----
      int ticket = OrderSend(Symbol(), OP_SELLSTOP, Lot, EntryPrice, 0, NormalizeDouble(EntryPrice + StopLoss * Point, Digits), NormalizeDouble(EntryPrice - TakeProfit * Point, Digits), "", 0,0,CLR_NONE);

      if (ticket < 0)
      {
         int err=GetLastError();
         Alert("Order send failed with error(",err,"): ",ErrorDescription(err));
         
      }//if (ticket < 0)
   
//----


   return(0);
  }
//+------------------------------------------------------------------+