td-ameritrade-client icon indicating copy to clipboard operation
td-ameritrade-client copied to clipboard

Order.getStatus() returns null

Open FreeGoldRush opened this issue 4 years ago • 3 comments

Immediately after calling client.placeOrder() a call to order.getStatus returns null. This is unexpected. Shouldn't it return a Status instance? The call to placeOrder() places an order and seems to work as expected.

FreeGoldRush avatar Jul 07 '20 12:07 FreeGoldRush

Yeah. That’s how it works in the integration tests. Can you try and sleep for a few seconds and then call the getStatus? Maybe TDA has a synchronization delay between their internal servers.

On Tue, Jul 7, 2020, at 07:30, FreeGoldRush wrote:

Immediately after calling client.placeOrder() a call to order.getStatus returns null. This is unexpected. Shouldn't it return a Status instance? The call to placeOrder() places an order and seems to work as expected.

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/studerw/td-ameritrade-client/issues/20, or unsubscribe https://github.com/notifications/unsubscribe-auth/ABQHJA42L2QXGD2LO4CDVE3R2MIOXANCNFSM4OSYR2BQ.

studerw avatar Jul 07 '20 14:07 studerw

@FreeGoldRush Did the sleeping for a few seconds solve your problem?

studerw avatar Jul 13 '20 21:07 studerw

Sorry, have not tried it yet. Sleeping isn't an option. I'll probably just create a Thread that checks order status every 250 ms or something until it gets a valid value.

FreeGoldRush avatar Jul 14 '20 14:07 FreeGoldRush