♥ 0 |
Thank you so much for the great site! It has helped me so much as I work to pick up thinkScript. I have a strategy programmed that I’d like to use as an options buying strategy, but the strategy is actually based upon and applied to the movement of the underlying stock. Is it possible to create a strategy for the underlying stock (applied to its chart), but access ANY options data when it comes time to add an order in the strategy? Ultimately, when it comes time to add the order in the strategy, all I want to do is grab the Theo Price of one of the options with a strike price that is close to the current price of the underlying stock. The motivation here is that I’m just trying to track P/L based upon price of the option purchased/sold, as opposed to the underlying stock itself. Is it possible to retrieve this data from a strategy that is applied to the underlying stock? Or worst case, try estimate the price of the option when it comes time to add the order?
Marked as spam
|
Private answer
The chart strategy tool only works on the ticker symbol loaded onto the chart. At this point I have not found a way to build a chart strategy in Thinkorswim that can trade options for the underlying in place of the underlying itself. In fact I have never even seen this done for any trading platform. The solution is so complex that it requires a team of software developers to complete. Market Makers certainly have access to these tools. If you find a system that can do this, expect to pay several thousand dollars.
We have limited tools available in a scripting language to begin with. Furthermore, the Thinkorswim language provides a limited number of built-in functions used to work with options data within the context of a chart study or strategy. In the case of getting the current ATM option, have a built-in function named "GetATMOption()" https://toslc.thinkorswim.com/center/reference/thinkScript/Functions/Option-Related/GetATMOption One of the required input parameters of this function is "Expiration Date". So it is much more than a matter of getting the ATM option, you need to tell the code the exact expiration date. Which for regular weekly and monthly options in the U.S. markets is the Saturday after the Friday of expiration. Once again we run into limitations within the Thinkorswim language. There are no tools in the language that can automatically generate an expiration date that can by used as the input to the GetATMOption() function. Any chart strategy that would attempt to do this would require a list of expiration dates to be used for each month (or week) that the strategy is trying to plot theoretical buys and sells. That list would need to be hard coded into the script or provided as user inputs that would be manually adjusted as needed. Additional logic would need to be added to the chart strategy to tell the code which of those manually input expiration dates to use for any given portion of the historical data on the chart. For each theoretical buy/sell on the chart there will be no way of knowing which option the strategy selected. The strategy is very likely to buy one and sell another. Busted and broke, right there. Sorry but I have already spent more time on this than I allow for solutions in the Q&A forum. I have just explained this in sufficient detail to explain just one of many dead-ends when trying to crack this problem. Hopefully this will suffice in convincing folks how incredibly challenging this is. Manually selecting an ATM option is a very complex process. We take it for granted after we have worked in this environment for some time. Most of the time you are looking through the list of expirations to locate the ATM option that has the ideal characteristics such as the Implied Volatility, Historical Volatility, Delta, Bid/Ask spread, volume and open interest (and many others). If you are not checking all of these things each time to buy an ATM option you are missing the mark. How do you write the code so that it can evaluate each of these elements to select the expiration date that is ideal according to your goals and trading methodology? The enormous complexity of these selections is why it takes a team of developers to construct code that can properly evaluate this vast array of data points and at the same time adapt to various conditions and trading methodologies. Marked as spam
|
|||||||||||
Private answer
I'm an idiot. I've been looking for articles for a week. And right after posting this, I see that there are multiple options related functions in thinkScript to return what I believe I'm asking for. Examples: GetOption() Rather than delete my question, I thought I'd leave this answer here for others that may also be interested in a similar approach. Your site is awesome.... thank you so much again! Marked as spam
|
Please log in to post questions.