- ago
A 1min auto-trade strategy appears to obtain miss-quotes on filled transaction price for TDA orders. I have seen this twice today (pic below); stopped auto-trade and re-started followed by correct fill data. After a while the difference starts again.

Timing of the order fill is CET (EST +6hr). As you can see from the 1min chart below, SQQQ was at 57 at 10:24 est; and not 56.22 in order manager.

TDA's actual trade history shows 56.96 (fortunately).

A backtest of the strategy shows exit price at 57.08 based on TDA 1-min data.

Is the fill price in order manager supposed to match the actual transaction price?
Thank you




1
464
11 Replies

Reply

Bookmark

Sort
Glitch8
 ( 7.81% )
- ago
#1
It's supposed to.

TD returns fill price is a collection of "Execution" objects, using the layout below. WL8 calculates the overall fill price by looping through the "executionLegs" of the "Execution", and creating a sum of the fill amount of each one (quantity * price) and then dividing that amount by the total quantity in the "executionLegs."

It seems from your findings though that this isn't producing the correct fill price?
0
Glitch8
 ( 7.81% )
- ago
#2
0
- ago
#3
here is another transaction, the fill price at 55.83 doesnt come anywhere close to the chart . TDA trade history shows 54.3999

0
- ago
#4
0
Glitch8
 ( 7.81% )
- ago
#5
Can you see from TD or TOS if these orders had partial fills? Perhaps we are not interpreting these executionLegs correctly. We can add some logging here and try to catch a partial fill and scrutinize what TD is providing to shed some light on this.
0
- ago
#6
confirming the order had just 1 leg in both cases.
0
- ago
#7
just a quick update - there have been other sell orders in the meantime, with no significant price difference. I know this makes it no easier but thought I'd let you know it is not a generalized issue - thank you
0
Cone8
 ( 24.56% )
- ago
#8
QUOTE:
with no significant price difference.
There should be no difference in w.r.t. the total fill price. Are you still seeing this?

fwiw, I traded both odd and full lots (about a dozen trades) this week and every time the fill price show in Wealth-Lab was precisely the correct.
0
Cone8
 ( 24.56% )
- ago
#9
I just happen to have an example from one day, while testing LOC orders....



DOCU didn't fill because it settled below the limit. (Sold it the next day at MOO for 69..91)
0
- ago
#10
Thanks for the follow up. Haven't seen the issue repeating so far, then again seeing a TDA update with B14, thought you might have tweaked and improved the interface.
Without further knowledge -- is it possible the issue appears when data comes delayed from TDA (ie temporary internet issues)? if you look at initial pics (#1, #4) it would appear the miss-match comes from a lag
0
Cone8
 ( 24.56% )
- ago
#11
Data lag alone wouldn't explain it. Like Glitch showed in Post #2, there's a JSON summary of all the trading for the last day(s). As I recall, we loop through that list and synchronize a WL trade to one of the Execution objects.

Probably the explanation is that we synchronized with the wrong trade - there's a chance that delayed data played a part in that... maybe??? I really don't know.

Edit -
It would be hard (impossible?) for synchronization to find the wrong order because the OrderId saved by Wealth-Lab has to match one in the response.
0

Reply

Bookmark

Sort