Re: [amibroker] Re: code for Clenow book

 

Sounds good Vandan, and your code included one of the suggested filters. But there were other filters.


Bruce, while testing the rankings don't forget that trades are filtered out.

 

The next rules are the 'filters',

// The Filters

// each chosen stock must be in long term uptrend

// the market must also be in long term uptrend

// avoid stocks with recent large gap trade

// the author was unclear in the book but he meant the gap to be a ONE DAY gap

// gapsize = (Open-Ref(Close, -1))/Ref(Close,-1); // a 15% one day gap almost never happens in the large cap stocks that make up the SP500

// in mid to large cap stocks maybe come up with a different gap

gapsize = (HHV(C,2)-LLV(C,2))/ LLV(C,2); // my version is a two day Highest Close compared to Lowest Close "Gap"

gapFilter = HHV(abs(gapsize), 90) > 0.15; // try different size filters, 0.12 or .18 (12%, 18%, etc)

 

TrendFilter = C < MA(C, 100 ); // only stocks in an uptrend are eligible

 

SP500 = Foreign ("$SPX", "C");

IndexFilter = SP500 < MA(SP500, 200 ); // market regime filter


// I want to be a more "elegant" code writer so I tried this


Exclude = gapFilter or TrendFilter or IndexFilter;


// but I couldn't get that to work, so the filters need to be added in a different way

 

The remaining rules and the "magic" that I think is largely responsible for the outperformance of this stock portfolio is the risk parity position sizing, the rebalancing of position size, and then the rotation.

__._,_.___

Posted by: portfoliobuilder99@gmail.com
Reply via web post Reply to sender Reply to group Start a New Topic Messages in this topic (18)

Check out the automatic photo album with 1 photo(s) from this topic.
EverySecondWeek.PNG

Have you tried the highest rated email app?
With 4.5 stars in iTunes, the Yahoo Mail app is the highest rated email app on the market. What are you waiting for? Now you can access all your inboxes (Gmail, Outlook, AOL and more) in one place. Never delete an email again with 1000GB of free cloud storage.

**** IMPORTANT PLEASE READ ****
This group is for the discussion between users only.
This is *NOT* technical support channel.

TO GET TECHNICAL SUPPORT send an e-mail directly to
SUPPORT {at} amibroker.com

TO SUBMIT SUGGESTIONS please use FEEDBACK CENTER at
http://www.amibroker.com/feedback/
(submissions sent via other channels won't be considered)

For NEW RELEASE ANNOUNCEMENTS and other news always check DEVLOG:
http://www.amibroker.com/devlog/


.

__,_._,___


EmoticonEmoticon