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 Exit

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

    Limit Order Exit

    Hi

    I have a situation where my strategy is exiting a trade before it should be. My stop loss is at 93.8319 but price only reaches a high of 93.83 (for a short trade). I have checked the historical data manager and confirmed this is the case. For this trade, I am using a limit order.

    This occurred on market replay in the replay 101 account.

    The strategy has 2 exit options - a market and limit order exit.

    When the exit is set to a market order, the stop loss doesn't get triggered at this price.

    When the exit is set to a limit order, the stop loss does get triggered even though price never exceeds 93.8319.

    Naturally I assumed price would need to hit 93.84 for a 93.8319 stop loss to be activated.

    My programmer asked me to post the question:

    Why is Call to following causing exit at 93.83. Exact call to the function is.

    EnterShort(0, 1, "Shrt MRKT 18631");

    ExitShortStop (0, true, 1, 93.8319, "Stop Loss", "Shrt MRKT 18631");

    Thanks

    #2
    Hi chadc,

    What instrument are you using?

    I ask because you may be using a number that is not an exact TickSize which may be causing unexpected behavior.
    Chelsea B.NinjaTrader Customer Service

    Comment


      #3
      Hi

      This was the CL 12-13 contract on the 13th of November 2013 at 2:21:14 PM EST

      Thanks

      Comment


        #4
        Hi chadc,

        The TickSize of the CL is .01. This means that a price that is not at an exact size of the hundredths place may not be what you would expect.

        I recommend that you round this to the tick size.

        For example:
        Instrument.MasterInstrument.Round2TickSize(93.8319 );
        Chelsea B.NinjaTrader Customer Service

        Comment

        Latest Posts

        Collapse

        Topics Statistics Last Post
        Started by GussJ, 03-04-2020, 03:11 PM
        11 responses
        3,227 views
        0 likes
        Last Post xiinteractive  
        Started by andrewtrades, Today, 04:57 PM
        1 response
        13 views
        0 likes
        Last Post NinjaTrader_Manfred  
        Started by chbruno, Today, 04:10 PM
        0 responses
        7 views
        0 likes
        Last Post chbruno
        by chbruno
         
        Started by josh18955, 03-25-2023, 11:16 AM
        6 responses
        440 views
        0 likes
        Last Post Delerium  
        Started by FAQtrader, Today, 03:35 PM
        0 responses
        12 views
        0 likes
        Last Post FAQtrader  
        Working...
        X