Download MetaTrader 5
To add comments, please log in or register
Do you have a trading signal? Publish it in your blog as well!
sfm000
8
sfm000 2015.10.26 01: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++)
  }

..

Keith Watford
Moderator
7984
Keith Watford 2015.10.26 02:32  
Please use the SRC button when posting code. I have done it for you this time
Keith Watford
Moderator
7984
Keith Watford 2015.10.26 02:36  
Do you mean 4109? Have you enabled EA trading?
/
To add comments, please log in or register