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

Stop Limit Order error

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

    Stop Limit Order error

    I am testing some exit orders unmanaged StopLimit orders and recieved the following error message (I was long CL (entry price at 102.39) at the time.)

    " Limit price can't be greater than stop price. affected Order: Sell 1 StopLimit @ 101.49 x 101.99 "

    The confusing thing is in my code I do have the limit price set BELOW the stop price....
    Here is the code I used for the above Sell Stoplimit orders.

    Code:
    exitBuyStopLossOrder = SubmitOrder(0, OrderAction.Sell, OrderType.StopLimit,  this.Position.Quantity, stop - 50 * TickSize, stop, "LongExit1_" +  Instrument.Id, "Long StopLoss1");
    Am I misunderstanding how to use these orders correctly or coding them wrong?

    Thanks
    Last edited by maninjapan; 10-09-2013, 08:27 AM.

    #2
    Hello,

    You will want to flip your limit and stop values around.

    Because this is a sell stop limit order the limit price will need to be placed at your stop level and your stop price placed below that.

    Let me know if I can be of further assistance.
    LanceNinjaTrader Customer Service

    Comment


      #3
      Lance, now I am even more confused.... so Joydeep is post #11 here is incorrect then?

      Comment


        #4
        Hello,

        Joydeep's reply is correct. However I'm noticing that your Limit order is being placed at 101.99 and your stop is at 101.49

        There is likely something else in your code that is causing the orders to be placed incorrectly.

        are you submitting orders anywhere else in your code that might have the limit and stop prices switched?
        LanceNinjaTrader Customer Service

        Comment

        Latest Posts

        Collapse

        Topics Statistics Last Post
        Started by habeebft, Today, 07:27 AM
        1 response
        11 views
        0 likes
        Last Post NinjaTrader_ChristopherS  
        Started by AveryFlynn, Today, 04:57 AM
        1 response
        12 views
        0 likes
        Last Post NinjaTrader_Erick  
        Started by Max238, Today, 01:28 AM
        4 responses
        37 views
        0 likes
        Last Post Max238
        by Max238
         
        Started by r68cervera, Today, 05:29 AM
        1 response
        10 views
        0 likes
        Last Post NinjaTrader_ChelseaB  
        Started by geddyisodin, Today, 05:20 AM
        1 response
        14 views
        0 likes
        Last Post NinjaTrader_Gaby  
        Working...
        X