Position and HistoricalTrade

Created at 27 Jun 2016, 13:31
How’s your experience with the cTrader Platform?
Your feedback is crucial to cTrader's development. Please take a few seconds to share your opinion and help us improve your trading experience. Thanks!
moneybiz's avatar

moneybiz

Joined 06.12.2011

Position and HistoricalTrade
27 Jun 2016, 13:31


Position and HistoricalTrade objects need account exchange rate property because sometimes when GrossProfit is zero it's not possible to calculate what was the exchange rate between the traded counter currency and the account currency.
I may trade USD/TRY and have an EUR account. What's the relation between TRY price changes to my account currency EUR?
I need it in money management calculations where I need to use percentage profits and commissions needed to be in counter currency which I need to convert from the account currency exchange rate...

Normally even it is possible to calculate an approximate exchange rate from the relation;
exchangeRate = position.GrossProfit / (|position.ClosedPrice (or current price) - position.EntryPrice| * position.Volume)
it lacks precision because the gross profit only has 2 decimal places and when gross profit is zero the net profit is negative due to commissions and then it's impossible to calculate the exchange rate which the net profit has been calculated.


@moneybiz
Replies

MaVe
27 Jun 2016, 13:49

Maybe you can use something from this Calculators for your Money Management:

http://www.fxpro.co.uk/trading/calculators/all-in-one


@MaVe

moneybiz
27 Jun 2016, 15:53

RE:

MaVe said:

Maybe you can use something from this Calculators for your Money Management:

http://www.fxpro.co.uk/trading/calculators/all-in-one

I need real-time calculations. Also when back-testing which is another issue, the exchange rate has to be embedded inside the position info.  


@moneybiz