Equity Manager!

Post Reply
Mourad

Equity Manager!

Post by Mourad »

Hello all
I'll try to describe the case, then post the request for any interested coder!

I use hedging, so equity is always smaller than balance [although equity itself is increasing] so baskets of floating P/L can't deal with this because there are trades that closed in profit needs to get involved in calculations!

I'm looking for an EA that could set a target in cash, that target can be achieved through the sum of closed and open orders for the trades of each pair separately!
When a series of trades [closed and open] of a pair reaches the predefined target, the trades of this pair get closed, no matter what other pairs are doing right now!

Example!
Target = 50$
Closed orders of EU = 20$
Floating profit of EU = 30$

Than the EA closes all open trades of EU only and leaves other pairs alone till they achieve the same target!

If there's already an existing EA that can do this, please post it because I've been searching for a long time with no results [all available are drag and drop scripts, or software that uses floating P/L]. If it's easy to be done, I'll appreciate any help!
If the request is inappropriate of missing some info, I can describe it differently because I don't know what info does a coder need to get involved!

Thank you all!
jlcgarcia

Re: Equity Manager!

Post by jlcgarcia »

Mourad wrote:Hello all
I'll try to describe the case, then post the request for any interested coder!

I use hedging, so equity is always smaller than balance [although equity itself is increasing] so baskets of floating P/L can't deal with this because there are trades that closed in profit needs to get involved in calculations!

I'm looking for an EA that could set a target in cash, that target can be achieved through the sum of closed and open orders for the trades of each pair separately!
When a series of trades [closed and open] of a pair reaches the predefined target, the trades of this pair get closed, no matter what other pairs are doing right now!

Example!
Target = 50$
Closed orders of EU = 20$
Floating profit of EU = 30$

Than the EA closes all open trades of EU only and leaves other pairs alone till they achieve the same target!

If there's already an existing EA that can do this, please post it because I've been searching for a long time with no results [all available are drag and drop scripts, or software that uses floating P/L]. If it's easy to be done, I'll appreciate any help!
If the request is inappropriate of missing some info, I can describe it differently because I don't know what info does a coder need to get involved!

Thank you all!
Hi Mourad,

take a look at this EA, and see if it is what you are looking for.

Close_on_Profit.mq4
Regards


José Luis
You do not have the required permissions to view the files attached to this post.
Mourad

Re: Equity Manager!

Post by Mourad »

Thank you Mr Jose! seems that it'll do the job, but a further question: How can I apply it to deal with each pair separately?
Do I put it on each chart to deal with each series of each pair separately?

Thank you!
jlcgarcia

Re: Equity Manager!

Post by jlcgarcia »

Mourad wrote:Thank you Mr Jose! seems that it'll do the job, but a further question: How can I apply it to deal with each pair separately?
Do I put it on each chart to deal with each series of each pair separately?

Thank you!

Hi,

I think that the EA I posted discriminates by magic number, not by pair. You have to have different magic numbers. If this is not the case, this EA I am posting here discriminates by pair, applying to the pair you want to control, and changing

Code: Select all

extern bool      AllSymbols             = false;
Here it is:

CloseAtProfit.mq4
Regards


José Luis
You do not have the required permissions to view the files attached to this post.
Mourad

Re: Equity Manager!

Post by Mourad »

Wowwwww
Can't thank you enough Mr Jose! I've been trying to get around this issue for several hours! but I know nothing about coding.. so thank you, that's exactly what I need!
Post Reply

Return to “Coders Hangout”