Forex Exchange Rate Locations
Jammawind last edited by Jammawind
I am currently working the FX data and I have put in my logic for the buying and selling. However, I am having trouble with Trade Value, the net profit and loss calculations, and exchange rate locations. I just don't understand what section of the backtrader code I would put these three sections.
For the Trade Value, would this value be placed under the order or the commissions code for the back testing? The trade value would be important to make sure the margin is calculated correctly.
What would be the correct method to change the net P/L calculation for forex? Would this be under the strategy itself or under the order and execution stage? This method currently calculates correctly when the USD is the quote price.
(Equation: Profit/Loss = 0.0001 * Trade Value / Exchange Rate * Change in Pips.)
Where would the code for changing the exchange rate for USD and cross pairs be placed?
Thank you for your assistance.