One questin for underestanding functions OrderTakeProfit() and OrderProfit()

 

hello to all
Honestly, I don't understand the difference between OrderTakeProfit()  and OrderProfit() functions.

For example, if in buy positions on EURUSD and USDJPY if the entry and current prices are like this, what are the values ​​of these two functions?


lotsize = 0.2

EURUSD ٍEntry = 1.0640

EURUSD Current Price Bid = 1.0690

EURUSD Current Price Ask= 1.0692

----------------------

lotsize = 0.2

USDJPY ٍEntry = 155.10

USDJPY Current Price Bid = 155.90

USDJPY Current Price Ask=155.92


OrderTakeProfit() = ?

OrderProfit()  = ?

------------------------------

If I close half the volume of both positions, how will the values ​​of the functions change?

after close 0.1 volume USDJPY and EURUSD OrderTakeProfit() = ?

after close 0.1 volume USDJPY and EURUSD OrderProfit() = ?

The answer to this question helps me a lot to understand these two functions. Thank you for your help

USDJPY - US Dollar vs Yen - Today's currency exchange rates — Forex exchange rates
USDJPY - US Dollar vs Yen - Today's currency exchange rates — Forex exchange rates
  • 2024.11.14
  • www.mql5.com
USDJPY - US Dollar vs Yen - Most popular currency pair charts. Use the filter below to select the exchange rates you need. Each chart features Bid/Ask prices, as well as daily growth.
 

OrderTakeProfit() returns the price that was set for the trade's TakeProfit-price (as opposed to the StopLoss-price).

OrderProfit() returns the profit or loss of the trade at current or closing price.

 

Thanks a lot Fernando Carreiro ,

1-In the OrderProfit() , the amount of profit is returned based on pips or dollars?
2-Then, if some of the volume is closed, will the remaining profit be returned?

 
Shahriar Soltani #:

Thanks a lot Fernando Carreiro ,

1-In the OrderProfit() , the amount of profit is returned based on pips or dollars?
2-Then, if some of the volume is closed, will the remaining profit be returned?

1) In account currency amount. If your account is in dollars, it will be in dollars, if your account is in EUR, it will be in EUR.

2) Yes.

 
Fabio Cavalloni #:

1) In account currency amount. If your account is in dollars, it will be in dollars, if your account is in EUR, it will be in EUR.

2) Yes.

Thank you dear Fabio,

I understood.