profit in pips is the difference between openprice and closeprice divided by point
buy orders will be closed at Bid, so Bid-OrderOpenPrice()
sell orders at Ask, so OrderOpenPrice()-Ask
for(int pos=0; pos<=OrdersTotal(); pos++)
{if(OrderSelect(pos, SELECT_BY_POS)==true)
{
if(OrderType() == OP_BUY)
Alert("Profit for the order #",pos," is: ",(OrderClosePrice()-OrderOpenPrice())/MarketInfo(OrderSymbol(),MODE_POINT));
else if(OrderType() == OP_SELL)
Alert("Profit for the order #",pos," is: ",(OrderOpenPrice()-OrderClosePrice())/MarketInfo(OrderSymbol(),MODE_POINT));
}
else
Print("OrderSelect returned the error of ",GetLastError());
}
This is my first post... hello everybody :D
( OrderProfit() - OrderCommision() ) / OrderLots() / MarketInfo( OrderSymbol(), MODE_TICKVALUE )
You are missing trading opportunities:
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
Registration
Log in
You agree to website policy and terms of use
If you do not have an account, please register
OrderProfit() /OrderLots () /???? = ????? profit in pips ?