Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

This does not quite look right

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

    This does not quite look right

    I created a strategy that places StopLongLimit (and StopShortLimit) orders, though for starters, and validation purposes, only the long trades are being placed. When the order is placed, I get the message shown in the picture.

    This makes no sense. For entry StopLimit orders, I always place my Limit order behind my Stop order, so that after the stop is triggered, the market has to retreat to put me in at a better price. I do this all the time in the ATM/DOM when I am manually testing out a discretionary method, and there is nary a complaint from NinjaTrader. I am sure that I did this many times in NT6.5 from NinjaScript, but I will not swear to it, as it is too long ago to remember with certainty.

    Why does a method that works manually cause an error when done from NinjaScript. Am I missing something here?
    Attached Files

    #2
    Hi koganam,

    This type of order is not supported by brokers/ exchanges. When you place the same type of order manually on the DOM, it is simulated. The order is held locally at NinjaTrader until last traded price = stop price. Then, it submits a limit order to the broker.

    You can see this simulated distinction, as it will be colored yellow on the DOM, and the order state is "Initialized", rather than working or accepted.
    Ryan M.NinjaTrader Customer Service

    Comment


      #3
      Originally posted by NinjaTrader_RyanM View Post
      Hi koganam,

      This type of order is not supported by brokers/ exchanges. When you place the same type of order manually on the DOM, it is simulated. The order is held locally at NinjaTrader until last traded price = stop price. Then, it submits a limit order to the broker.

      You can see this simulated distinction, as it will be colored yellow on the DOM, and the order state is "Initialized", rather than working or accepted.
      Well, that explains that. Thanks a million; I had been tearing my hair out in clumps, ans was ready to shoot the computer.

      Looks like now I have to code a function to simulate that. Back to the drawing board, it seems. Thank goodness, NT is so flexible that I can pretty much code whatever I please! If anybody wants to take my NT, they are going to need the "Jaws Of Life" to pry it out of my cold dead hands.

      Comment


        #4
        You're welcome. Thanks for the kind words and feedback. Glad to hear you're taking advantage of the platform. My jaws-of-life is loaned out at the moment so you're safe there.
        Ryan M.NinjaTrader Customer Service

        Comment


          #5
          May we have an enhancement then? Please.

          Originally posted by NinjaTrader_RyanM View Post
          You're welcome. Thanks for the kind words and feedback. Glad to hear you're taking advantage of the platform. My jaws-of-life is loaned out at the moment so you're safe there.
          OK. I have this coded now, but after second thoughts, I think that I should request that this simulated manner that is used in the DOM should also be available from NinjaScript. After all, NT already does handle simulated orders from code, as done in SetStopLoss() and SetTrailStop(), so the code and method must already exist.

          Thanks for your time and efforts.

          Comment


            #6
            Thanks, koganam. I've submitted this request to our development team, and it is assigned tracking id #1308.
            Last edited by NinjaTrader_RyanM1; 10-03-2011, 09:36 AM.
            Ryan M.NinjaTrader Customer Service

            Comment


              #7
              Ryan, koganam,

              just found this thread and I'm really confused again :-) I think I just asked for confirmation for this very same Ninjascript functionality 10 days earlier - see http://www.ninjatrader.com/support/f...hlight=gain247

              ... and here it looks it doesn't work after all?? I mean coding a strategy using StopLimit entry with negative offset for Limit order, as we can do manually on DOM and charts as of today.

              Ryan, would you pls confirm what's the status of this functionality in Ninjascript? When we might be able to use it in a strategy code, as we are now able to trade it manually?

              Sorry for a late reaction to this thread, but I'm right now in a middle of getting this piece of coding done and this issue was raised again, eventhough I was given an indication it should work ok.

              Thanks!

              Comment


                #8
                Hi gain247,

                Apologies, but we had to delete the earlier posts due to incorrect information, and we have corrected the one you linked as well.

                Koganam's suggestion is valid for what you are looking to do with stop limit orders. Basically, allow them to be simulated directly without having to custom code the logic.

                As it is now, the order formatting is accepted by the compiler, but this style of orders will not automatically be converted to simulated, and won't be accepted by any broker/exchange (including NT built-in simulator).

                Thanks for participating in the discussion earlier, and I apologize for any confusion introduced here.
                Last edited by NinjaTrader_RyanM1; 01-30-2012, 01:47 PM.
                Ryan M.NinjaTrader Customer Service

                Comment


                  #9
                  Thanks Ryan. Yes, this is how I have experienced it with Ninjascript, so have to go for a custom code for the same logic. I hope it will get implemented some day, though, it would be simpler to implement and more consistent with manual trading logic. Again, thanks for your patience to answer my questions and following through to get this issue clear.

                  Comment


                    #10
                    Originally posted by gain247 View Post
                    Thanks Ryan. Yes, this is how I have experienced it with Ninjascript, so have to go for a custom code for the same logic. I hope it will get implemented some day, though, it would be simpler to implement and more consistent with manual trading logic. Again, thanks for your patience to answer my questions and following through to get this issue clear.
                    This seems to be dependent on your broker. I have written the same type of entry code, and it works with Interactive Brokers, but not with Mirrus.

                    Comment


                      #11
                      Monpere,

                      Do you perhaps have a toy sample that has this issue occur you can post?
                      Adam P.NinjaTrader Customer Service

                      Comment


                        #12
                        Originally posted by NinjaTrader_AdamP View Post
                        Monpere,

                        Do you perhaps have a toy sample that has this issue occur you can post?
                        I think something like this should be able to do it:

                        SubmitOrder(0, OrderAction.Buy, OrderType.StopLimit, 1, Close[0]-(10*TickSize), Close[0]+(2*TickSize), "Test", "Test");

                        Comment


                          #13
                          monpere,

                          Thanks for the code snippet. What result are you expecting with that snippet, and what result are you seeing instead?
                          Ryan M.NinjaTrader Customer Service

                          Comment

                          Latest Posts

                          Collapse

                          Topics Statistics Last Post
                          Started by Barry Milan, Today, 10:35 PM
                          1 response
                          8 views
                          0 likes
                          Last Post NinjaTrader_Manfred  
                          Started by WeyldFalcon, 12-10-2020, 06:48 PM
                          14 responses
                          1,428 views
                          0 likes
                          Last Post Handclap0241  
                          Started by DJ888, Yesterday, 06:09 PM
                          2 responses
                          9 views
                          0 likes
                          Last Post DJ888
                          by DJ888
                           
                          Started by jeronymite, 04-12-2024, 04:26 PM
                          3 responses
                          40 views
                          0 likes
                          Last Post jeronymite  
                          Started by bill2023, Today, 08:51 AM
                          2 responses
                          16 views
                          0 likes
                          Last Post bill2023  
                          Working...
                          X