This is a trading item or a component that was created using QuantShare by one of our members.
This item can be downloaded and used by QuantShare Trading Software.
Trading items are of different types. There are data downloaders, trading indicators, trading systems, watchlists, composites/indices...
You can use this item and hundreds of others for free by downloading QuantShare.
Top Reasons Why You Should Use QuantShare:
Works with US and international markets (stock, forex, options, futures, ETF...)
Offers you the tools that will help you become a profitable trader
Allows you to implement any trading ideas
Exchange items and ideas with other QuantShare users
Our support team is very responsive and will answer any of your questions
We will implement any features you suggest
Very low price and much more features than the majority of other trading software
The correlation filter money management strategy analyzes each incoming order and measures its correlation with each opened position in your portfolio. If the correlation between the new order symbol and a portfolio symbol is higher than a specific threshold (definable and optimizable in money management inputs) then the order is rejected, otherwise we analyze the correlation with another existing symbol until not positions are left. This script allows you to create a group of well-diversified stocks.
I have tested this technique on some trading systems and overall the results are positive. For example, a strategy I have developed few months ago were generating an annual return of 35% and the percentage of winners was 52%. After adding the correlation test script, with a 40% threshold, to the list of money management scripts of my trading system, the annual returned increased to 52% and the percentage of winners also increased to 67%.
The correlation filter script uses the "ParseFormula" function to execute the vector-based "correl" function that takes two time-series (Close prices for instance) and a period. The implementation of this script could be optimized (improved execution speed and less memory usage) by creating a correlation function within the "OnNewPosition" event.
The period that is used to calculate the different correlations is 60. It is defined in line 13 in the OnNewPosition event. It can be updated and added as an optimizable variable using "SetNumericInput" and "GetVariable" function. For more information, look at how the "Max Correlation" variable was implemented.