<div dir="ltr"><div class="gmail_default" style="font-family:georgia,serif"><div class="gmail_default" style="font-size:12.8px">Dear All,</div><div class="gmail_default" style="font-size:12.8px"> </div><div class="gmail_default" style="font-size:12.8px">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 (<u><a href="https://drive.google.com/file/d/0B5GQskyO5V5SVU1SdTFhY2txWEk/view?usp=sharing">https://drive.google.com/file/d/0B5GQskyO5V5SVU1SdTFhY2txWEk/view?usp=sharing</a></u>). 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. </div><div class="gmail_default" style="font-size:12.8px"><br></div><div style="font-family:arial,sans-serif;font-size:12.8px"><br></div><span style="font-family:arial,sans-serif;font-size:12.8px">-- </span><br style="font-family:arial,sans-serif;font-size:12.8px"><div class="gmail-m_6637268672892792061gmail_signature" style="font-family:arial,sans-serif;font-size:12.8px"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><span style="font-size:small"><font face="georgia, serif" color="#000000"><div class="gmail_default" style="display:inline">Best</div>,</font></span></div><div dir="ltr"><span style="font-size:small"><font face="georgia, serif" color="#000000"><br></font></span></div></div></div></div></div></div></div></div></div></div><div class="gmail_signature"><div dir="ltr"><div><div dir="ltr"><div><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div><font face="georgia, serif" color="#000000" size="2"><b>Adarsh KP</b></font><div><font face="georgia, serif" size="4" color="#000000"><b><br></b></font><div><font face="georgia, serif" color="#000000" size="1">Research Associate in </font><span style="color:rgb(0,0,0);font-family:georgia,serif;font-size:x-small">Finance,</span></div><div><span style="color:rgb(0,0,0);font-family:georgia,serif;font-size:x-small">Indian School of Business (ISB),</span></div><div style="font-size:12.8px"><div><font face="georgia, serif" color="#000000" size="1">Hyderabad, India.</font></div><div><font face="georgia, serif" color="#000000" size="1">+</font><font color="#000000" size="1" face="arial, helvetica, sans-serif">91-9126140440</font><font face="georgia, serif" color="#000000" size="1"><br></font></div></div><div><a href="https://www.linkedin.com/profile/view?id=204329912&trk=nav_responsive_tab_profile" style="font-size:12.8px" target="_blank"><img src="http://cnt.in.bookmyshow.com/mailers/images/footer110814/linkin.png" style="color: rgb(0, 0, 0); font-family: georgia, serif; font-size: small;"></a></div></div></div></div><div dir="ltr"><div><div><font color="#000000" size="1" face="arial, helvetica, sans-serif"><br></font></div></div></div></div></div></div></div></div></div></div></div></div></div>
</div><div hspace="streak-pt-mark" style="max-height:1px"><img style="width:0px;max-height:0px;overflow:hidden" src="https://mailfoogae.appspot.com/t?sender=aYWRhcnNocGw3QGdtYWlsLmNvbQ%3D%3D&type=zerocontent&guid=fb28eccc-d5f7-4704-a864-aab863df01e3"><font color="#ffffff" size="1">ᐧ</font></div>