Just seen this post.
I am trying to marry a technical analysis overlay to fundamental analysis. I am a subscriber to a newsletter that provides various recommendations that are FA based.
My aim is to use this FA and overlay a momentum strategy to enhance outcomes.
I have a historical record of recommendations from this newsletter and I have been writing an AFL to test ideas. With this historical record I have symbols coming in at various stages and then leaving at a later date. On occasions the same symbol will then rejoin.
Any ideas on code that will allow a trade on a symbol from a certain date, exclude it at a later date and then allow a trade further on.
The above code partially works for new entries and exits, however it doesn't cater for a code which exits and then re-enters.
Also it doesn't give a sell condition for a code that is removed from the FA coverage
Any additional code would be gratefully received - Thanks
Code:switch( Name() ) { case "CCC": datecond = dn <= 1140201; break; case "EEE": datecond = dn >= 1141101; break; default: datecond = true; break; } period = 20; m = MA( Close, period ); Buy = Cross( Close, m ) AND datecond; Sell = Cross( m, Close ) AND datecond; Short = Cover = 0;
Variable dn stands for
Code:dn = DateNum();
I am trying to marry a technical analysis overlay to fundamental analysis. I am a subscriber to a newsletter that provides various recommendations that are FA based.
My aim is to use this FA and overlay a momentum strategy to enhance outcomes.
I have a historical record of recommendations from this newsletter and I have been writing an AFL to test ideas. With this historical record I have symbols coming in at various stages and then leaving at a later date. On occasions the same symbol will then rejoin.
Any ideas on code that will allow a trade on a symbol from a certain date, exclude it at a later date and then allow a trade further on.
The above code partially works for new entries and exits, however it doesn't cater for a code which exits and then re-enters.
Also it doesn't give a sell condition for a code that is removed from the FA coverage
Any additional code would be gratefully received - Thanks