Profit for buy
OrderProfit() = (OrderClosePrice()-OrderOpenPrice())*OrderLots()*MarketInfo(OrderSymbol(),MODE_TICKVALUE)/Point;
tuoitrecuoi:
Profit for buy
OrderProfit() = (OrderClosePrice()-OrderOpenPrice())*OrderLots()*MarketInfo(OrderSymbol(),MODE_TICKVALUE)/Point;
Thanks a lot for the answer.
I add the below code in the EA program
double profit;
double CalProfit;
profit=OrderProfit();
CalProfit=(OrderClosePrice()-OrderOpenPrice())*OrderLots()*MarketInfo(OrderSymbol(),MODE_TICKVALUE)/Point;
Print("Profit="+profit,",","CalProfit="+CalProfit);
But it seems the profit is not equal CalProfit.
Is there something wrong?
![MQL5 - Language of trade strategies built-in the MetaTrader 5 client terminal](https://c.mql5.com/i/registerlandings/logo-2.png)
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
I thought
OrderProfit()=OrderClosePrice()-OrderOpenPrice();
But when I check the log file I find it seems I am wrong.
Please, hope somebody can tell me the details of OrderProfit(), how to calculate it?
Thanks a lot!