Skip to content
Prev 13751 / 15274 Next

stoptrailing mechanics question in MACD example - Quantstrat

Hi Joshua,

Thank you for that reply. I will take a look at that. But what you
explained seems to be the conditions I found by digging into the order
book and order update logic. The confusing part for that was using the
OHLC data and mixing the close price as a "filter" rather than just
highest high lowest low. Also for the fills as well, as a close below
the stop limit order is not really realistic. As you can be filled by
the low of the day and still have the close above (high of the day and
close below for a short), in reality you would have obtained a fill in
the market. This is assuming that the stoptrailing order is in the
market as it executes at the limit price. But in the back test you
would still be maintaining a position as the order would not be
filled. This leads to some disparity in the results as only winners
would not be filled and continue higher but any losers would be cut
off properly. When in reality both would have been closed. I believe
this backtesting behavior biases the returns upwards when using the
stoptrailing order.

Thanks again,

Derek
On Sat, Mar 12, 2016 at 11:26 AM, Joshua Ulrich <josh.m.ulrich at gmail.com> wrote: