Bitte schön.
Ist aber absolut minimalistisch.
Code:
int start()
{
double LongProfit = 0;
double ShortProfit = 0;
for(int i = OrdersTotal() - 1; i >= 0; i--)
{
if(OrderSelect(i, SELECT_BY_POS, MODE_TRADES))
{
if (OrderType() == OP_BUY && OrderSymbol() == Symbol())
{
LongProfit = LongProfit + OrderProfit();
}
if (OrderType() == OP_SELL && OrderSymbol() == Symbol())
{
ShortProfit = ShortProfit + OrderProfit();
}
}
}
Comment ("Profit Long: ", LongProfit,
"\n", "Profit Short: ", ShortProfit);
}
Gruß
naranjoe