Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Disabling NinjaScript strategy

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

    Disabling NinjaScript strategy

    Hello, I'm trying to close a market position using Position.Close(); This disables the strategy. I work in the IsUnmanaged = true mode. Give me some advice - how to make the strategy not turn off.

    #2
    Hello Kovalev,

    Thanks for your post.

    If you are using the Unmanaged Approach and want to close your position without disabling the strategy, you should use Unmanaged orders to close the position.

    You can check the strategy Position with Position.MarketPosition and Position.Quantity so you can be sure if you want to submit a sell market order or a buy market order with the correct quantity to close the position.

    SubmitOrderUnmanaged - https://ninjatrader.com/support/help...runmanaged.htm

    Position - https://ninjatrader.com/support/help.../?position.htm

    Please let us know if you have any questions.

    Comment


      #3
      Hello NinjaTrader_Jim, and if I want to close immediately on the market?

      Comment


        #4
        Hello Kovalev,

        If you want to close a position immediately at market price, you will want to submit a market order to close that position. The market order should be submitted with the same quantity as the position quantity so when it fills, you go flat.

        Comment


          #5
          Jim, thank you so much, I should have known better.

          Comment

          Latest Posts

          Collapse

          Topics Statistics Last Post
          Started by CarlTrading, 03-31-2026, 09:41 PM
          1 response
          43 views
          0 likes
          Last Post NinjaTrader_ChelseaB  
          Started by CarlTrading, 04-01-2026, 02:41 AM
          0 responses
          21 views
          0 likes
          Last Post CarlTrading  
          Started by CaptainJack, 03-31-2026, 11:44 PM
          0 responses
          30 views
          1 like
          Last Post CaptainJack  
          Started by CarlTrading, 03-30-2026, 11:51 AM
          0 responses
          50 views
          0 likes
          Last Post CarlTrading  
          Started by CarlTrading, 03-30-2026, 11:48 AM
          0 responses
          40 views
          0 likes
          Last Post CarlTrading  
          Working...
          X