schwab-py
schwab-py copied to clipboard
Can't move orders in ToS after Schwab migration cause of stopType not set!
Is your feature request related to a problem? Please describe. After migration I noticed order templates were missing stopType which ToS would immedicatly reject if you try to move the order with mouse in a chart! and it wasn't like that with TDA..I noticed error messages in ToS complaining and looked at my old TDA order templates..and I was using stopType=Standard and we are missing that across all orders in schwab migration! After I added it to few of my buy order limit temperates and others sell orders and etc..I recognized that was the issue..and now I also need it across all order types in schwab-py like equity_sell_short_limit and equity_sell_short_market
Describe the solution you'd like add "stopType": "STANDARD" to all templates in schwab py
Describe alternatives you've considered None, u can't move the orders in ToS chart, if stopType is not order templates!
Additional context Ping me back when u put it into build and I can test it right away and let u know if I can drag the order around in the chart or I get a Reject error no stoptype defined!
I could use some more information before I can dig into this: can you share code that illustrates the orders that exhibited this issue, plus code in which this issue is not present?
Also, I'm not familiar enough with TOS to fully understand the issue. Any chance you can share a screen recording of what's happening on the TOS side before/after?
So here is my working sell limit order template that I use:
# working limit order
order_template = {
"session": "SEAMLESS",
"duration": "DAY",
"orderType": "LIMIT",
"stopType": "STANDARD",
"price": mark ,
"orderLegCollection": [
{
"instruction": "BUY",
"instrument": {
"assetType": "EQUITY",
"symbol": symbol
},
"quantity": qty
}
],
"orderStrategyType": "SINGLE"
}
If I remove stopType or if any template order missing stopType , then I can't move the order in ToS . When I attempt to drag the sell limit order up and down the chart, then I get a Reject can't move when stopType is not defined!
So some order that I use templates..I can fix it myself by adding stoptype standard! but I noticed the order api from schwab api like for shorting and cover to buy back that I rely on those api ( equity_sell_short_limit and equity_sell_short_market) , the stop type needs to be set in schwab py build! I suggest to add stoptype standard to all schwab py api orders, cause that's what I have been doing in order types that I can set the stoptype myself in ordertemplates! Hope that helps! Thank you!
Fixed on TOS's side