Download MetaTrader 5

The details of OrderProfit()

To add comments, please log in or register
Share the links to products and make your profit
xin2014
42
xin2014 2015.01.05 03:30 

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!

Trinh Dat
37217
Trinh Dat 2015.01.05 08:18  

Profit for buy

OrderProfit() = (OrderClosePrice()-OrderOpenPrice())*OrderLots()*MarketInfo(OrderSymbol(),MODE_TICKVALUE)/Point;

xin2014
42
xin2014 2015.01.05 08:52  
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?

To add comments, please log in or register