EA that sells when price crosses an MA - page 2

[Deleted]  

Oh gods, I'm so stupid.

Dude, fatal mistake from beginning :)))

This code that you pasted here, should not be inside init(){} function but inside start(){} function. Reposition it and try again. Hope to see your next post full of smilies.

 
forexCoder:
This code that you pasted here, should not be inside init(){} function but inside start(){} function. Reposition it and try again. Hope to see your next post full of smilies.

I told you

[Deleted]  

Seriously, thanks for all the help.

The symbol is EUR/USD. As you can see from the attachment, no orders get executed. Let me know if I haven't attached the correct log -- still pretty new at this.

[Deleted]  
Thanks. Smiles. Can't believe that I spent all this time this. Why the difference between init and start?
[Deleted]  

Init is executed once, at the beginning of operations, normally to get itself ready.

Start is executed once for each received tick, so this is your main function body.

@WHR, yes you did :P