TD Ameritrade API Questions

I have found that to be true. I'll ask the others.
We have written to the TDA API and are bringing in positions to our risk system if you have any other questions.
3e3d386edaf623aa59d0e969b2c3344c.png

https://gyazo.com/3e3d386edaf623aa59d0e969b2c3344c
 
  • Like
Reactions: ETJ
I have found that to be true. I'll ask the others.
Thx for confirmation.
In AT I'm going to use cashAvailableForWithdrawal over (or instead of ) cashAvailableForTrading to simplify the program logic... But this of course means not making any use of the possibilities of the "unsettledCash" (ie. opening new positions allowed, but not closing during the T+1/T+2 settlement period).
Maybe will optimize this logic sometime later.

We have written to the TDA API and are bringing in positions to our risk system if you have any other questions.
Thx, I'm so far fine with the TDA API.
 
When placing an order one can specifiy ALL_OR_NONE
( https://developer.tdameritrade.com/account-access/apis/post/accounts/{accountId}/orders-0 )
What does the other setting, DO_NOT_REDUCE, mean?
Code:
"specialInstruction": "'ALL_OR_NONE' or 'DO_NOT_REDUCE' or 'ALL_OR_NONE_DO_NOT_REDUCE'",
It seems it has to do with Ex-Div as described here:
https://www.investopedia.com/terms/d/dnr.asp
I just wonder whether it also applies to options orders.

One thing I don't understand is this:
I'm using ALL_OR_NONE, but sometimes I get response messages that say that the total Qty was filled in multiple parts (hence multiple messages for each filled part). Isn't that illogical with AON?
 
The API function GetQuote / GetQuotes ( https://developer.tdameritrade.com/quotes/apis/get/marketdata/quotes ) gives such volatility values for the ticker:
AMD: "volatility": 0.0152,
INTC: "volatility": 0.0208,

How to interpret these values? Multiplying by 100 gives a HV of just 1.5 and 2.0 respectively.
This of course can't be true.
Or has it to be multiplied by 1000 ? Since when & why?

I'm also missing a MA value in the quote data, for example a 20 day or so moving average for spot.
 
Last edited:
The API function GetQuote / GetQuotes ( https://developer.tdameritrade.com/quotes/apis/get/marketdata/quotes ) gives such volatility values for the ticker:
AMD: "volatility": 0.0152,
INTC: "volatility": 0.0208,

How to interpret these values? Multiplying by 100 gives a HV of just 1.5 and 2.0 respectively.
This of course can't be true.
Or has it to be multiplied by 1000 ? Since when & why?

I'm also missing a MA value in the quote data, for example a 20 day or so moving average for spot.

Probably it's daily (based on trading days only). So, assuming that's true, and since "volatility" in the retail options world is really an sd (or square root of "volatility" in the statistics world), convert this daily value to yearly by multipling it by sqrt(252), 252 being approx. the number of trading days per year.

TDAmeritrade's API, while not horrible by historical standards, is perhaps the worst offered by a major broker today.

More importantly, they may fire you as a "client" if you are highly profitable using the API -- instantly, for life, and refusing any explanation whatsoever.

Their true clients are the wholesalers (especially Citadel, but a handful of other oligopolistic actors as well), and they don't like it when you eat their lunch on a regular basis.
 
Last edited:
ORATS is starting a beta trial of our Dashboard product using the TDA API. You can use the scanners, options chain, and positions tab to identify trades and execute through TDA. Email me in the signature if you want to join the beta.
 
Probably it's daily (based on trading days only). So, assuming that's true, and since "volatility" in the retail options world is really an sd (or square root of "volatility" in the statistics world), convert this daily value to yearly by multipling it by sqrt(252), 252 being approx. the number of trading days per year.
It somehow does not fit: for example AMD:
0.0152 * 100 * sqrt(252) = 24.1292
0.0152 * 100 * sqrt(365) = 29.0395

The following expert site on volatility (IVolatility / OCC) gives much different (twice higher) HV values:

AMD_HV_etc.png
 
Last edited:
It somehow does not fit: for example AMD:
0.0152 * 100 * sqrt(252) = 24.1292
0.0152 * 100 * sqrt(365) = 29.0395

The following expert site on volatility (IVolatility / OCC) gives much different (twice higher) HV values:

View attachment 316656
Yeah, the INTC historical volatility was closer to the mark I'd say.

In any event, I would not trust TDAmeritrade's API to pick my sock color in the morning not to mention provide important financial data off of which to trade, and there are an infinite number of ways to calculate historical volatility anyway, so if you want the "best answer" for you, you probably need to compute your own from a high-quality data source on the underlying. Or find a source you can trust that also provides real documentation of their method.
 
  • Like
Reactions: spy
Back
Top