molanis.com/forum - Tools for MetaTrader : The place to ask about the best expert advisor builder, expert advisor downloads, and expert advisor programming

AFTER YOU REGISTER SEND US AN EMAIL TO ACTIVATE YOUR ACCOUNT - Before posting:-1- Please read the user guide -2- Try the examples -3- Search in the forum
It is currently Fri May 10, 2024 4:43 am

All times are UTC - 5 hours




Post new topic Reply to topic  [ 3 posts ] 
Author Message
 Post subject: Open on tick perils
PostPosted: Tue Jun 19, 2012 1:28 am 
Offline

Joined: Mon Jun 18, 2012 11:56 pm
Posts: 4
Can anyone summarize how to avoid these common perils that let code run wild?

1. Conditions become true and you open a small position.
Next tick conditions are still true.
How do you keep from opening additional positions?


2. Conditions become true and you open a position.
You get stopped out and immediately open a second position with a new stop.
How to avoid?

3. Conditions are true for one bar then again a few bars later. You want to limit yourself to opening a position only if you have not had a signal in XX bars.

4. You have an EA that you want to trigger one time only and then go dormant until manually reset.

Are these all features the EA builder has already got logic for?


Top
 Profile  
 
 Post subject: Re: Open on tick perils
PostPosted: Mon Jun 25, 2012 8:52 am 
Offline
Site Admin

Joined: Fri Oct 16, 2009 3:40 pm
Posts: 451
Quote:
1. Conditions become true and you open a small position.
Next tick conditions are still true.
How do you keep from opening additional positions?

Use the max number of opened positions in the START icon
Quote:
2. Conditions become true and you open a position.
You get stopped out and immediately open a second position with a new stop.
How to avoid?

Use the next trade management option in buy / sell icons. Or create better trading conditions like crosses (see our examples page)

Quote:
3. Conditions are true for one bar then again a few bars later. You want to limit yourself to opening a position only if you have not had a signal in XX bars.

You could build the trading condition using current and past values. It may be a bit long.

Quote:
4. You have an EA that you want to trigger one time only and then go dormant until manually reset.

The strategy builder does not have dormant or manual reset


Top
 Profile  
 
 Post subject: Re: Open on tick perils
PostPosted: Mon Jun 25, 2012 10:00 am 
Offline

Joined: Sun Jun 19, 2011 9:38 pm
Posts: 270
RidgeRunner wrote:
4. You have an EA that you want to trigger one time only and then go dormant until manually reset.


Try this: Build 2 separate EA's. One for buying only, and another one for selling only. In each EA's mol, select Wait Until an Opposite Trade is Opened. Change the default magic numbers in one EA's inputs to something new. I'm thinking it should be impossible to enter more than one trade per EA because the opposite trade will never be present to either EA. Good luck.

_________________
I'm not a programmer, but I play one on TV.


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 3 posts ] 

All times are UTC - 5 hours


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
cron
Powered by Molanis © 2009