- ago
Hi,
I am working with the Plot code given in the blog area on options.
I see about a $4 difference between what the strategy sees and what Schwab web site gives.
Below are snips of the quotes and the code in the strategy.
Basically. I am trying to achieve an actual real time number via code.
I am under the impression that while _obars is synthetically generates the value at bars. Count - 1 is an actual quote.
Thanks!





0
230
13 Replies

Reply

Bookmark

Sort
Cone8
 ( 13.47% )
- ago
#1
If you want real option values, then you shouldn't use OptionSynthetic.

If you want better values from OptionSynthetic, then you need to feed it a better estimate of IV. (Since you didn't specify it, the default is 20%.)
0
- ago
#2
What would you suggest using for real option values?
For a good estimate of IV need at least one real option value.
0
- ago
#3
For real option quotes, I tried: _obars = GetHistory(bars, optSym);
(bars SPY 1 min from Schwab)
where optSym = "SPY 07/17/2025 623.00 C"; per Schwab
or optSym = "SPY 250815C00625000"; as generated by SchwabHistorical.Instance.GetOptionsSymbol

In both cases I get:
line 36 exception: Object reference not set to an instance of an object.
To make sure I verified that the following works:
_obars = GetHistory(bars, "AAPL");

Is this a case of
(a) Option naming
(b) Schwab not providing option quotes in this way
(c) What would you recommend?
Thanks!
0
- ago
#4
I just saw en earlier conversation.
Bid/ask is with getGreeks.
This will give me the last bid ask values.
It does not matter that _obars to feed into PlaceTrade is synthetic.
It seems PlaceTrade does not make a buy / stall decision based on _obars
In case the order is for market and not limit..
I use market for quick execution.
It probably just uses it to get the name of the instrument to trade.
0
- ago
#5
Schwab get greeks returns null:
OptionGreek Greek = SchwabHistorical.Instance.GetGreeks(optSym);
DisplayTheGreeks(optSym, greek, WLColor.NeonGreen);

Code and panel (Greeks for ,,,, are null) are attached.




0
Cone8
 ( 13.47% )
- ago
#6
See the F1 Help for Schwab. There are several code examples that work. As is mentioned there, the Schwab provider doesn't return historical option data, but you can get the current IV and apply it to OptionSynthetic. Alternatively, use HV/100 (especially for expired contracts) - but you need to work with the parameters.

IB is the best for historical (intraday only, non expired contracts); you can get a series based on the bid/ask midpoint at all times. Tradier and IQFeed also have historical.
0
- ago
#7
Thanks!
How do I get to F1 Help for Schwab?
Tried Help in WL8.
Not sure where the Schwab context is.

0
Glitch8
 ( 8.03% )
- ago
#8
Type in Schwab in the Help filter box and you should see it.

0
- ago
#9
I was able to access the information: Help/Extensions/Schwab
(Side note: if I enter Schwab in the search box there it comes back with generic info on Schwab.)
Duplicating the Geeks code the result was the same.
I then opened the data manager streaming providers tab, Schwab
Using the test bed and entering SPY 250815C00620000
It came back with awaiting streaming data
With this option name I was able to get OptionsSynthetic.Get History.
1) I am not able to get option quotes from Schwab via WL8
2) Synthetic GetHistory works probably because WL8 calculates it.
My Schwab broker account has trading long options enabled.
Attached is an image of my app at developer.schwab.com.
You have a note on the help page: To receive live greek values it's necessary to have market data subscriptions for both the option and the underlying contract..
The app shows that market data production is enabled.
a) If you think I need to email traderapi@schwab.com, how should I phrase the question?
b) any suggestions are welcome.
Thanks again! Getting close.


0
- ago
#10
On the data manager streaming providers test bed I also tried:
SPY 08/15/2025 625.00 C
With the same result.
This format is from my Schwab brokerage account.,
0
Cone8
 ( 13.47% )
- ago
#11
The Schwab Provider does not return historical or streaming data for options.
Currently, you can get snapshot data from the option chain only.
Forget about the testbed. Read the help and use the code provided there.
0
- ago
#12
Thank you! I will read the code in the help/extensions/Schwab area and test it for option quotes. This options chain path seems to follow the Schwab brokerage web site. Unlike Fidelity or TDA one cannot get direct quotes on options by supplying the name.. You must get the list of options in the chain and read the quote there. Are you by any chance hacking the Schwab UI (as is the case for Yahoo data) to obtain option quotes?

I am now wondering if Schwab (unlike TDA) does not allow trades in options via an API. This would make it like Fidelity. This is why I spent so much time hacking Fidelity UI in a separate non WL6 C# program to do option trades. Fidelity kept changing the UI or its underlying code so every few months it was back to the drawing board.

One great benefit of WL8 is to be able to change brokers, data providers with just about the same code. I will check the Schwab developer site for any hints on option trades. If you have knowledge on this or if it is handy to try, I would appreciate your comments.

Ot looks like, like so many of your users the path seems to lead to IB. I prefer Schwab as they have an office right here. I am in Northern California.

Thanks a bunch!
0
Cone8
 ( 13.47% )
- ago
#13
QUOTE:
I am now wondering if Schwab (unlike TDA) does not allow trades in options via an API.
No wondering required. Only reading.
0

Reply

Bookmark

Sort