Announcement

Collapse

Looking for a User App or Add-On built by the NinjaTrader community?

Visit NinjaTrader EcoSystem and our free User App Share!

Have a question for the NinjaScript developer community? Open a new thread in our NinjaScript File Sharing Discussion Forum!
See more
See less

Partner 728x90

Collapse

Limit order issue (Strategy shuts down)

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

    #31
    EnterLongStopLimit works fine in an atm strategy but not in a ninjascript strategy

    would be nice if in the help section there could be an example how to use the ENTERLONGSTOPLIMIT function

    there is currently only a help section for


    but not for



    i simply want to trigger a stop order on the high +1 Tick of prior bar and then once this price is reached a limit order of -4 tick of the current price should be placed..

    when using this command
    EnterLongStopLimit(DefaultQuantity, High[0] - 4 * TickSize, High[0] +1 * TickSize, "long");

    i get an order rejected error with the message: price cant be smaller than the stop price.

    if i place by hand (with the chart trader) a LongStopLimit order above the market with -4 Ticks then everything is working fine (limit order can be smaller than the stop price: once my stop price is reached a limit order is placed and filled.
    Attached Files

    Comment


      #32
      tradereight,

      Not sure why you can't view the article on EnterLongStopLimit from the help guide. http://www.ninjatrader-support.com/H...gStopLimt.html

      It should be available.

      No, stop-limit orders cannot be filled with limit orders below the stop price. Stop-limit orders convert to limit orders when the stop price is breached. Limit orders try to guarantee you filled at the limit price or better. For longs, limit price or better means limit price or lower. If your stop price is above the limit price and you breached the stop price you are automatically above the limit price. You will not be filled ever. This is why the limit price needs to be greater than the stop price.
      Josh P.NinjaTrader Customer Service

      Comment


        #33
        I got the same problem in my Ninja script. My EnterLongStopLimit order is rejected because the Limit price is smaller than the Stop price.

        But when I generate the same order on my Interactive Broker account it is normally executed. It becomes active when the Stop price is hit and waits till the Limit price is hit. It seems like it's a valid construction.

        Also when I backtest my strategy with the Limit price smaller than the Stop price it is also execute fine. I get the results that I expect.

        Why won't it work when the strategy is run against real data?

        Thanks in advance.

        Comment


          #34
          Koffie, because in historical backtesting there's no bid / ask data available, which would be used in a realtime trading and simulation.
          BertrandNinjaTrader Customer Service

          Comment


            #35
            Koffie,
            Maybe this will help. Market If Touched / Limit If Touched Orders In Ninja Trader

            Comment


              #36
              Guys,

              Thanks for the comments. Reading the page about the MIT and LIT it seems to be a good alternative for the StopLimit orders. I am going to implement this in my strategy!

              Comment


                #37
                Spelling mistake

                Hi Josh

                The reason why tradereight couldn't open help article is because of the spelling mistake in the article's address and title:
                it says:
                EnterLongStopLimt()

                instead of
                EnterLongStopLimit()

                And BTW in the example code of this help article uses the following:

                EnterLongStop(High[0] + 2 * TickSize, High[0], "SMA Cross Entry");

                which is another mistake

                Comment


                  #38
                  Thank you for bringing this to our attention.
                  Josh P.NinjaTrader Customer Service

                  Comment

                  Latest Posts

                  Collapse

                  Topics Statistics Last Post
                  Started by MarianApalaghiei, Today, 10:49 PM
                  1 response
                  5 views
                  0 likes
                  Last Post NinjaTrader_Manfred  
                  Started by love2code2trade, Yesterday, 01:45 PM
                  4 responses
                  28 views
                  0 likes
                  Last Post love2code2trade  
                  Started by funk10101, Today, 09:43 PM
                  0 responses
                  7 views
                  0 likes
                  Last Post funk10101  
                  Started by pkefal, 04-11-2024, 07:39 AM
                  11 responses
                  37 views
                  0 likes
                  Last Post jeronymite  
                  Started by bill2023, Yesterday, 08:51 AM
                  8 responses
                  45 views
                  0 likes
                  Last Post bill2023  
                  Working...
                  X