Skip to content

Need help with replication of a strategy using 'Quantstrat' & 'IKTrading' packages

3 messages · Brian G. Peterson, Adarsh KP

#
Dear All,

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/file/d/0B5GQskyO5V5SVU1SdTFhY2txWEk/view?usp=sharing
<https://drive.google.com/file/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.
#
On Mon, 2016-12-12 at 23:27 +0530, Adarsh KP wrote:
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
#
Dear Brian,

Thank you very much for your suggestion. I will do that now. Also, my
portfolio is not getting updated despite using 'updatePortf' & 'updateAcct'
functions. Could you please look into the code and tell me what went wrong.
I started using this package a week ago. So I may sound naive, please don't
mind.