I want to know the USD returns while back testing crypto pairs. For example backtesting BTC_ETH will show returns in BTC, but i want the relative USD returns. (as USD_BTC will be changing over the time series) I'm thinking i need both time series BTC_ETH and USD_BTC and either work out the value of USD_BTC at the open and close of each trade, or multiply the returns of both pairs while the trade is open.
I use Quantstrat (plus the usual dependencies) I also use python for execution, but i rather R for modelling.
Is there a similar solution in forex?
This is a terrible idea and a great way to lose a lot of money.
Say you trade BTC and ETH. You can book a USD profit on every single trade and still have a massive loss. Why? Because you may wind up holding lots of BTC when the BTC price is going down and lots of ETH when the ETH price is going down.
Imagine if you start with $1,000 in BTC and ETH, have a day of trading and wind up booking $100 in profit. But then overnight, the price of ETH halves and BTC doubles but you are holding all ETH. So your $1,100 turns to $550.
The next day you trade and book $100 in profit, so you're up to $650. But then overnight, the price of ETH goes back up but BTC halves and you are holding all BTC. So now you have $325 worth of ETH.
What happened? You booked $200 in trading profits, no trading losses, but your $1,000 in BTC turned into $325 worth of ETH.
And, yes, this really happens. When BTC is going up, people will want to buy your BTC. So you'll be holding less when it's going up. When BTC is going down, people will want to sell their BTC to you. So you'll wind up holding more when it's going down.
Ack!