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 Sun May 12, 2024 7:58 am

All times are UTC - 5 hours




Post new topic Reply to topic  [ 4 posts ] 
Author Message
 Post subject: Max number of positions
PostPosted: Fri Mar 09, 2012 9:18 pm 
Offline

Joined: Wed Feb 29, 2012 5:53 pm
Posts: 31
i want to ask if i choosed max number of positions 1 does this mean that if the EA opened a sell trade for example then it triggered afterwords a buy trade will it close the sell trade automaticly even if it didnt hit the target or loss and open the buy trade? or it won"t open the buy trade since the sell is still opened ?? pls advice and what can i do if i want the system to close the sell trade automaticlly if a buy trade is triggered and take the buy trade and viceversa??
thanks


Top
 Profile  
 
 Post subject: Re: Max number of positions
PostPosted: Sat Mar 10, 2012 9:18 am 
Offline

Joined: Tue Dec 22, 2009 12:22 am
Posts: 1761
Every time a TA icon is evaluated as true it triggers an action (the icon connected to the TA - let's say BUY or SELL)
Let's say you max number of positions is 1.
The ea starts, a TA is evaluated to BUY. Then it checks max number of positions, it's 0, so a position is opened. In the next bar the TA is evaluated to BUY. Then it checks max number of positions, it's 1, so NO position is opened.
Next bar, a TA is evaluated to SELL. It closes all existing long (BUYS), then it opens 1 position. So max number of positions makes sure that long or short your max opened positions is 1


Top
 Profile  
 
 Post subject: Re: Max number of positions
PostPosted: Tue Jun 19, 2012 9:08 am 
Offline

Joined: Sun Jun 19, 2011 9:38 pm
Posts: 270
In a 2 pair EA, does maxnumberofpositions work in parallel?

For example, let's say I set maxnumberofpostions to 10 on one EA that trades both EURUSD and GBPUSD. The value of symbol_bn between EURUSD and GBPUSD must be different, so I'm thinking 10 for EURUSD and 10 for GBPUSD. Thanks.

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


Top
 Profile  
 
 Post subject: Re: Max number of positions
PostPosted: Tue Jun 19, 2012 6:58 pm 
Offline

Joined: Tue Dec 22, 2009 12:22 am
Posts: 1761
If you put the pair in the buy/sell icon, it will use a different count per pair so you will have 20 (10 per pair)


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 4 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