Something doesnt seem to be right

 
input double TakeProfit    =50;
input double Lots          =0.1;

//+------------------------------------------------------------------+
//|                                                                  |
//+------------------------------------------------------------------+
void OnTick(void)
  {
     
   int    ticket,total;

if(-20<=-10)
   

   total=OrdersTotal();
   if(total<1)
     {   
         ticket=OrderSend(Symbol(),OP_BUY,Lots,Ask,3,Ask,Ask+TakeProfit*Point,"trial",16384,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;
       }
I have simply copied this from macd sample EA. For some reason upon testing the strategy not a single trade is executed :(
 
ticket=OrderSend(Symbol(),OP_BUY,Lots,Ask,3,Ask,Ask+TakeProfit*Point,"trial",16384,0,Green);

You cannot open a trade at Ask and also set the SL at Ask

 
if(-20<=-10) ?? 

obviously -20 is smaller than -10

 
qjol:

obviously -20 is smaller than -10


ya wrote is so cause the code wasnt running for the conditions that i am actually using
 
GumRai:

You cannot open a trade at Ask and also set the SL at Ask


Dude thanks a lot. Finally I can sleep :D _/\_
Reason: