Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Close position in Strategy Analyzer

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

    Close position in Strategy Analyzer

    I created simple strategy with the help of Strategy Wizard.
    It is based on CCI, EnterLong and EnterShort when conditions fulfilled, StopLoss and Profittarget set.

    Then I tried to backtest it in Strategy Analyzer. And there are some trades which ended with "Close position". But I want trades to end only "StopLoss", "ProfitTarget" and "Exit on Close". Why some trades end with "Close position"? It happens when I am Long and before StopLoss or ProfitTarget new Short order is generated. But I want to Close this Long position later. Is it possible to set it somehow?

    #2
    "Close position" trades are trades associated with position reversals. If you were long and then you placed EnterShort() it will first close your long position and then acquire your short position.

    "Exit on Close" are trades associated with the end of the session. By default if you have a position open at the end of the day it will close it for you. If you do not want this you can turn it off by the strategy settings when you run the strategy. There is one titled "ExitOnClose". Go ahead and turn that to false.
    Josh P.NinjaTrader Customer Service

    Comment


      #3
      Hi, thank you for answer.
      I understand "Exit on Close", but I would like to know if it is possible to turn off "Close positions" with the help of Strategy Wizard? For example when I want to have open 2 Long and 3 Short positions at once and wait for their Stop Loss or Profit Target. Simple I do not want to make reversal trades (or only backtest without reversal trades).

      Comment


        #4
        Not possible. Just use ExitLong if you don't want to use the reversal logic. If you want to maintain using EnterShort() you will need to add a condition to make sure you were not long before entering short, but if you go this route you still need to manually do ExitLong() before being able to enter short.
        Josh P.NinjaTrader Customer Service

        Comment

        Latest Posts

        Collapse

        Topics Statistics Last Post
        Started by Geovanny Suaza, 02-11-2026, 06:32 PM
        0 responses
        580 views
        0 likes
        Last Post Geovanny Suaza  
        Started by Geovanny Suaza, 02-11-2026, 05:51 PM
        0 responses
        335 views
        1 like
        Last Post Geovanny Suaza  
        Started by Mindset, 02-09-2026, 11:44 AM
        0 responses
        102 views
        0 likes
        Last Post Mindset
        by Mindset
         
        Started by Geovanny Suaza, 02-02-2026, 12:30 PM
        0 responses
        554 views
        1 like
        Last Post Geovanny Suaza  
        Started by RFrosty, 01-28-2026, 06:49 PM
        0 responses
        552 views
        1 like
        Last Post RFrosty
        by RFrosty
         
        Working...
        X