Easiest_ever

Profit factor:
0.00
Price Data Components
Series array that contains close prices for each barSeries array that contains open prices of each bar
Orders Execution
Checks for the total of open ordersIt automatically opens orders when conditions are reachedIt Closes Orders by itself
0 Views
0 Downloads
0 Favorites
Easiest_ever
//+------------------------------------------------------------------+
//| Easiest ever - daytrade robot                                    |
//+------------------------------------------------------------------+

extern double lot = 1;
extern double marketclosehour = 20; // on friday

int start()
  {
     double c1 = iClose(NULL,1440,1);
     double o1 = iOpen(NULL,1440,1);
     {
     if (c1>o1 && OrdersTotal()<1 && Hour()<1)
     OrderSend(Symbol(),OP_BUY,lot,Ask,0,0,0,"Easiest ever",0,0);

     if (c1<o1 && OrdersTotal()<1 && Hour()<1)
     OrderSend(Symbol(),OP_SELL,lot,Bid,0,0,0,"Easiest ever",0,0);
       {
          for (int i=0; i<OrdersTotal(); i++)
         {                                               
            if (OrderSelect(i,SELECT_BY_POS,MODE_TIME)==true)
             if (OrderType()==OP_BUY && Hour()>(marketclosehour-1))
             OrderClose(OrderTicket(),OrderLots(),Bid,0,CLR_NONE);
        
            if (OrderType()==OP_SELL && Hour()>(marketclosehour-1))
            OrderClose(OrderTicket(),OrderLots(),Ask,0,CLR_NONE);
         }   
       }
     }
   return(0);
  }
//+------------------------------------------------------------------+

Comments