Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Why strategy analyzer close all positions in the day

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

    Why strategy analyzer close all positions in the day

    I'm running strategy analyzer on day timeframe, but all position open are close at the end of day.
    I set:


    Name = "Strategia1";
    Calculate = Calculate.OnBarClose;
    EntriesPerDirection = 1;
    EntryHandling = EntryHandling.AllEntries;
    IsExitOnSessionCloseStrategy = false;
    // ExitOnSessionCloseSeconds = 30;
    IsFillLimitOnTouch = false;
    MaximumBarsLookBack = MaximumBarsLookBack.TwoHundredFiftySix;
    OrderFillResolution = OrderFillResolution.Standard;
    Slippage = 0;
    StartBehavior = StartBehavior.WaitUntilFlat;
    TimeInForce = TimeInForce.Gtc;
    TraceOrders = false;
    RealtimeErrorHandling = RealtimeErrorHandling.StopCancelClose;
    StopTargetHandling = StopTargetHandling.PerEntryExecution;
    BarsRequiredToTrade = 20;
    // Disable this property for performance gains in Strategy Analyzer optimizations
    // See the Help Guide for additional information
    IsInstantiatedOnEachOptimizationIteration = true;


    thank you for help

    #2
    Hello enzoo,

    Thank you for your note.

    If you change,

    Code:
    IsExitOnSessionCloseStrategy	= false;
    //	ExitOnSessionCloseSeconds	= 30;
    To,

    Code:
    IsExitOnSessionCloseStrategy	= true;
    ExitOnSessionCloseSeconds	= 30;
    Does the strategy exit as expected?

    I look forward to your reply.
    Alan P.NinjaTrader Customer Service

    Comment


      #3
      thank you for so fast reply.
      I applyed the proposed changing but the result is the same.

      I don't want the positions are closed at the end of the same day, seewhat is happening in annex

      i would like to open long position that last for days and after open a short position that close previous long position and open one in short,

      instead now all open positions are automatically close at the end of the same day.
      Attached Files

      Comment


        #4
        Hello enzoo,

        It looks like your trades are closing out rather quickly due to having a tight profit target. For example it looks like your profit target is closing your positions for 15 cents profit on a stock trading almost 1000.

        I would suggest using a wider profit target and you're positions should remain open as long as those targets or stops are not breached.

        Please let us know if you need further assistance.
        Alan P.NinjaTrader Customer Service

        Comment


          #5
          thank you now it is working.

          Comment

          Latest Posts

          Collapse

          Topics Statistics Last Post
          Started by NullPointStrategies, Yesterday, 05:17 AM
          0 responses
          75 views
          0 likes
          Last Post NullPointStrategies  
          Started by argusthome, 03-08-2026, 10:06 AM
          0 responses
          146 views
          0 likes
          Last Post argusthome  
          Started by NabilKhattabi, 03-06-2026, 11:18 AM
          0 responses
          79 views
          0 likes
          Last Post NabilKhattabi  
          Started by Deep42, 03-06-2026, 12:28 AM
          0 responses
          50 views
          0 likes
          Last Post Deep42
          by Deep42
           
          Started by TheRealMorford, 03-05-2026, 06:15 PM
          0 responses
          54 views
          0 likes
          Last Post TheRealMorford  
          Working...
          X