The "CompareAssets" function should work with any symbol (not just real assets). Make sure you enter the symbol correctly and make sure it starts with "~".
You can also use the following money management script: Benchmark Return in a Trading System Simulation
If the scales are different then right click on the different lines, select "Selected Graph" then click on "Use default scale". If "Use own scale" appears then this means that default scale is already selected.
Hi!
Thanks for the quick answer! Unfortunately, as I indicated above, I tried both of your suggestions but none of them works as I expected.
Would you be so kind as to help me in debugging the issue?
My simple trading system is the following, and I backtest it with a single symbol, the SPY ETF. The percent of capital to invest is 100%, commissions are set to zero as a default.
When I use the Money Management Script with SPY as a benchmark, the two graphs are not aligned at the leftmost time point. They seem to be aligned at the last, rightmost time point. Pls. see the screenshot bellow:
https://www.dropbox.com/s/ia7keiqvly3bda9/QS_compare1.png?dl=0
When I use the CompareAssets function bellow, the scale of the two graphs looks like different. Pls. see the screenshot bellow:
https://www.dropbox.com/s/wgzlwjiowehvp13/QS_compare2.png?dl=0
// Formula using Indicator: CompareAssets
p = CompareAssets("SPY;~MYTEST","05/20/2010");
plot(p, "CompareAssets", colorBlack, ChartLine, StyleOwnScale);
I tried your system, right clicked on both lines (in the simulator) then "Selected Graph -> Use default scale" and the equities are aligned now.
Regarding the "CompareAssets" function, both lines are using the same scale. Everything is correct.
S&P return is much higher than your strategy return (around 2%).
Note that in your trading system, the number of positions is probably set to "5" and this means that only 20% of the portfolio is invested. That is why you are getting a very low annual return.
Hi!
The issue with the ComapreAssets function was resolved when I set the number of positions to 1, that was the problem. Thank you!
The benchmark vs. equity graphs generated by Money Management script in the Simulator are still not aligned at the leftmost position even if I "use default scale". I mean, I would have expected that two graps at x=0 (leftmost bar) start form the same y1=y2 to be able to compare the difference of the returns at the last bar on the right. But I played a bit with the timeframe adjuster and realized that this feature is not suitable for that because the start/end positions of the graphs are calculated based on their min/max in the selected timeframe, independently from each other. Ok, but how do I know the difference of their returns (besides visualizing with ComapareAssets)? The Statistics tab in the Simulator Report shows only the Beta/Alpha/RSquared/Correlation for Performance vs. Benchmark. Any ideas for that?
It is working, I have tried it many time. Just right click on any line and select "use default scale". You have to do that for the strategy equity and for the benchmark equity. If the two graphs doesn't start at the same Y value then you are probably not displaying the whole data in the chart, just move the scroll bar to the left.
When using the above money management script, the benchmark return will be displayed in the report table at the top after you backtest a trading system.
Hi!
I completely understand what you are writing but obviously my system works differently so I started to debug the issue.
I deleted the money management scripts from the trading system and also removed the trading items from QuantShare (both the attached Benchmark Return and Benchmark Expansion item), downloaded only the Benchmark Return again and added it again to the trading system. Now I see the "A. Benchmark Return" column in the report and also the graphs are aligned at the rightmost bar if I set the "default scale"! Exactly as you described.
I could not figure out why the "A. Benchmark Return" column did not appear in the report before, I cannot reproduce the issue. But it seems that graph alignment problem is related to the Benchmark Expansion MM script: it does not align the graphs (not even with the "default scale" setting), whereas the first version of the script does. Probably, I used the Benchmark Expansion script for testing sometimes and not the original one that you are using.
Thanks again for helping me in debugging the issue and sorry for the confusion!
Greg
Trading financial instruments, including foreign exchange on margin, carries a high level of risk and is not suitable for all investors. The high degree of leverage can work against you as well as for you. Before deciding to invest in financial instruments or foreign exchange you should carefully consider your investment objectives, level of experience, and risk appetite. The possibility exists that you could sustain a loss of some or all of your initial investment and therefore you should not invest money that you cannot afford to lose. You should be aware of all the risks associated with trading and seek advice from an independent financial advisor if you have any doubts.