can anyone help? Why do I get error 1409 with this code in mt4 to test OrderSend

Back to topics list To post a new topic, please log in or register
avatar
1
sfm001 2015.10.26 02:01
 


input double TakeProfit    =15;
input double Lots          =0.01;
input double TrailingStop  =5;
void OnTick(void)
  {
   int    cnt,ticket,total;
   total=OrdersTotal();
   if(total<1)
     {
        {
         ticket=OrderSend(Symbol(),OP_BUY,Lots,Ask,3,0,Ask+TakeProfit*Point,"sf test",000000,0,Green);
         if(ticket>0)
           {
            if(OrderSelect(ticket,SELECT_BY_TICKET,MODE_TRADES))
               Print("BUY order opened : ",OrderOpenPrice());
           }
         else
            Print("Error opening BUY order : ",GetLastError());
         return;
        }
      return;
     }  
   for(cnt=0;cnt<total;cnt++)
  }

..

avatar
Moderator
3404
GumRai 2015.10.26 03:32 #
 
Please use the SRC button when posting code. I have done it for you this time
avatar
Moderator
3404
GumRai 2015.10.26 03:36 #
 
Do you mean 4109? Have you enabled EA trading?
Back to topics list  

To add comments, please log in or register