//+------------------------------------------------------------------+
//|                                                                  | 
//|                                                                  |
//|                                                                  | 
//+------------------------------------------------------------------+
#property version   "1.00"
#property strict
#include <stdlib.mqh>
#property show_inputs
//External Options
input double LotSize=0.01;
extern int StopLoss = 20;
extern int TakeProfit = 50;
//+------------------------------------------------------------------+
//| Script program start function                                    |
//+------------------------------------------------------------------+
void OnStart()
{
   double pips = Point;// 0.0001 //0.01 on old broker or .00001 and .001 on new broker
   if(Digits == 3 || Digits == 5)pips *= 10;//0.00001 becomes 0.0001 and 0.001 becomes 0.01
   
   int err = 0;
   int  TicketNumber = OrderSend(Symbol(),OP_SELL,LotSize,Bid,30,Bid+(StopLoss*pips),Bid-(TakeProfit*pips),"Sell Script",1234,0,clrRed);
   if(TicketNumber == -1)
   {
      err = GetLastError();
      Print("Could not place the order due to error ",err," ",ErrorDescription(err));
      if(err == ERR_TRADE_NOT_ALLOWED)Alert("YOU NEED TO ENABLE YOUR AUTOTRADING BUTTON!");
   }
}
//+------------------------------------------------------------------+
