Trading options in demo version
The strategy sells out-of-the-money puts for a premium. Loading Option Quotes Before we can simulate any strategy, we need to have quote data available. To do so, you will need to create a data source descriptor as described here. For this demo, we go a different trading options in demo version TuringTrader includes a generator for 'fake' quotes, calculated from SPX and VIX using the Black-Scholes model included in our option support package.
While these quotes won't be a precise mirror of the markets, they still capture the overall vibe. We can do so, using LINQ.
Selecting an Option Contract First, we probably want to create a list of available expiry dates. Abs o.
OptionStrike - FirstOrDefault ; Now that we have an Instrument for the contract to trade, everything else is coded just like we showed for trading stocks. Putting Everything Together Our demo strategy includes a few more bells and whistles.
In particular: only consider options expiring on the 3rd Friday of the month calculate strike price based on volatility close position, if the option contract held is at risk of expiring in the money position sizing based on margin rules Please find the full source code in our repository.
TuringTrader is assuming the options traded to be cash-settled and European-style, which has significant consequences: assignment of American-style options will not be modeled accurately stocks added or removed from the portfolio through option exercise will be replaced with a cash transaction for the same amount Because of these simulator limitations, it is imperative to watch the extrinsic value of any short option positions closely, when trading American-style options.
If an early assignment occurs, the simulator results will be inaccurate.