Hello,
I am not sure, it is what you are looking for but you could add something like this:
int BarInProgress;
----------------------
if (Volume[0]>1) BarInProgress=1; else BarInProgress=0;
Then when you calculate your MA cross add the value BarInProgress.
When Volume[0]=1 it means that it is the open price of the new bar, so it will calculate from the last bar if Volume[0]>1
To look at 1 bar away you could put:
if (Volume[0]>1) BarInProgress=2; else BarInProgress=1;
Hope this help.
Bernard
Thanks Bernard,
I'll give that a go and report back.
You are missing trading opportunities:
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
Registration
Log in
You agree to website policy and terms of use
If you do not have an account, please register
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.
Thanks,
demag