Viewing 6 posts - 1 through 6 (of 6 total)

Forums>AlgoWizard / EA Wizard>Application Support>Close All Open Order of ONE currency Pairs

• #238327 |
Customer
16 Posts

Can someone please help me with a custome function to do that:

IF: Total TP in money of all OPEN orders for ONE currency pairs > 0

THEN: Close all OPEN order for that currency pairs

Thanks!

#238328
Customer
100 Posts

Are you behind some firewall without access to google.com ? :)

Just make two loops through your open orders and then:

In loop1() function:

if(OrderSymbol()==Symbol())
TotalSymbolProfit=OrderProfit()+OrderSwap()+OrderCommission();

After first loop1() check if total profit is >0 then call loop2().

if(TotalSymbolProfit>0) loop2();

in loop2() function:

if(OrderSymbol()==Symbol())
OrderClose(OrderTicket(),OrderLots(),etc…);

Gr

Chris

Do you want to become a profitable trader? Join our free community to learn more about algo-trading:forum.coensio.com

#238343
Administrator
1826 Posts

Hello,

also the built-in Open P/L function can be used to obtain P/L for all order in a specific currency. Just set magic = 0

Let us know if you need some more help with the custom function

#239188
Customer
16 Posts

Chris

@Chris: Because I am not coder to write proram. Thanks you

#239189
Customer
16 Posts

Hello, also the built-in Open P/L function can be used to obtain P/L for all order in a specific currency. Just set magic = 0 Let us know if you need some more help with the custom function

So, I often open trading with 2 -3 currency pair at same time

Open P/L function If set magic =0 it will return sum of open P/L for all active orders NOT FOR ONE CURRENCY PAIR.

###### Attachments:
You must be logged in to view attached files.
#239199
Administrator
1826 Posts
Viewing 6 posts - 1 through 6 (of 6 total)

You must be logged in to reply to this topic.