Forex
Google

Go Back   Forex Trading > Metatrader Training > Metatrader 4 mql 4 - Development course > Questions
Forex Forum Register FAQ Members List Calendar Today's Posts


Register in Forex TSD!
Trading Systems Leaders in this forum (automated trading systems) are winning more than 3000 pips in a month (30000$ investing one lot every time).
Click here to register and get more information

Reply
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 02-10-2006, 08:28 AM
demag demag is offline
Junior Member
 
Join Date: Jan 2006
Location: Middle Earth, UK.
Posts: 25
demag is on a distinguished road
New Order Delay

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
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #2 (permalink)  
Old 02-10-2006, 08:34 AM
sunwest's Avatar
sunwest sunwest is offline
Member
 
Join Date: Jan 2006
Location: London
Posts: 93
sunwest is on a distinguished road
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
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #3 (permalink)  
Old 02-10-2006, 08:37 AM
demag demag is offline
Junior Member
 
Join Date: Jan 2006
Location: Middle Earth, UK.
Posts: 25
demag is on a distinguished road
Thanks Bernard,

I'll give that a go and report back.
__________________
demag
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On
Forum Jump


Similar Threads
Thread Thread Starter Forum Replies Last Post
Putting a buy order in Pervaz Metatrader 4 2 03-18-2007 08:25 AM
One entry per BUY ORDER babarmughal Expert Advisors - Metatrader 4 1 05-14-2006 01:18 PM
One Order per Bar....... babarmughal Expert Advisors - Metatrader 4 2 05-09-2006 09:09 AM


All times are GMT. The time now is 11:31 PM.