[R-SIG-Finance] Blotter - Setting up a futures_series

Brian G. Peterson brian at braverock.com
Thu Apr 29 13:21:36 CEST 2010


On 04/29/2010 02:15 AM, Wolfgang Wu wrote:
> Understood.
>
> But in order to mark the book at some point you will need historical data of the contracts. How is the link from the contract specifications, using the future() and future_series() functions to the actual
> historical data. What would be the equivalent to the example of a stock like this:
>
> #Defined the stock as financial instrument
> stock("GSPC",currency="USD",multiplier=1)
> #Get the historical data for variable with name "GSPC"
> getSymbols('^GSPC', src='yahoo', index.class=c("POSIXt","POSIXct"),from='1998-01-01')
>
> Assuming I have the time series for CLM9 and CLN9 in an xts format
>    


FinancialInstrument uses an underscore to separate the root symbol 
(primary_id) from the series symbol (suffix_id).  In your example, this 
means that your historical contract series data should be named

CL_M9
CL_N9

So that the blotter code can find them (blotter follows the quantmod 
convention of naming market data for the instrument)

you can see this by doing

ls(pos=.instrument)

which will show you the environment where the instrument definition 
objects are kept.

Regards,

   - Brian


> CLM9
>              Open  High   Low Close Volume OpenInterest
> 2009-03-23 54.28 55.92 53.57 55.73  78959       187205
> 2009-03-24 55.50 55.70 54.38 55.63  75464       190182
> 2009-03-25 55.35 55.58 53.50 54.19 119624       198422
> ...
> 2009-05-19 59.16 60.48 58.55 59.65  40957         1838
>
> and
>
> CLN9
>              Open  High   Low Close Volume OpenInterest
> 2009-04-22 50.95 51.14 49.72 50.70  95249       178023
> 2009-04-23 50.38 51.38 50.09 51.07  90781       181605
> 2009-04-24 51.13 53.09 50.40 52.94  70061       187690
> ...
> 2009-06-22 69.89 69.89 66.25 66.93  32070         4299
>
> Regards,
>
>
>   Wolfgang Wu
>
>
>
> ----- Ursprüngliche Mail ----
> Von: Brian G. Peterson<brian at braverock.com>
> An: Wolfgang Wu<wobwu22 at yahoo.de>
> CC: R SIG Finance<R-SIG-Finance at stat.math.ethz.ch>
> Gesendet: Donnerstag, den 29. April 2010, 0:28:48 Uhr
> Betreff: Re: [R-SIG-Finance] Blotter - Setting up a futures_series
>
> Wolfgang Wu wrote:
>    
>> Hello,
>>
>> I am playing around with blotter and am trying to set up several futures contracts. So assume I've got data for the crude oil future CL. I want to set up futures for the June 09 and July 09 contract.
>> What I've done is the following:
>>
>> currency("USD", multiplier=1);    future("CL", "USD", 1000, identifiers=c("CLM9", "CLN9"))
>> future_series("CL", "M9", "2009-03-23", "2009-05-19")
>> future_series("CL", "N9", "2009-04-22", "2009-06-22")
>>
>>
>> 1.) How do I link the future to the future_series? I assume this is by using the primary_id, correct?
>>      
> correct
>
>    
>> 2.) What do I specify in the identifiers in the futures function?
>>      
> anything or nothing at all.  identifiers are for other symbols, e.g. Bloomberg, Reuters, etc.  In your example, I would probably not add identifiers to the main contract.
>
>    
>> 3.) What is the multiplier in the future mean? Is it the value for one tick or for one point? So for oil one tick is 10 USD and one point move is 1000 USD.
>>      
> 'point value' in your terminology.  It is used to get from the price to the notional value in the listed currency.  I'll probably add tick value to the model later this week.
>
>    
>> Thanks!!!
>>      
> You're welcome.
>
> Regards,
>
>     - Brian
>
>    
>> Wolfgang Wu
>>
>>
>>
>> _______________________________________________
>> R-SIG-Finance at stat.math.ethz.ch mailing list
>> https://stat.ethz.ch/mailman/listinfo/r-sig-finance
>> -- Subscriber-posting only. If you want to post, subscribe first.
>> -- Also note that this is not the r-help list where general R questions should go.
>>      
>
> -- Brian G. Peterson
> http://braverock.com/brian/
> Ph: 773-459-4973
> IM: bgpbraverock
>
>
>
>    


-- 
Brian G. Peterson
http://braverock.com/brian/
Ph: 773-459-4973
IM: bgpbraverock



More information about the R-SIG-Finance mailing list