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 Mindset, 04-21-2026, 06:46 AM
          0 responses
          88 views
          0 likes
          Last Post Mindset
          by Mindset
           
          Started by M4ndoo, 04-20-2026, 05:21 PM
          0 responses
          135 views
          0 likes
          Last Post M4ndoo
          by M4ndoo
           
          Started by M4ndoo, 04-19-2026, 05:54 PM
          0 responses
          68 views
          0 likes
          Last Post M4ndoo
          by M4ndoo
           
          Started by cmoran13, 04-16-2026, 01:02 PM
          0 responses
          119 views
          0 likes
          Last Post cmoran13  
          Started by PaulMohn, 04-10-2026, 11:11 AM
          0 responses
          69 views
          0 likes
          Last Post PaulMohn  
          Working...
          X