[R-SIG-Finance] Need help with replication of a strategy using 'Quantstrat' & 'IKTrading' packages

Brian G. Peterson brian at braverock.com
Mon Dec 12 23:52:33 CET 2016


On Mon, 2016-12-12 at 23:27 +0530, Adarsh KP wrote:
> I am trying to replicate core strategy (for a single instrument) from
> the book 'Following the trend' by Andreas Clenow. Details about the
> strategy are in the picture in this link (https://drive.google.com/fi
> le/d/0B5GQskyO5V5SVU1SdTFhY2txWEk/view?usp=sharing). I was able to
> add entry indicators, signals & rules, but need help with the exit
> part (6th & 7th bullet points in the picture). Also, I am not able to
> update the portfolio, hence cannot plot performance charts. I would
> be very grateful for your help if you could look into the code
> attached and help me resolve this issue. 

The most efficient way to accomplish this is likely to use a trailing
order.

- Calculate ATR and 3xATR as an indicator
- Chain a trailing exit with prefer='High' and threshold = 3xATR

Regards,

Brian



More information about the R-SIG-Finance mailing list