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 daven, Today, 09:49 AM
          3 responses
          9 views
          0 likes
          Last Post NinjaTrader_Eleanore  
          Started by omermirza, 01-15-2021, 01:15 PM
          13 responses
          117 views
          0 likes
          Last Post NinjaTrader_Jim  
          Started by Island_Boy_Trading, Today, 07:39 AM
          2 responses
          15 views
          0 likes
          Last Post Island_Boy_Trading  
          Started by cmarkb, Today, 07:19 AM
          1 response
          11 views
          0 likes
          Last Post NinjaTrader_Jesse  
          Started by wjadevries, Today, 03:29 AM
          1 response
          16 views
          0 likes
          Last Post NinjaTrader_Jim  
          Working...
          X