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 alifarahani, Today, 09:40 AM
        2 responses
        12 views
        0 likes
        Last Post alifarahani  
        Started by junkone, Today, 11:37 AM
        3 responses
        15 views
        0 likes
        Last Post NinjaTrader_ChelseaB  
        Started by pickmyonlineclass, Today, 12:23 PM
        0 responses
        1 view
        0 likes
        Last Post pickmyonlineclass  
        Started by frankthearm, Yesterday, 09:08 AM
        12 responses
        44 views
        0 likes
        Last Post NinjaTrader_Clayton  
        Started by quantismo, 04-17-2024, 05:13 PM
        5 responses
        35 views
        0 likes
        Last Post NinjaTrader_Gaby  
        Working...
        X