How to Calculate only buy orders
-
I am working on hedge EA .. i am opening 8 orders .. 4 buy and 4 sell
I want the EA calculates the SUM of profit and lose for all buy orders .. and calculates the SUM of profit and lose for all sell orders .And if all buy orders hit TP close only buy
And if all sell orders hit TP close only sellMy issue is how to make the EA calculates only buy orders and calculates only sell orders separately .
Any help ...
-
@wolamen You can use some of this structure:
https://fxdreema.com/shared/lrcTsr7Id
It is for MT5 but can be used for MT4 if you change the appropriate blocks. You shouls also change the settings of blocks 4 and 5. They are for buys and sells. You will need to duplicated them. One for buys and another one for sells. Additionally, blocks 9 and 10 are not necessary.
-
@l-andorrà i do not think this can help my case
i have many open orders buy and sell
how can i calculate all buys .
how can i calculate all sells .if all buy hit TP close only buys.
if all sells hit TP close only sells. -
@wolamen My example can calculate the overall profit/loss of all open trades right now. No matter how many are open right now. You simply need top duplicate it: one structure for buys and another one for sells.
Same with closing. You can specify only buys or sells to be closed when your profit target is reached.
-
@l-andorrà Thanks for help but i am still do not get that example or there is a misunderstood between us .
any way i am simply want to calculate 2 variables
First variable named (SUM BUY) : Calculates the summation (profit + loss) of all opened buy orders.
Second variable named (SUM SELL) : Calculates the summation (profit + loss) of all opened sell orders. -
@l-andorrà i get it now .. it is working .. thank u very much
-
@l-andorrà plz from your examble .. how can i calculate the commission to get clear profit ?
-
@wolamen I'm glad you got it. This is the way to include swap and comissions:
