I think I read this somewhere but can't find it now.
I've set the EA up and it works ok.
Now I want to refine it!
The first thing I want to do is to stop the EA taking a trade immediately the MA's cross because (as we all know to our cost!) the price often retraces.
What I would like to do is delay the taking of a new trade by one bar after the MA's cross.
I am not sure, it is what you are looking for but you could add something like this:
if (Volume>1) BarInProgress=1; else BarInProgress=0;
Then when you calculate your MA cross add the value BarInProgress.
When Volume=1 it means that it is the open price of the new bar, so it will calculate from the last bar if Volume>1
To look at 1 bar away you could put:
if (Volume>1) BarInProgress=2; else BarInProgress=1;
Hope this help.
I'll give that a go and report back.