- ago
OK, new error - I switched from the Dummy account to a live trading account and I am still running into the cancellation error on the MOC trades. I get the error below on the OM. Could it be that I'm trying to use an MOC in the hourly timeframe?


"TD Ameritrade Broker: Exception Getting Orders: Cannot deserialize the current JSON object (e.g. {"name":"value"}) into type 'System.Collections.Generic.List`1[WealthLab.TDAmeritrade.TDOrder]' because the type requires a JSON array (e.g. [1,2,3]) to deserialize correctly.
To fix this error either change the JSON to a JSON array (e.g. [1,2,3]) or change the deserialized type so that it is a normal .NET type (e.g. not a primitive type like integer, not a collection type like an array or List<T>) that can be deserialized from a JSON object. JsonObjectAttribute can also be added to the type to force it to deserialize from a JSON object.
Path 'error', line 3, position 16.

{
"error":"The access token being passed has expired or is invalid."
}"
0
302
4 Replies

Reply

Bookmark

Sort
- ago
#1
Just to explain, this topic is a followup of another thread which has grown too big with various unrelated questions: https://www.wealth-lab.com/Discussion/9900
1
Cone8
 ( 24.10% )
- ago
#2
Not enough info here, but we've already discussed MOC orders with the intraday script.

For now, I'll assume this was an attempt to cancel an MOC order in the last 5 minutes of the session. You can't do that. We can look into handling that error better, but we'll probably wait for Schwab before spending time on an error that you can avoid (with programming).
0
Glitch8
 ( 12.85% )
- ago
#3
The error I see is that the access token has expired.
0
Cone8
 ( 24.10% )
- ago
#4
That's only because you read everything and didn't jump to conclusions! :)

This error looks to have occurred in the history request - but the first thing we do when the request starts is check the access token and refresh it, if required. I'm not sure how the token could have expired without having been refreshed, but we'll look to see if there's a path for that.
0

Reply

Bookmark

Sort