Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Growing list of TD issues

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    #31
    Originally posted by NinjaTrader_Josh View Post
    Just call ExitLongLimit again and only change the price parameter.
    What about the quantity? Use the "remaining" quantity?

    Comment


      #32
      position.Quantity.
      Josh P.NinjaTrader Customer Service

      Comment


        #33
        Originally posted by NinjaTrader_Josh View Post
        sublime,

        You may want to cancel the ExitLongLimit() no matter what before the ExitLong(). Reason is what if your price actually hit the limit order and it was triggered before the exit long could report back. Then you now have an overfill and are actually in a short position as both exits fill out.

        In fact, the best approach I would suggest would even be to just modify the ExitLongLimit() to an arbitrarily low value to guarantee it triggers and gets filled instead of submitting ExitLong(). That way you don't have to wait for cancellation and submission of a new order or worry about the overfill scenario.
        Okay... so I went ahead and took your advice, Josh. Instead of canceling the ExitLongLimit(), I just amend it to a percentage of the original price. I've been using :

        Position.AvgPrice - (Position.AvgPrice*.5)

        Well, once again... works like a top in simulation. I've got real Limits being hit without incident, and when I would usually close the position, the new amend logic worked perfectly. So... ready for prime time.

        I executed the strategy live and when the market turned against me, the strategy attempted to amend the ExitLongLimit(). However, the status simply stayed in "PendingChange". I kept waiting for an error, or the order to execute... but nothing. Finally, it was close to the end of the day and I have the parameter set that will close open positions 30 seconds before the end of the trading day. Well, when that triggered, everything exploded. There error was the usual :
        'Your order(s) can't be placed. The total quantity of outstanding open sell order(s) exceeds the quantity you hold.'

        So, that at least answers my question in my 1:44 pm post of yesterday. Attempting to close open positions will fail in TD if there is an active sell limit order. So if I ever get this working, I will not be able to use the auto close feature. I'll have to detect the end of the market and either cancelorder() or amend the ExitLongLimit() to get it filled. I'll probably count bars...

        Now, the reason the ExitLongLimit() forever remained in "PendingChange" status. Well, a review of the trace file shows that the adapter posed a question - a modal question - and was awaiting a reply. The question?
        error='Your limit is significantly below the bid. Please confirm you are selling the correct security.'

        And it just sat there, waiting for some correctly formated XML response. I've had the very same issue when building a .NET adapter to an SAP BAPI via a SOAP farm or BizTalk. Every once in a while SAP will request additional information that my adapter cannot deal with. And I would figure out what it wanted, try to get SAP to stop sending it, which invariably, they couldn't, and I would end up coding around it. Just as SAP could never give me a finite list of the possible questions SAP might pose, I'm sure TD cannot give you all the possible communications that their adapter might pose. So.. we code around it.

        So, the question is... how low do I amend the ExitLongLimit()? Obviously 50% is too low. I guess I'll try 20%, but I also need to be sure that the order executes. Any insight is appreciated...

        Comment


          #34
          Originally posted by sublime View Post
          So if I ever get this working, I will not be able to use the auto close feature. I'll have to detect the end of the market and either cancelorder() or amend the ExitLongLimit() to get it filled. I'll probably count bars...
          Yep, that's the right thing to do. I don't remember if this is the case on TDA, but on other brokers (when I used to be on Fidelity), limit orders that I didn't cancel on time couldn't be canceled/touched... you had to wait for the exchange to cancel all "day" orders (around 4:30 PM).

          I just look at Time[0] (if I'm not Historical), and if after 3:55 PM... take "special" measures.

          error='Your limit is significantly below the bid. Please confirm you are selling the correct security.'
          Different brokers have different limits, but I thought you'd have problems as soon as I saw you did ask * 0.5. Going 5%-10% below the ask should get the job done anyways.

          Comment


            #35
            Yeah, I think I'll put it 5% below the current price - not even mess with the original fill.

            Comment


              #36
              However heech, I will say... with some hesitancy, that I might, just might, get this adapter to work with TDA. Progress is slow, as I don't do this full-time, but it's also steadily moving forward. I'm going to guess that if I can get this TDA adapter to work, I'll be able to get any of them to work. We'll see...

              Comment


                #37
                Originally posted by sublime View Post
                However heech, I will say... with some hesitancy, that I might, just might, get this adapter to work with TDA. Progress is slow, as I don't do this full-time, but it's also steadily moving forward. I'm going to guess that if I can get this TDA adapter to work, I'll be able to get any of them to work. We'll see...
                It sounds like it.

                Like I said before, the TDA adapter was fundamentally unusable for me because of the bug with BuyToCover. If you're not holding multi-day and if that doesn't trip you up... then I don't see why you couldn't keep going. Before I got to the point where it began to trip me up, I probably executed 500 trades live through TDA with NT.

                Comment


                  #38
                  TDA users,

                  Please be aware of the syncing requirement on strategy start up outlined here: http://www.ninjatrader-support2.com/...ead.php?t=4033
                  Josh P.NinjaTrader Customer Service

                  Comment


                    #39
                    Originally posted by NinjaTrader_Josh View Post
                    TDA users,

                    Please be aware of the syncing requirement on strategy start up outlined here: http://www.ninjatrader-support2.com/...ead.php?t=4033
                    If you're referring to my report on the BuyToCover bug, you're wrong. I'm completely in sync, in reference to strategy/portfolio position. Ray/Dierk are aware of the bug I'm referring to.

                    Comment


                      #40
                      heech,

                      No, I am referring to the need to be in sync as you run a strategy for orders to be placed properly.
                      Josh P.NinjaTrader Customer Service

                      Comment


                        #41
                        Originally posted by NinjaTrader_Josh View Post
                        Just call ExitLongLimit again and only change the price parameter.
                        Josh,

                        Does this work if I was using the "LiveUntilCancelled" flag (set to true)? Or do I need to explicitly CancelOrder the limit order, before a new call can replace it?

                        Comment


                          #42
                          heech,

                          What behavior are you trying to achieve? Amend the order?
                          Josh P.NinjaTrader Customer Service

                          Comment


                            #43
                            Originally posted by NinjaTrader_Josh View Post
                            heech,

                            What behavior are you trying to achieve? Amend the order?
                            That's right. I'm trying to do what was discussed earlier... essentially "change" a limit order to a market order by dropping down the price.

                            But you know, I'm starting to think that might be a bad idea for me... unless there's something I'm missing, it seems that if I have to enter the limit quantity explicitly (rather than "update remnants of current limit order with new price"), there's no way to guarantee that I won't over-fill. Because the Limit order can partially fill just as I'm changing the price...?

                            I think it's safer going back to CancelOrder -> re-open with market order.

                            Comment


                              #44
                              heech,

                              You can just amend the order up by calling ExitLongLimit(...) again. You do not need to CancelOrder first.
                              Josh P.NinjaTrader Customer Service

                              Comment


                                #45
                                Ok, this is a question on execution that requires some setup. I have a strategy that has two instruments and four series. Instrument1 with 1,3 minute bars and Instrument2 with 1,3 minute bars. And 3 minutes is the Primary bars.

                                First, I execute orders on all the series, but I recently read the Hover message on the BarsinProgress() which reads:
                                "If running a strategy with multiple bar series of the same instrument, ONLY execute orders against the first series."

                                Why is that? That's one thing that hasn't caused any errors in my strategies and can impact results.

                                In the OnBarUpdate() I recently made a change to ignore the 3 minute series. I figured it was redundant as the logic is the same for the 1 and 3 series and obviously when the 3 series is called, so is the 1 series. However, I have unique entries and exits in each series and I failed to realize the significance. I initially added the 1 minute series to quickly reenter a trade if the 3 minute hits a profit target, and that does work. But what I failed to grasp, is that with unique entries and exits, a 3 minute Entry was only being closed by a 3 minute Exit. More so, with the 3 minute code before the 1 minute code in the OnBarUpdate method, it would enter 3 minute trades instead of 1 minute trades when the 3 minute bar was processed.

                                So, when I began ignoring the 3 minute series, the change was dramatic. I was closing trades much earlier and making many more trades. I didn't realize the significance of the move until I backtested the new strategy. It had many more trades which took the strategy from a winner to a complete loser.

                                With all that said, I think I would prefer to have the unique entries and exits on the multiple series. As a matter of fact, I think I will backtest a strategy that enters on the 3 or 1 bars, but can only exit on the 3 bars. Is this really causing an issue as the Hover message alludes?

                                Comment

                                Latest Posts

                                Collapse

                                Topics Statistics Last Post
                                Started by Shai Samuel, 07-02-2022, 02:46 PM
                                4 responses
                                92 views
                                0 likes
                                Last Post Bidder
                                by Bidder
                                 
                                Started by DJ888, Yesterday, 10:57 PM
                                0 responses
                                6 views
                                0 likes
                                Last Post DJ888
                                by DJ888
                                 
                                Started by MacDad, 02-25-2024, 11:48 PM
                                7 responses
                                158 views
                                0 likes
                                Last Post loganjarosz123  
                                Started by Belfortbucks, Yesterday, 09:29 PM
                                0 responses
                                7 views
                                0 likes
                                Last Post Belfortbucks  
                                Started by zstheorist, Yesterday, 07:52 PM
                                0 responses
                                7 views
                                0 likes
                                Last Post zstheorist  
                                Working...
                                X