- ago
I am testing live auto-trading with TDA using API. Works very well except I've hit a snag.

One of my strategies sets a Sell Stop Loss combined with a Sell Stop Limit for the second day holding a trade. TWA handles this "stacked" trade properly, but on some symbols. I've had the Stop Loss leg rejected by brokerage because the Stop price was below the Bid Price. (This is a daily trade placed in post / pre market hours).

The reason the Bid price was so low was a combination of being outside trading hours, and probably low liquidity on the symbol. I talked to TDA about whether there was a setting I could change to remove the restriction but apparently there is not. This is not an issue with the API as I am not able to get this trade accepted using ToS either.

I've been trying to think of a workaround but haven't been able to come up with one. I don't think I can use the AssignAutoStopTargetPrices method because I want to place this Stop Loss on an active position starting the second day holding, and my understanding is that this method only applies when the trade is initially placed.

BTW, BI/TWS has no such limitation on a Stop Loss and handled it perfectly.

Any ideas to work around this programmatically for TWA?
0
490
2 Replies

Reply

Bookmark

Sort
- ago
#1
If the price is already past your stop in either direction then that is simply a limit or market order, why don't you have a check to see if the price is outside the stop and just place a regular order for EXT hours instead of a stop that will be rejected?
0
- ago
#2
1. Because that is not how the strategy works
2. Because the aftermarket price is artificially low
0

Reply

Bookmark

Sort