Click here to Login





                                                   Custom index/relative chart for TAA - Sector rotation

  0

0
Alexander Horn
2014-01-02 09:14:13


Guru / Folks,

when implementing the relative / index chart, I was wondering whether this can be further automated for the TAA / sector rotation among us. Sadly my little VBA skills have come to an end here, but with some help from the community I'm willing to put some brain / time into this.

Re: http://www.quantshare.com/sa-301-compare-stocks-and-securities-by-creating-a-relative-performance-chart&kbaseid=blog-301-2499-1399#

1) Is it possible to replace the custom reference date by the current startdate of the chart? this would set the base always on the left of the selected timeframe and allow to see % over selected period. was trying to get this running in script, but novice..

2) Is it possible to replace the manual symbol input by pulling them from a watchlist?

3) Maybe we can further elaborate to add panes with momentum, volatilities, correlation of assets in reference watchlist.

4) Maybe pulling equity line from backtest and creating screen for low correlation symbols to be added?

Working on getting my new stategy together with input from 2012 papers AAA (Butler) and FAA (Keller). If there is interest to connect brains, let me know..

Thanks,
Alex





Relative Performance/Return Chart - Compare Several Assets/Stocks (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

QuantShare
2014-01-02 22:52:52



Hi Alex,

If you want to use the chart start date then type a very old date. Example:
a = CompareAssets("GOOG;A;AA;AAPL", "05/20/1800");

You can update the custom indicator by selecting "Tools" then "Create Functions".

We will write another blog post that answers the other questions.


Regarding the last question, it is possible to get equity line from a backtest by right clicking on the equity chart of the backtest report then selecting "Equity to Symbol".
This will create a new symbol.




Alexander Horn
2014-01-04 06:54:27



All,

to follow up on an integrated chart for TAA - rotation strategies, I was curious whether I get this done in C#, here a first draft which hopefully can get improved by the pros:

Pull symbols from any watchlist and adapt chart so that base 1 matches left visible start date:

Screenshot and scripts in attached link: https://drive.google.com/folderview?id=0B2nAWp8wo_B6eXpPcVYxVXRSOXc&usp=sharing and also in trading items:

Script to be put as shortcut as "one-click" tune to trigger update of chart and watchlist:

---------------------------------------
string[] assets = Watchlist.GetSymbols("TAA_Basic"); // TAA_Basic ETF
string Assets = "";
for(int j=0;j<assets.Length;j++)
{
Assets = Assets + ";" + assets[j];
}
Global.SetVariable("Symbols",Assets);

Chart chart = Charts.GetSelectedChart();
DateTime startdate = chart.VisibleStartDate;
Global.SetVariable("Date",startdate);
chart.Update();

// To "receive" in the indicator script use these lines :

//string Assets = Global.GetVariable("Symbols").ToString();
//string[] assets = Assets.Split(';');
//string Date = Global.GetVariable("Date").ToString();
---------------------------------------

Use this or similar formula in your 1st chart pane for performance chart:

---------------------------------------
temp1 = CompareAssets(); // updated version uploaded or in link
temp2 = iffstr(temp1,"Close - All plotted","Close - Only first 27 plotted");
PrintChart(temp2, "Notice", BottomLeft, colorWhite, colorBlack, colorBlack, 255);
---------------------------------------

On the second and third pane you can use this one for Roc, Ema, Stdev, etc:

---------------------------------------
temp1 = CompareAssetsFunc("Rocr100",100); // new version including more features and custom indicator uploaded or in link
temp2 = iffstr(temp1,"Rocr100 - All plotted","Rocr100 - Only first 27 plotted");
PrintChart(temp2, "Notice", BottomLeft, colorWhite, colorBlack, colorBlack, 255);
---------------------------------------

Hope somebody joins in to further finetune and add further features.

Have fun,
Alex



QuantShare
2014-01-10 12:55:03



Alex,

You have done a great job. Anything else you want to add to the script?




Jim Harrison
2014-01-18 02:27:28



Am not familiar with those papers, but if you would drop a copy of them in your Gdrive and link here I will take a look and see where it goes.....


Alexander Horn
2014-01-18 02:56:16



Hi Jim, all,

here we go:

Butler, Adam and Philbrick, Mike and Gordillo, Rodrigo, Adaptive Asset Allocation: A Primer (May 31, 2012). Available at SSRN: http://ssrn.com/abstract=2328254 or http://dx.doi.org/10.2139/ssrn.232825 FURTHER INFO ALSO HERE: http://gestaltu.com/2013/08/dynamic-asset-allocation-for-practitioners.html 5 articles in total

Keller, Wouter J. and van Putten, Hugo S., Generalized Momentum and Flexible Asset Allocation (FAA): An Heuristic Approach (December 24, 2012). Available at SSRN: http://ssrn.com/abstract=2193735 or http://dx.doi.org/10.2139/ssrn.2193735

and just released:
Keller, Wouter J. and van Putten, Hugo S., Tactical MPT and Momentum: The Modern Asset Allocation (MAA) (December 30, 2013). Available at SSRN: http://ssrn.com/abstract=2373086 or http://dx.doi.org/10.2139/ssrn.2373086

Let me know if there is interest to implement concept behind.



Jeff D
2014-01-18 14:53:52



Will take a look. Interesting reads.


Alexander Horn
2014-01-19 10:43:36



Let me add one more related item after an exchange on tactical asset allocation with Clonex, who gladly has added risk parity concepts as AMM scripts in the sharing server.

There are two nice heuristic solutions out there for Minimum Variance and Minimum Correlation optimization, e.g. simple calculations w/o need for any fancy quadratic optimizer. Weighting % discrepancy from solver optimization is minimum (and I expect covered by error from noise anyhow). Side benefit is that its lightning fast (20ms) vs. solver solution.

In my experience, MinVar indeed drastically reduces portfolio volatility (~7% in my previous setup vs standard 15% w/o) and therefore DD (<10% vs. 20%), but it comes at the price of lower return and sitting most time in lowvol bonds/treasuries if included in symbol selection. To overcome this, an alternative approach is using pure equity ETF in optimization, and using additional market signal to get out of trouble in high-vol times.

Look here, for MinVar: http://cssanalytics.wordpress.com/2013/04/05/minimum-variance-algorithm-mva-excel-sheet/
And here MinCorr: http://cssanalytics.files.wordpress.com/2012/10/minimum-correlation-mincorr-spreadsheet.xlsx

I%u2019ve brought the MinVar into VB, with good results, but not good enough to convert to C# script. Maybe QS or somebody in the community is interested in getting both into C# for the benefit of all users? :-)

Anybody freaking out to do some voluntary coding? I will, but have a hard time getting acquainted with picky C#, miss my "universal variants" from VBA :-)

Have fun!
Alex

P.D. Thanks and all the flowers to the guys from CSSA and systematic investor for the brain part.



Jim Harrison
2014-01-19 22:09:40



Interesting papers. Will look Scotts spreadsheets this week follow up.




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
Global Sector Rotation Strategy V1.0
Industry and Sector Information for the US Stock Market
Sector Rotation Model - SRM
Relative Performance/Return Chart - Compare Several Assets/Stocks...
Relative Performance Chart - Dynamic assets and index

How-to Lessons
How to create a custom trendline
How to download earnings calendar data for various stocks
How to display Forex economic calendar data in a chart
How to display notes/commentaries on a chart
How to use a custom drawing tool

Related Forum Threads
Chart for 1m bars over a custom time range
Monthly/weekly summation for a custom database field
How do I find the close price for an entry matching a custom DB
Better Plotting for Sell Arrows on Chart
Different symbol list for Long/Short / custom portfolio categorie...

Blog Posts
Chart Layouts Explained - With Custom Scripts
Custom Shortcuts - Move a Chart to Display the Last Quotes/Data
Create custom metrics for the statistical data analysis tool
How to Create Custom Metrics for Your Trading Positions
Compare stocks and securities by creating a relative performance ...









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.