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 Mon May 13, 2024 2:15 pm

All times are UTC - 5 hours




Post new topic Reply to topic  [ 3 posts ] 
Author Message
 Post subject: how to set CL or CS?
PostPosted: Wed Jul 04, 2012 10:32 am 
Offline

Joined: Fri Apr 20, 2012 10:02 pm
Posts: 15
can you please tell me how to set CL or CS when the total pips of all open orders achieved? For example: there are two open short orders, with a net pips of 20 and both are needed to be closed even one at a loss.
Thanks


Top
 Profile  
 
 Post subject: Re: how to set CL or CS?
PostPosted: Wed Jul 04, 2012 12:37 pm 
Offline

Joined: Sun Jun 19, 2011 9:38 pm
Posts: 270
Can't be done without coding. This would require a loop code to tally up the order profits, which would have to go into an MQL block--the SB manual says, "trading conditions," not loops. molanisfx/admin, please confirm here.

However... you should be able to use AccountProfit() to read the actual profit (in your deposit currency) for all open orders +/- swaps from within an MQL block. Manually convert your pip value to deposit currency and use this number instead:

AccountProfit() = 30

So... 30 is dollars, euros, or whatever your country's currency is.

If you don't mind running a second EA on a second chart, search for "Swiss Army EA" or "MPTM" (Multi-Purpose Trade Manager) on Google. Both will probably do what you want.

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


Top
 Profile  
 
 Post subject: Re: how to set CL or CS?
PostPosted: Wed Jul 04, 2012 3:38 pm 
Offline

Joined: Fri Apr 20, 2012 10:02 pm
Posts: 15
Thank you very much


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