title: R Statistics: Average True Range Trailing Stop indicator
body: <p>I am using the following article:</p>
  
  <p><a href="http://marintrading.com/106VERV.PDF" rel="noreferrer">marintrading.com/106VERV.PDF</a></p>
  
  <p>to create the Average True Range Trailing Stop indicator in R.  I have tried various ways to do this, including for loops, pmin and creating a lagging time series, and nothing seems to work.  </p>
  
  <p>Could you help me out please?</p>