Back

Option Data - Timestamp on Price / Underlying Last Price

Hi,

Is there any chance we can get the timestamp data for when the option trade was and when the underlying last price was?

If this is too specific, perhaps just a relative timestamp? 

I am trying to look at reducing some noise in the price of some complex structures which are somewhat sensitive. Even in minute resolution, if the price of the underlying moves between one option leg trade and another, the resulting complex trade price can be distorted very significantly. 

Using a relative timestamp to try and reduce the odds of this happening could be very useful.

As far as implementation, I'd think adding DateTime to the contract would be best: UnderlyingLastTime and LastTime? 

Or a relative time decimal in seconds, TimeBetween?

 

Thanks

Update Backtest







0

The material on this website is provided for informational purposes only and does not constitute an offer to sell, a solicitation to buy, or a recommendation or endorsement for any security or strategy, nor does it constitute an offer to provide investment advisory services by QuantConnect. In addition, the material offers no opinion with respect to the suitability of any security or specific investment. QuantConnect makes no guarantees as to the accuracy or completeness of the views expressed in the website. The views are subject to change, and may have become unreliable for various reasons, including changes in market conditions or economic circumstances. All investments involve risk, including loss of principal. You should consult with an investment professional before making any investment decisions.


Option contract object has properties

1) UnderlyingLastPrice: Gets the last price the underlying security traded at  

2) Time : Gets the local date time this contract's data was last updated 

In OnData(Slice slice), you can get the slice time of the underlying with slice[underlying_symbol].Time

if slice.ContainsKey(Underlying_symbol))

{

var time = slice[underlying_symbol].Time

}

0

So.. follow up question - minute resolution. Is contract.underlyinglastprice the last price the underlying traded at within the minute, or the last price the underlying traded at before the contract was traded?

Sequence of events, ABC and ABC Option

12:01:15 - ABC trades at 100

12.01:16  - ABC Option trades at 1.00

12:01:59 - ABC trades at 101

 

It looks like UnderlyingLastPrice is set to the Close Price based on a quick check, or in this example 101, which is a bit unfortunate. It would be more useful I think if it were set to 100 - though I'm not sure if it's possible for you, depending on how you get the data. It would be best if the contract could contain a snapshot of the underlying at the time of the trade (including bid/ask), if possible. If a most recent underlying price and the time of that is all that's possible, that would also be better.

What underlying price is the theoretical price/Greeks calculated from? Also the close price? 

0

With the minute resolution, contract.UnderlyingLastPrice is the last price the underlying traded at within the minute (the underlying asset closing price of the minute bar).  To get the underlying price when the contract order is placed, you can save the price with a variable like "self.underlyingPrice = self.Securities[underlying_symbol].Price" when you place the order over the option contract.

Greeks are calculated with the close price of the underlying asset. 

https://github.com/QuantConnect/Lean/blob/de9429320aadd8003031557492d0ec9fda4aa289/Common/Securities/Option/QLOptionPriceModel.cs#L93
0

So, right now contract.UnderlyingLastPrice is effectively duplicating the data you can find in the trade bar.

While using the order function to capture the underlying price during execution is possible, it's also very awkward - I don't really want to order every time a contract I'm looking at is executed in order to get a clear idea of extrinsic/intrinsic values. 

Is it possible to alter the functionality of contract.UnderlyingLastPrice to do that, or create a new value that would?

Personally, I think the price at time of sale is way more valuable than the price at minute close. Typically, they would be close, but when it's not it creates a vary large disconnect in price especially for short-dated options and spreads. I'm fairly certain this is one source of noise causing some issues for me (I'm occasionally getting negative or close-to-zero spread prices for Calendar spreads, which should never be zero and given how close to ATM they are, should not be very close). I have a couple of other innacuracies I have to clean up, but missing this key data point is a bit crippling.

0

Update Backtest





0

The material on this website is provided for informational purposes only and does not constitute an offer to sell, a solicitation to buy, or a recommendation or endorsement for any security or strategy, nor does it constitute an offer to provide investment advisory services by QuantConnect. In addition, the material offers no opinion with respect to the suitability of any security or specific investment. QuantConnect makes no guarantees as to the accuracy or completeness of the views expressed in the website. The views are subject to change, and may have become unreliable for various reasons, including changes in market conditions or economic circumstances. All investments involve risk, including loss of principal. You should consult with an investment professional before making any investment decisions.


Loading...

This discussion is closed