[R-SIG-Finance] quantstrat with intraday data

G See gsee000 at gmail.com
Thu May 3 15:54:14 CEST 2012


Jim,

So, on any day that there is a dividend or a split, you want to back
adjust your data that you're using to calculate the next signal.
Every time you back-adjust, you have to recreate your signals.  If
that's how you want to do it, then I think that in quantstrat world,
you're better off running multiple backtests (e.g. 1 for each quarter
for a stock that pays quarterly dividends) and gluing them together
instead of adjusting on the fly.  i.e. try to let the quantstrat part
of it be as vectorized as possible.

If there were an addSplit function, it would adjust the quantity of
shares that you own, but last I looked, the order-sizing functionality
of quantstrat was still broken which means that you wouldn't be able
to adjust how many shares you trade going forward.

So, assuming you're using a fixed quantity of shares for your
transactions (which you are unless you patch quantstrat ;-)),
AddCumDiv is like a walk-forward adjustment of price (for dividends,
but you could pre-adjust your data, in a walk-forward manner, for
splits as well).  At the very least, it's pretty good proxy.

HTH,
Garrett

On Wed, May 2, 2012 at 11:19 PM, Jim Green
<student.northwestern at gmail.com> wrote:
> On 3 May 2012 00:07, G See <gsee000 at gmail.com> wrote:
>> If a stock splits in half, don't you think you should adjust for that
>> before performing technical analysis?  You'd treat that big jump in
>> price the same as a real price jump even though if you had a position
>> in the stock, your PnL would be unaffected by the split?
>
> sorry I was unclear... that would generate wrong signals..  I think
> the correct way to use split/dividend adjusted daily data for
> technical analysis is:
> 1, for each day, generate signals using adjusted data till before that
> day, in a walking forward fashion.
> 2, for pnl logistics, use trade based adjustments or position adjustments.
>
> the above are not currently supported by quantstrat and underlying
> blotter but is really a nice to have. is qmao addressing the them in
> some way?
>
> Jim.



More information about the R-SIG-Finance mailing list