Click here to Login





                                                   Compare strategy total returns or benchmarks on a percentage scale

  0

0
Greg
2015-04-19 17:47:00


Hi!
I'm new to QuantShare and I'm experimenting with basic features.
I have implemented some simple trading strategies and I would like to compare their equity curves to some benchmarks like S&P500 or to other trading systems at different time-frames.
Basically, I would like to see a chart with multiple graphs, where the scale of Y is percentage, and all of the graphs are aligned to the same Y (Y=100% or Y=0%) at the X=0 (leftmost) time point.
This is a very basic visual analysis feature used by several other tools, e.g. etfreplay (http://www.etfreplay.com/combine.aspx) or yahoo finance (http://finance.yahoo.com/echarts?s=MDY+Interactive#%7B%22range%22%3A%223mo%22%2C%22scale%22%3A%22linear%22%2C%22comparisons%22%3A%7B%22%5EGSPC%22%3A%7B%22color%22%3A%22%23cc0000%22%2C%22weight%22%3A1%7D%7D%7D).

I have been able to save the equity curve of a trading system with the "Equity to symbol" feature in the Simulator, but did not find a simple way to visualize it as described above.
The CompareAsstes function (http://www.quantshare.com/item-1005-relative-performance-return-chart-compare-several-assets-stocks#) works only for real assets (stocks, ETFs, etc.) but the scale is distorted when comparing to equities...
The Benchmark Expansion Money Management script (http://www.quantshare.com/item-1484-benchmark-expansion) does not align the curves...

So what is the recommended way to do that?

Thanks,
Greg



QuantShare
2015-04-20 03:05:04

  0

Hi Greg,

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.





Benchmark Return in a Trading System Simulation (by QuantShare, uploaded several months ago)
No notes

Rate an item Rate an item Rate an item Rate an item Rate an item Number of downloads Notes Report an item

Greg
2015-04-20 12:30:00

  0

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.

// Buy rules
Rule1 = (Sma(50)) > (Sma(200));
buy = (Rule1);
// Sell rules
Rule2 = (Sma(50)) <= (Sma(200));
sell = (Rule2);

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);

Thanks in advance,
Greg



QuantShare
2015-04-21 03:46:27

  0

Hi Greg,

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.



Greg
2015-04-21 08:22:44

  0

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?

Thanks again!
Greg







QuantShare
2015-04-22 03:33:41

  0

Greg,

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.



Greg
2015-04-22 05:31:08

  0

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










Benchmark Expansion (by Alpha Trader, uploaded several months ago)
No notes

Rate an item Rate an item Rate an item Rate an item Rate an item Number of downloads Notes Report an item
Benchmark Return in a Trading System Simulation (by QuantShare, uploaded several months ago)
No notes

Rate an item Rate an item Rate an item Rate an item Rate an item Number of downloads Notes Report an item

No more messages
0




Reply:

No html code. URLs turn into links automatically.

Type in the trading objects you want to include: - Add Objects
To add a trading object in your message, type in the object name, select it and then click on "Add Objects"










QuantShare

Trading Items
Percentage of new highs to total market
Investing in stocks using the Kelly criterion money management st...
Sleep Well Bond Rotation Strategy V1.0
Staggered Entry and Exit Strategy
Strategy Optimization on Random in-sample and out-of-sample Perio...

How-to Lessons
How to create a log scale chart
How to scale and move the chart Y-axis
How to plot a time-series that do not update the chart scale
How to draw distances on a chart?
Difference between the watchlist and the screener tools

Related Forum Threads
Percentage Scale
Capital allocation - total capital is split in Long/Short strateg...
how to compare the returns of multiple ETF pairs?
Receate ETFReplay strategy
Compare Asset Function in Watchlist

Blog Posts
How to Use the Percentage Scale
Optimize a trading strategy using the Sharpe ratio
6 techniques to improve the performance of your stock trading str...
Optimizing the Strategy Equity Curve
Backtesting a Strategy Based on Bond and Stock Index ETFs









QuantShare
Product
QuantShare
Features
Create an account
Affiliate Program
Support
Contact Us
Trading Forum
How-to Lessons
Manual
Company
About Us
Privacy
Terms of Use

Copyright © 2024 QuantShare.com
Social Media
Follow us on Facebook
Twitter Follow us on Twitter
Google+
Follow us on Google+
RSS Trading Items



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.