Help with this simple script

 

this will not execute a buy

???

#include <stdlib.mqh>
#include <WinUser32.mqh>
 
int start()
{
 
int ticket;
if(MessageBox("Buy 0.01 "+Symbol()+" ?",
              "Script",MB_YESNO|MB_ICONQUESTION)!=IDYES) return(1);
ticket = OrderSend(Symbol(),OP_BUY,0.01,Ask,3,0,0,NULL,0,0,Green);
if(ticket<1)
  {
   int error=GetLastError();
   Print("Error = ",ErrorDescription(error));
   return;
  }
 
OrderPrint();
return(0);
}
 
What error do you get?
 

No error.  I just run the script and then check the trade window and no trades have been executed.  The journal says:

2008.05.25 22:21:39 Script Buy EURUSD,H1: removed
2008.05.25 22:21:39 Script stdlib EURUSD,H1: removed
2008.05.25 22:21:39 Script stdlib EURUSD,H1: loaded successfully
2008.05.25 22:21:34 Script Buy EURUSD,H1: loaded successfully


And then nothing else happens.  I have no other trades open, so I know it is not an issue of not having enough free margin.  My dealer, Alpari.UK, allows micro lot trading.  I don't understand it, does it work for you?

 
Oh Duh!  I hadn't allowed live trading in the EA properties.  Thanks anyway, Phy.
Reason: