Why can't I trade on demo account

 

Hi I have recently downloaded a demo version of metatrader 4.0 (the Alpari edition). I've tried to run this simple program:

int init()
{
	OrderSend(Symbol(),OP_BUY,0.1,Ask,6,Bid-50*Point,Bid+50*Point);
	return(0);
}

However the trade never opens, even though i've checked the 'Allow live trading' checkbox.
If I check the 'Ask manual confirmation' however, a box pops up and asks me if I want to trade.

How can I open trades from the code automatically?

 
Try putting the code in your start() function, instead of init(). If this is a demo account you should not need to check the "allow live trading" box.