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

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

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

adarsh paul
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). 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. 


-- 
Best
,

Adarsh KP

Research Associate in Finance,
Indian School of Business (ISB),
Hyderabad, India.
+91-9126140440


_______________________________________________
[hidden email] mailing list
https://stat.ethz.ch/mailman/listinfo/r-sig-finance
-- Subscriber-posting only. If you want to post, subscribe first.
-- Also note that this is not the r-help list where general R questions should go.

Query.R (9K) Download Attachment
Reply | Threaded
Open this post in threaded view
|

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

braverock
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

_______________________________________________
[hidden email] mailing list
https://stat.ethz.ch/mailman/listinfo/r-sig-finance
-- Subscriber-posting only. If you want to post, subscribe first.
-- Also note that this is not the r-help list where general R questions should go.
Reply | Threaded
Open this post in threaded view
|

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

adarsh paul
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.

--
​Best​
,

*Adarsh KP*

Research Associate in Finance,
Indian School of Business (ISB),
Hyderabad, India.
+91-9126140440
<https://www.linkedin.com/profile/view?id=204329912&trk=nav_responsive_tab_profile>

        [[alternative HTML version deleted]]

_______________________________________________
[hidden email] mailing list
https://stat.ethz.ch/mailman/listinfo/r-sig-finance
-- Subscriber-posting only. If you want to post, subscribe first.
-- Also note that this is not the r-help list where general R questions should go.