Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Differences between Exit Limit and Exit MIT

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

    Differences between Exit Limit and Exit MIT

    I've been playing around with NinjaScript strategies and have always used ExitLongLimit() and ExitShortLimit() for my targets. When using this functions I have to keep calling them on each OnBarUpdate() to keep the order working and everything was fine.

    In a new strategy I wanted to use ExitLongMIT() instead of ExitLongLimit()... I kept the same logic and call ExitLongMIT() on each OnBarUpdate()... and now a new Sell MIT order is added when a new bar is completed.

    As you can see in the following image, a Long position tagged V28Long was opened and its target at $5,903 was created using ExitLongLimit()... after several bars there is still 1 target... but the V30Long position was opened with a target at $5,894.25, the strategy immediately added that target and then, on each OnBarUpdate(), it keeps adding it, but at the moment of the screenshot there were 7 targets at that price... and it keeps adding 1 on each bar:
    Click image for larger version  Name:	Qb1UFrd.png Views:	0 Size:	52.4 KB ID:	1321527

    If I call ExitLongMIT() only once instead of on each OnBarUpdate() will it be kept as long as the order is working?

    What other technical differences should I have in mind when working with this Exit MIT functions?
    Last edited by juankvillegas; 10-15-2024, 10:36 AM.

    #2
    Hello juankvillegas,

    MIT means Market-If-Touched and becomes a market order when touched and fills at market price. This is similar to a simulated stop order.
    A Limit order will only fill at the specified price or better.

    "If I call ExitLongMIT() only once instead of on each OnBarUpdate() will it be kept as long as the order is working?"

    With all native strategy methods except Set methods (like SetStopLoss()), the isLiveUntilCancelled parameter must be supplied with a value of true.

    ExitLongMIT(int barsInProgressIndex, bool isLiveUntilCancelled, int quantity, double stopPrice, string signalName, string fromEntrySignal)
    Chelsea B.NinjaTrader Customer Service

    Comment


      #3
      In my code I have the 4 arguments version of ExitLongMIT:

      PHP Code:
      ExitLongMIT(int quantity, double stopPrice, string signalName, string fromEntrySignal) 
      

      This is my code:
      PHP Code:
      ExitLongMIT(Convert.ToInt32(LotSize), LongRealTargetPrice, "V30LongTarget", "V30Long"); 
      

      Then I assume It needs to be resubmitted again and again on each bar because I'm not using the isLiveUntilCancelled parameter (nor for the Enter nor for the Exit positions). So... why does it keep adding Sell MIT orders?

      Comment


        #4
        Hello juankvillegas,

        I would recommend using the method overload signature with the isLiveUntilCancelled bool.

        If you choose not to use this overload signature yes, the order would need to be submitted on each new bar to keep the order from being automatically cancelled when the submission bar closes.

        My guess would be the logic to keep the order alive is looking for the order to be accepted or working, and the MIT order is in a pending submit state.

        May I confirm you are using the latest release 8.1.3.1?

        Are you testing using the Sim101 account?
        Chelsea B.NinjaTrader Customer Service

        Comment


          #5
          May I confirm you are using the latest release 8.1.3.1?
          Yes.

          Are you testing using the Sim101 account?​
          I'm using a demo account, but not the Sim101... I used that Sim account some years ago, but it looks it is not available anymore.

          Comment


            #6
            Hello juankvillegas,

            Thank you for confirming this.

            This would be a Trigger pending state and is probably causing the behavior. I will report this to our development team.
            Chelsea B.NinjaTrader Customer Service

            Comment

            Latest Posts

            Collapse

            Topics Statistics Last Post
            Started by NullPointStrategies, Yesterday, 05:17 AM
            0 responses
            66 views
            0 likes
            Last Post NullPointStrategies  
            Started by argusthome, 03-08-2026, 10:06 AM
            0 responses
            141 views
            0 likes
            Last Post argusthome  
            Started by NabilKhattabi, 03-06-2026, 11:18 AM
            0 responses
            76 views
            0 likes
            Last Post NabilKhattabi  
            Started by Deep42, 03-06-2026, 12:28 AM
            0 responses
            47 views
            0 likes
            Last Post Deep42
            by Deep42
             
            Started by TheRealMorford, 03-05-2026, 06:15 PM
            0 responses
            51 views
            0 likes
            Last Post TheRealMorford  
            Working...
            X