購入注文または売却注文ごとに、ペアごとにP&Lを開設できますか?
5件の返信
皆様、こんにちは,
As the title says, How do I get for example the open P&L for BUY only trades per pair(symbol) ???????
0
こんにちは,
with the “Open PL” function you always specify the magic number so this function always return open PL for a specific order.
Do you need a function to return open P/L for all buy orders opened in a specific pair?
0
Do you need a function to return open P/L for all buy orders opened in a specific pair?
Yes please 🙂
0
こんにちは,
Add this into EA Wizard / code / CustomFunctions.mq4 file. Then you can use it in Wizard as it is shown in example attached
float sumProfitLong(string symbolString) {
float totalLongProfit = 0;
for(int i=OrdersTotal()-1; i>=0; i--) {
if (OrderSelect(i,SELECT_BY_POS)==true) {
if (OrderType() == OP_BUY && OrderSymbol() == symbolString) {
totalLongProfit += OrderProfit();
}
}
}
return totalLongProfit;
}
0
ありがとうございます
which example?
No example attached
0
5件の返信を表示中 - 1 - 5件目 (全5件中)