Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Problem with StopLimit orders

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

    Problem with StopLimit orders

    Hi guys,

    I have some problem in my script with orders type of the subject.

    If I use this line:

    EnterShortStop(0, true, DefaultQuantity, EntryPrice, "Order01");

    the script run ok always, but if I change this line for this:

    EnterShortStopLimit(0, true, DefaultQuantity, EntryPrice, EntryPrice - StopInitial * TickSize, "Order01");

    In the log view:

    15/04/2013 1:23:40 Entered internal PlaceOrder() method at 15/04/2013 1:23:40: BarsInProgress=0 Action=SellShort OrderType=StopLimit Quantity=1 LimitPrice=88,98 StopPrice=89,13 SignalName='Order01' FromEntrySignal=''

    But I obtain always the same error:

    Market Replay Connection, Sell stop or sell stop limit orders can't be placed above the market. affected Order: SellShort 1 StopLimit@89,13 x 88,98

    I don't understand why in the same situation the Stop order work ok and the Stop limit order not.

    Can you help me? Any idea?

    Thanks for all.

    #2
    Hello jfcraker,

    Thank you for your post and welcome to the NinjaTrader Support Forum!

    Is the Stop Limit order being submitted above the market?

    What is the calculation to determine the EntryPrice variable and the StopInitial variable?

    I look forward to your response.

    Comment


      #3
      Hi Patrick,

      In the short order the EntryPrice is below the market and in the long trade above the market.

      StopInitial is a parameter of strategy, and the EntryPrice is calculated by indicators but I use the same strategy to the longstop and shortstop orders.

      Comment


        #4
        Hi Patrick,

        you can see an example here:

        15/04/2013 0:09:51 Entered internal PlaceOrder() method at 15/04/2013 0:09:51: BarsInProgress=0 Action=Buy OrderType=StopLimit Quantity=1 LimitPrice=89,28 StopPrice=89,13 SignalName='Order01' FromEntrySignal=''


        and snapshot of the market in this moment in attach file.

        Thanks for all.
        Attached Files

        Comment


          #5
          Hello jfcraker,

          Thank you for your response.

          The Limit Order Price of the Stop Limit Order is to high.

          The price level of the instrument does not exceed 89.28, yet you place the Limit Price at that level thus the rejection.

          You will need to correct the calculation that determines the Limit Price of the Stop Limit Order.

          Please let me know if you have any questions.

          Comment


            #6
            Sorry Patrick,

            I don't understand this.

            The EnterLongStopLimit() method generates a "buy stop limit" order to enter a long position, then I understand that the my order should be placed above the price of market.

            If I use chartrader in a graph and click rigth button above the price of market, then I can be place my order as "buy stop limit". Is this the same situation?

            Thanks in advance.

            Comment


              #7
              Originally posted by jfcraker View Post
              Hi Patrick,

              you can see an example here:

              15/04/2013 0:09:51 Entered internal PlaceOrder() method at 15/04/2013 0:09:51: BarsInProgress=0 Action=Buy OrderType=StopLimit Quantity=1 LimitPrice=89,28 StopPrice=89,13 SignalName='Order01' FromEntrySignal=''


              and snapshot of the market in this moment in attach file.

              Thanks for all.
              You are going short with a Limit Price above your Stop Price, in an attempt it would seem to get a better fill, by having the market retreat to fill you after hitting the Stop. No dice: NT will not allow you to do that in code.

              Been there, tried that. Here is where we discussed it: http://www.ninjatrader.com/support/f...ight=stoplimit

              Comment


                #8
                Hello jfcraker,

                Thank you for your response.

                My mistake on that item. However, the Buy Stop Limit shows as "LimitPrice=89,28 StopPrice=89,13". When was this attempted? It appears that even though this was a Buy Stop Limit it was submitted below the current price in the screenshot of 89.16 which would reject as well.

                I look forward to assisting you further.

                Comment


                  #9
                  Thanks for all Patrick,

                  Finally I understand the situation and correct it.

                  Kind regards.

                  Comment

                  Latest Posts

                  Collapse

                  Topics Statistics Last Post
                  Started by tkaboris, Today, 08:01 AM
                  0 responses
                  1 view
                  0 likes
                  Last Post tkaboris  
                  Started by BarzTrading, Today, 07:25 AM
                  1 response
                  10 views
                  1 like
                  Last Post NinjaTrader_Clayton  
                  Started by EB Worx, 04-04-2023, 02:34 AM
                  7 responses
                  161 views
                  0 likes
                  Last Post VFI26
                  by VFI26
                   
                  Started by Mizzouman1, Today, 07:35 AM
                  1 response
                  9 views
                  0 likes
                  Last Post NinjaTrader_Gaby  
                  Started by Radano, 06-10-2021, 01:40 AM
                  20 responses
                  616 views
                  0 likes
                  Last Post NinjaTrader_BrandonH  
                  Working...
                  X