Using Johansen cointegration mean reversion system Im having an issue with weights. When Im using raw prices which gives a hedge ratio between numbers of share of two or more instruments I am rebalancing daily it does fine! But when I use log prices which gives a hedge ratio between market values of two instruments, I use order_target_percent and cash value (using the ratio of all weights divided by the total of the absolute of each weight value) for weights and rebalance daily but Im getting a poorer performance. Im wondering what could be wrong.
Hello Jane,
Thank you for sharing your code.
Let's answer your question.
In the two cases, it's happening two different things:
- You're using for one scenario normal prices and for the other scenario log prices
- For the first case, you are buying a certain amount of shares. On the other hand, you're using cash value.
What I can tell you is that tas he number of shares you buy in one scenario might not be the same the number of shares you buy in the second scenario. I mean, if you convert the cash value in a number of shares for the second scenario, you might find that this converted number of shares might not be equal to the number of shares obtained in the first scenario.
What's the consequence about this? Well, it can be understood as you're having two types of strategies.
Now, do these two types of strategies need to have the same performance? Actually they don't. They can have different performances. So that's why it's important backtesting. You need to find the specific parameters and set of rules for your strategies to find a plausible strategy.
I hope this comment helps,
Thanks and regards,
José Carlos
Whats the norm for a strategy such as this(with respects to weighting a portfolio? Do people use ratios of cash value? or the raw price data and therefore the raw share amount?
Hello Jane,
Good question,
That leads us to an important thing about backtesting.
When you backtest strategies, it's always important to have an agnostic approach to do it. This means that, if there is no consensus about how to proceed with a specific topic and you face different alternatives, then you must proceed by applying all the alternatives to find which strategy or a specific set of parameters has the best performance.
About the use of raw or log prices. It's always said among econometricians that log prices give the residuals a more normally distributed behaviour when applying cointegration tests.
However, when you want to trade, it's better to check whether raw prices or log prices can make a significant difference in performance.
Always remember to prove everything you think you can prove while backtesting a strategy.
I hope this helps,
Thanks and regards,
José Carlos
Do you trade mean reversion Mr Jose Carlos?
Hello Jane,
Adding to what Mr Carlos said, the usage of raw price vs cash value also depends on the investment size.
For a retail investor, the raw share amount can make more sense as the number of shares stays the same, and hence there is a minimal transaction cost.
But in the case of a large investor, the cash value can work. However, the rebalancing costs, slippage etc., will be additional transaction costs.
Thanks,
Akshay