Reply

Close All Open Order of ONE currency Pairs

5 replies

Truong Cao Xuan

Customer, bbp_participant, community, 9 replies.

Visit profile

5 years ago #238327

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!

 

 

0

coensio

Customer, bbp_participant, community, 106 replies.

Visit profile

5 years ago #238328

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

 

 

 

This is a false statement.

0

tomas262

Administrator, sq-ultimate, 2 replies.

Visit profile

5 years ago #238343

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

0

Truong Cao Xuan

Customer, bbp_participant, community, 9 replies.

Visit profile

5 years ago #239188

Chris


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

 

0

Truong Cao Xuan

Customer, bbp_participant, community, 9 replies.

Visit profile

5 years ago #239189

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.

0

tomas262

Administrator, sq-ultimate, 2 replies.

Visit profile

5 years ago #239199

Viewing 5 replies - 1 through 5 (of 5 total)