Current location | Thread information | |
![]() ![]() ![]() ![]() ![]() ![]() |
Last Activity 6/17/2025 3:19 PM 28 replies, 1660 viewings |
This thread is frozen and closed to further discussion |
|
Printer friendly version |
^ Top | ||
James S![]() Regular ![]() ![]() Posts: 62 Joined: 6/21/2007 Location: Dorset, England ![]() | Using the new TMS profile with IB and OT is not able to handle the partial exit trade plan. OT is able to sell the correct amount of shares in IB so that 25% of the position remains, however the next day when I run the 'To Do List', I get the following error: 'Trade Plan for Symbol does not match the quantity with the brokers position. Please re-apply a trade plan'. The trade then needs to be manually managed until exit which could be weeks later, far from ideal.. ![]() | |
^ Top | ||
Buffalo![]() Elite ![]() ![]() Posts: 603 Joined: 7/11/2007 Location: Braintree, MA ![]() | James FWIW Using OT PR2H with AT running live automated trading with IB connected. NOT TMS profile but a personal highly adapted version of RS Boost (where I added T21 in it's own market state among other customizations) After looking at the TMS video where Jeff described the positive difference the partial exit TPs made I looked at my live trading profile and changed some of my trade plans to do just that. There have been at least 10 trades where it has come into play (75% exited, 25% remained) and OT/AT/IB are all handling it perfectly. Some trades still in play, a few the 25% exited. All according to the TP. NO errors [Edited by Buffalo on 7/27/2021 1:34 PM] | |
^ Top | ||
Buffalo![]() Elite ![]() ![]() Posts: 603 Joined: 7/11/2007 Location: Braintree, MA ![]() | Also FWIW Instead of manually managing the trade for those orphan 25% trades right click on the blue "L" on the RH edge. You can remove or edit (possibly fix - maybe just #shares is messed up?) the TP that is there (if it still is) or remove and apply a new TP - one that matches the step in the original TP (with FL and trailing profit stops). Then OT/AT will manage it from there on like normal | |
^ Top | ||
Jim Dean![]() Sage ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 3433 Joined: 3/13/2006 Location: L'ville, GA ![]() | Hi Buffalo It’s my guess that some order types are more reliable than others for trade plans that do scaling in and out. I’m wary of Limit and StopLimit orders since they could get partial fills that the TP would not know about and be unable to properly manage. My testing has seen some really wierd results occasionally - even some cases where the position reversed itself. What order types are you using? And, do your TP’s mix scaling-in with partial exits - with the possibility of Adds in mid-trade after a prior PExit? | |
^ Top | ||
Buffalo![]() Elite ![]() ![]() Posts: 603 Joined: 7/11/2007 Location: Braintree, MA ![]() | Hi Jim What order types are you using? - All Market orders And, do your TP’s mix scaling-in with partial exits - No scaling IN ...with the possibility of Adds in mid-trade after a prior PExit? - Nope So relatively simple partial exits - 75% out at some predetermined profit level (different on different strats) w/ a Market order, 25% trailed and out with market order too. But good testing and real world results (so far) Hope you're doing good! | |
^ Top | ||
Jim Dean![]() Sage ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 3433 Joined: 3/13/2006 Location: L'ville, GA ![]() | Thanks! Advice re scaling in, if anyone needs it - as long as you do it before any PExits, it’s relatively easy to manage in a TP. Afaik, from my tests, Market, StopMarket, or MOO overnight are safe and reliable. StopLimit and Limit orders are dangerous due to potential partial fills. [Edited by Jim Dean on 7/27/2021 4:45 PM] | |
^ Top | ||
James S![]() Regular ![]() ![]() Posts: 62 Joined: 6/21/2007 Location: Dorset, England ![]() | Hi Buffalo, That's interesting to hear. I'm also on PR2H but the trade plan is not working for me. Any chance you can post your trade plan that is working? Thanks James | |
^ Top | ||
Buffalo![]() Elite ![]() ![]() Posts: 603 Joined: 7/11/2007 Location: Braintree, MA ![]() | James Here is a pic on a trade which exited the 75% now trailing the remaining 25%. It has a custom OL FL stop which makes no difference for what you're asking - replace it with standard FL EDIT while I was putting this together I got an exit on a different partial exit TP from a different strat. It was in at $94.17, 75% exit at $95.07 (1%) the next day then 25% exit 3 days later at $99.6 (5.75%) [Edited by Buffalo on 7/29/2021 9:38 AM] ![]() | |
^ Top | ||
Jim Dean![]() Sage ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 3433 Joined: 3/13/2006 Location: L'ville, GA ![]() | Buffalo - Pleased to see that all the SuperStop work is paying off! | |
^ Top | ||
James S![]() Regular ![]() ![]() Posts: 62 Joined: 6/21/2007 Location: Dorset, England ![]() | Thanks Buffalo. I can't see any difference between your trade plan and the one I am using, however I have had the error on all 6 trades that have exited 75%. I'm at a loss to explain it.. James | |
^ Top | ||
Buffalo![]() Elite ![]() ![]() Posts: 603 Joined: 7/11/2007 Location: Braintree, MA ![]() | Jim I have found the ATR tightening part to work very very well! | |
^ Top | ||
Buffalo![]() Elite ![]() ![]() Posts: 603 Joined: 7/11/2007 Location: Braintree, MA ![]() | James OK had this error happen to me last night on 3 positions that had exited the 75% and was tracking the 25%. What changed? Before yesterday I set AT to run in the AM before market opened. Yesterday I set it to run in the PM after mkt close. Then I got these errors at 4 am long after the run was completed. At 3am ish IB does something I think bc I regularly get these OT disconnected then reconnected warnings So I have re set AT to run in the AM. You should try it too PS If you have to reapply a TP to the 25% you should delete the previous step (the 75% exit part) and just have the trailing stop step left, and change the order to exit 100% not 25%. That works to get a TP attached | |
^ Top | ||
Jim Dean![]() Sage ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 3433 Joined: 3/13/2006 Location: L'ville, GA ![]() | Re the original post by James, where the IB size didn't match the TP the next morning ... I'm not clear on whether that is still an issue or not. If it is, there may be a couple of reasons: 1. if the stock is thinly traded &/or stoplimit order, then you could have gotten a partial fill ... the TP does not know about that. Solution: switch to Market or Market on Open or StopMarket order type. 2. if the 25% calculation resulted in some fractional number of shares, like 50.5, then the broker may have rounded up and the TP rounded down, etc. Solution: make sure the "100%" trade-calculator size can be evenly split into whatever partial exit percentages that your TP is using. | |
^ Top | ||
Buffalo![]() Elite ![]() ![]() Posts: 603 Joined: 7/11/2007 Location: Braintree, MA ![]() | Jim I don't think either of those things are the issue with the TPs. OBV they could've been for James (OP) but I did not get any partial fills (I also use a vol filter to avoid thinly traded or cheap stocks) or problems with the 75/25 division of the position (the numbers totaled the original position size) on any of the 3 that errored last night (at 4am). What I saw was AFTER the 75% exit (step 2 complete) the tradeplan showed **step 2 still active** instead of complete, so it expected to see the original position size instead of just the 25%. This caused the error of TP/position size not matching. I never saw this when I had AT run in the AM pre-mkt open. It only happened yesterday when I had it run PM the nite prior. I think it's what I suggested - when IB does some late night brokerage stuff it does every night around 3am that is causing this issue if AT ran before this but seems to be ok when AT runs after. We'll see tomorrow if no errors occur | |
^ Top | ||
Buffalo![]() Elite ![]() ![]() Posts: 603 Joined: 7/11/2007 Location: Braintree, MA ![]() | I run a custom version of the T21 profile on another computer to use to trade my 401k. It's connected to a paper broker but I use AT just like my IB OT install. The 75/25 thing with TPs has worked fine until yesterday when I did a test - instead of AT running in the AM prior to mkt open I set it to run PM after mkt close for the next day. Sure enough - got this TP error. Hasn't happened before. Soooooo it's not an IB brokerage thing bc this is a paper acct. Two different computers with separate OT installs running different profiles - one IB, one paper - using different strats are having this same problem IF it runs the night prior. If they run AM before mkt open NP. Barry? | |
^ Top | ||
Barry Cohen![]() Idol ![]() ![]() ![]() ![]() Posts: 2309 Joined: 1/1/1900 ![]() | I was able to reproduce & report this issue with multistep partial exit trade plans. We're working on a fix. | |
^ Top | ||
Buffalo![]() Elite ![]() ![]() Posts: 603 Joined: 7/11/2007 Location: Braintree, MA ![]() | Barry I see it now each time I shut down OT and restart - any open trade that did the partial exit and has the 25% remaining will generate this error when OT restarts | |
^ Top | ||
SteveL![]() Veteran ![]() ![]() Posts: 133 Joined: 2/15/2007 Location: Boulder, CO ![]() | Same here. Just recently started using the partial exit, and I got the same error yesterday (I had recently restarted OT). I'm glad Barry has reproduced the error. | |
^ Top | ||
Barry Cohen![]() Idol ![]() ![]() ![]() ![]() Posts: 2309 Joined: 1/1/1900 ![]() | The fix is in PR2J, going live shortly. Unfortunately it will not fix trade plans that have already been disconnected. | |
^ Top | ||
Jim Dean![]() Sage ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 3433 Joined: 3/13/2006 Location: L'ville, GA ![]() | Barry: Did the fix involve a change to the TP "engine", or to the TradePlan structure, or both? That is, could a user have made the necessary modifications? It would help us to know more details. Thanks! | |
^ Top | ||
Barry Cohen![]() Idol ![]() ![]() ![]() ![]() Posts: 2309 Joined: 1/1/1900 ![]() | It was a change in the code to fix a bug with multistep partial exit trade plans when used with a broker due to not calculating the partial exit share size properly. A user could not have made modifications to get around it. | |
^ Top | ||
Barry Cohen![]() Idol ![]() ![]() ![]() ![]() Posts: 2309 Joined: 1/1/1900 ![]() | It would calculate the share size to place the trades. There's a validation check that happens with trade plans when connecting to a broker. If the number of shares at the broker is not the same as what OT thinks it should be, then it causes a disconnected trade plan. That's the piece that was failing with partial exit trade plans. | |
^ Top | ||
Jim Dean![]() Sage ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 3433 Joined: 3/13/2006 Location: L'ville, GA ![]() | Ahhh ... a tricksey roundoff-handshake error. Good catch! Thanks for the explanation. | |
^ Top | ||
Jim Dean![]() Sage ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 3433 Joined: 3/13/2006 Location: L'ville, GA ![]() | Barry: SUGGESTION ... if that kind of mismatch error occurs again, PLEASE consider modifying the response-action to CLOSE THE TRADE (sell or cover all remaining shares), rather than let it continue unmanaged. If there is debate about this, please offer it as an Option that the User can set. This is actually a pretty crucial thing. It can happen pretty often with Partial fills, which occur on thinly traded stocks OR on TradePlans that use StopLimit orders. | |
^ Top | ||
Barry Cohen![]() Idol ![]() ![]() ![]() ![]() Posts: 2309 Joined: 1/1/1900 ![]() | I don't think people would be too happy if their live trades closed upon connecting OT to their broker. That's just asking for trouble. |
This thread is frozen and closed to further discussion
Legend | Action | Notification | |||
Administrator
Forum Moderator |
Registered User
Unregistered User |
![]() |
Toggle e-mail notification |