[R-SIG-Finance] Dealing with multiple series which are not exactly same w.r.t date/time
Brian G. Peterson
brian at braverock.com
Wed Jul 27 12:02:05 CEST 2011
You've reposted with a new subject:
"Dealing with multiple series which are not exactly same w.r.t
date/time"
On Wed, 2011-07-27 at 03:59 -0500, Brian G. Peterson wrote:
> On Wed, 2011-07-27 at 10:18 +0530, Subramanian S wrote:
> > Pardon me if the question has been already posed.
>
> Your subject "Get option prices of first and expiry date alone" doesn't
> seem to match the rest of your email.
>
> To deal with your subject, I would simply extract the dates of the
> 'first' and 'expiry' from your instrument metadata, then look up these
> dates in your data. On the first day a derivatives contract is
> available to trade, you'll often find no trades or extremely wide
> markets, or both, so I question the *premise* of your subject.
>
> > what is the correct thing to do while dealing with multiple time series that
> > are not synchronized?:
> > A) remove rows from all series for dates in which one of the series does not
> > have a value OR
> > B) do some kind of an interpolation of values for these dates.
>
> or
> C) deal with the fact that real data aren't synchronized, are messy, and
> don't match the textbook examples the vast majority of the time.
>
> I plot and backtest data with missing values all the time, because that
> is how real financial data works. If you're trying to create a trading
> system, you need to account for the structure of real data.
>
> > My understanding: if i were doing a theoretical study, or just wanting to
> > plot the multiple time series, the latter would be correct but if i
> > am doing a portfolio/ trading system back testing, the latter wouldn't be
> > technically correct. Would like to have more clarity.
>
> Now, if we wanted to connect the subject of your email to the rest of
> your email....
>
> I could propose an example:
>
> Strategy Idea:
> I have multiple option series, and I'm interested in figuring out
> if I should buy that option on the first day it is available for
> trade, and at what price.
> Problem:
> data is messy, and is often missing values on that first day
> Opportunity:
> use the prices from other more liquid options, plus decay,
> to establish a theoretical price for every other option
> Task:
> build a trading system that uses the *implied* price to
> buy options on the first day, see if we make money at expiry.
>
> Or something like that...
I'm not sure that your new subject changes my answer much, though it
does make my hypothetical strategy unnecessary.
Missing data is still a fact of life in real data series. merge() and
cbind() are your friend in xts, they'll align all the data to a common
merged index.
Your hypothesized trading system will be placing orders based on some
price you come up with, probably still implied from other market prices,
as above. It isn't necessary to have a traded price, as long as there
is a market. Then, if your trading system's price crosses the bid/offer
that other market participants had in the market, you could assert that
you had traded for the purposes of your backtest.
This does raise other issues though. I know that many people seem to
prefer to backtest systems on daily data. This is more or less fine for
multi-day holding periods on highly liquid instruments, where if your
limit price was between the high and low, you can presume that you were
filled. With illiquid instruments, especially those that have no trades
in the time frame you're looking at, I think you really need to be
dealing with bid/offer data, which likely means intraday data, rather
than daily trade prices only.
Another conservative assumption you could make is that if there were no
trades in the market, you couldn't have gotten any either. A related
assumption is that your trading system can only make up x% of the daily
volume. These assumptions or constraints protect you from believing
that you are going to successfully trade against the big firms that are
very good at 'getting out of the way' when a less sophisticated market
player starts bumbling around in the markets. Almost the best case for
you when this happens is that you don't trade, often you end up with
'bad fills' and slippage.
Regards,
- Brian
--
Brian G. Peterson
http://braverock.com/brian/
Ph: 773-459-4973
IM: bgpbraverock
More information about the R-SIG-Finance
mailing list