Profile Picture

Extend the TickType enum to include more IB ticktypes

Posted By roedies 5 Years Ago
Message
Posted Monday December 03 2012
Can you please have the enum RightEdge.Common.TickType mimic the entries of the enum Krs.Ats.IBNet.TickType of the IB plug-in. Or at least include the option related Ticktypes (BidOption, AskOption, ModelOption , LastOptionOptionImpliedVolatility, HistoricalVolatility) .

Here is the reasoning:

IB offers a lot of specific option data ( Greeks , ImpVolatility,…) in its API.  I would like to capture this info it in my trading strategy and save it in the ticks database. To have that working I need these extra TickTypes from IB captured. So hence my request  to extend the RightEdge.Common.TickType enum to map with the IB enum as defined in Krs.Ats.IBNet.TickType.

 

Here is my line of thought to get a trading strategy use option related data from IB.

 

1) RE extends the enum values in RightEdge.Common.TickType with the above mentioned  specific option related TickTypes. Better, just take all the ticktypes over from IB (Krs.Ats.IBNet.TickType )

                    TickType = RightEdge.Common.TickType;

                     KRSTickType = Krs.Ats.IBNet.TickType;

 

2) I adapt the IB Plug-in to also subscribe to: void client_TickOptionComputation(object sender, TickOptionComputationEventArgs e).

This return a complex set of information with the specific TickTypes I’m requesting. The next thing I need to do is translate this in ticks RE can handle. Ex: by mapping the information to integers in the Size field)

Example
IB Option Field
Example Value
Mapping to RE TickData
e.TickerId
100
RE Symbol ( done by RE)
e.TickType
BidOption
NEW RE TickType = BidOption
e.ImpliedVol
12.121
Size = 1
e.Delta
0.50
Size = 2
e.Gamma
0.20
Size = 3
e.Theta
-0.50
Size = 4
e.Vega
0.01
Size = 5
 
The above logic will transform the complex Optionobject  into 5 RE TickData objects and these will 
subsequently be saved by the standard RE interface into the standard Tickdata DB.
Resulting 5 TickData ticks
Time
TickType
Size
Price
DateTime

BidOption

1
12.121
DateTime

BidOption

2
0.50
DateTime

BidOption

3
0.20
DateTime

BidOption

4
-0.50
DateTime

BidOption

5
0.01

 

During trading and simulation I use these ticks in my strategy like: 

Public override void NewTick(BarData partialBar, TickData tick)

                {

                    if tick.tickType ==  BidOption
                                if (tick.Size== 1) ImpliedVolatility = tick.Price.
      if (tick.Size== 2) Delta = tick.Price.
                                         
                    }


Similar Topics


Reading This Topic


2005-2017 © RightEdge Systems