Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

how to close all positions?

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

    how to close all positions?

    Dear friends.
    I want to close all opened positions on bar update.
    But I see only commands for closing short or long positions at help file. Shpils I use some loop for checking every position and close them one by one?

    #2
    Hi daglas,

    The supported technique for closing position is ExitLong() and ExitShort(). There is not a close everything command, although you can use both those at the same time. They will only submit orders if there is a strategy position in that direction.
    Last edited by NinjaTrader_RyanM1; 10-03-2011, 01:12 PM.
    Ryan M.NinjaTrader Customer Service

    Comment


      #3
      Originally posted by NinjaTrader_RyanM View Post
      Hi daglas,

      The supported technique for closing position is ExitLong() and ExitShort(). There is not a close everything command, although you can submit both those at the same time. They will only submit orders if there is a strategy position in that direction.
      ok, thx, it works good.

      Comment


        #4
        also I have question.
        My strategy use neural networks for teaching. So I need 1000 bars for teaching. And strategy try to get them in initialize section of code. If I use strategy tester, and set up start testing time as 01.01.2011
        will it get 1000 previous bars from 2010 year?

        Comment


          #5
          No, the strategy will not load bars prior to the start date selected in the strategy analyzer GUI.
          Ryan M.NinjaTrader Customer Service

          Comment

          Latest Posts

          Collapse

          Topics Statistics Last Post
          Started by Geovanny Suaza, 02-11-2026, 06:32 PM
          0 responses
          648 views
          0 likes
          Last Post Geovanny Suaza  
          Started by Geovanny Suaza, 02-11-2026, 05:51 PM
          0 responses
          369 views
          1 like
          Last Post Geovanny Suaza  
          Started by Mindset, 02-09-2026, 11:44 AM
          0 responses
          108 views
          0 likes
          Last Post Mindset
          by Mindset
           
          Started by Geovanny Suaza, 02-02-2026, 12:30 PM
          0 responses
          572 views
          1 like
          Last Post Geovanny Suaza  
          Started by RFrosty, 01-28-2026, 06:49 PM
          0 responses
          573 views
          1 like
          Last Post RFrosty
          by RFrosty
           
          Working...
          X