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 NullPointStrategies, Yesterday, 05:17 AM
          0 responses
          62 views
          0 likes
          Last Post NullPointStrategies  
          Started by argusthome, 03-08-2026, 10:06 AM
          0 responses
          134 views
          0 likes
          Last Post argusthome  
          Started by NabilKhattabi, 03-06-2026, 11:18 AM
          0 responses
          75 views
          0 likes
          Last Post NabilKhattabi  
          Started by Deep42, 03-06-2026, 12:28 AM
          0 responses
          45 views
          0 likes
          Last Post Deep42
          by Deep42
           
          Started by TheRealMorford, 03-05-2026, 06:15 PM
          0 responses
          50 views
          0 likes
          Last Post TheRealMorford  
          Working...
          X