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 Leeroy_Jenkins, 01-23-2021, 03:00 AM
          1 response
          23 views
          0 likes
          Last Post NinjaTrader_ChelseaB  
          Started by vantojo, Today, 09:32 AM
          1 response
          5 views
          0 likes
          Last Post NinjaTrader_Kate  
          Started by FelipeRXP, Today, 08:40 AM
          2 responses
          13 views
          0 likes
          Last Post FelipeRXP  
          Started by petedian, Today, 08:44 AM
          0 responses
          16 views
          0 likes
          Last Post petedian  
          Started by J0shTrader, Yesterday, 12:29 PM
          1 response
          3 views
          0 likes
          Last Post NinjaTrader_ChrisL  
          Working...
          X