Announcement

Collapse

Looking for a User App or Add-On built by the NinjaTrader community?

Visit NinjaTrader EcoSystem and our free User App Share!

Have a question for the NinjaScript developer community? Open a new thread in our NinjaScript File Sharing Discussion Forum!
See more
See less

Partner 728x90

Collapse

"Exit on session close" bug

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

    "Exit on session close" bug

    Hello!

    NT 8.0.6.0 64-bit (Multi-Broker). I've been testing a strategy on Sim account in real time since yesterday night (Utc). There was an erroneous "exit on session close" today at about 4 AM (Utc). Please, look at the pictures with my settings. Note, that I have 'Tools-Options-General-Time zone' set to UTC. No other specific settings. And have a look at the Excel file with the Strategy Performance exported data.

    Just in case, my strategy code settings are standard:

    Code:
    if (State == State.SetDefaults)
    {
        Name                                        = "NGenicClientStrategy";
        Calculate                                    = Calculate.OnPriceChange;
        EntriesPerDirection                            = 1;
        EntryHandling                                = EntryHandling.AllEntries;
        IsExitOnSessionCloseStrategy                = true;
        ExitOnSessionCloseSeconds                    = 60;
        IsFillLimitOnTouch                            = false;
        MaximumBarsLookBack                            = MaximumBarsLookBack.TwoHundredFiftySix;
        OrderFillResolution                            = OrderFillResolution.Standard;
        Slippage                                    = 0;
        StartBehavior                                = StartBehavior.AdoptAccountPosition;
        TimeInForce                                    = TimeInForce.Gtc;
        TraceOrders                                    = false;
        RealtimeErrorHandling                        = RealtimeErrorHandling.StopCancelClose;
        StopTargetHandling                            = StopTargetHandling.PerEntryExecution;
        BarsRequiredToTrade                            = 0;
    }
    There are no code statements or calls that can force the strategy to exit on session close unexpectedly. In fact the strategy code is very simple, it just uses some external signals to submit orders, there is no space for errors and it works perfectly.

    I think there is a bug in NT related to general time zone settings. Please check it.
    Attached Files
    Last edited by quicktrick; 04-21-2017, 04:57 AM.

    #2
    Hello quicktrick,

    Could you please send an email to platformsupport[at]ninjatrader[dot]com with Attn: Alan P in the Subject line. Also within the email please include a link to this thread, and attach the log and trace files for the day in subject which you can find in My Documents>NinjaTrader8>Log and My Documents>NinjaTrader8/Trace folders.

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

    Comment


      #3
      Hello Alan,

      I found the problem. I have my general time zone setting set to UTC, my Data Series "Trading hours" template set to "Default 24 x 7" and the ES instrument "Trading hours" template set to default "CME US Index Futures ETH".

      I expected "exit on session close" 30 seconds before the instrument trading hours EOD (about 21:00 UTC). But it exits at Data Series trading hours EOD (about 4:00 UTC). So I should change the Data Series trading hours template to get the desired (btw, "Default 24 x 7" and "CME US Index Futures ETH" templates are in different time zones, and it's confusing too).

      My bad, sorry for this issue. I think you should describe this behavior more clearly here http://ninjatrader.com/support/helpG...oseseconds.htm, because it refers to some "strategy's Trading Hours template", but, to be honest, I don't know what it means.

      Sorry again for the inconvenience.

      Alex
      Last edited by quicktrick; 04-25-2017, 03:32 AM.

      Comment


        #4
        Hello Alex,

        Thank you for following up.

        I will submit a feature request which suggests the help guide be more clear that Exit On Close will look at the end time of the Trading hours template chosen in the data series the strategy is applied to rather than the instrument. For example if the strategy is applied to ES, which has a trading hours template of default 24x7 selected, exit on close set to 60 seconds will exit at 9:59PM MST time rather than 2:59PM.

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

        Comment

        Latest Posts

        Collapse

        Topics Statistics Last Post
        Started by CortexZenUSA, Today, 12:53 AM
        0 responses
        1 view
        0 likes
        Last Post CortexZenUSA  
        Started by CortexZenUSA, Today, 12:46 AM
        0 responses
        1 view
        0 likes
        Last Post CortexZenUSA  
        Started by usazencortex, Today, 12:43 AM
        0 responses
        5 views
        0 likes
        Last Post usazencortex  
        Started by sidlercom80, 10-28-2023, 08:49 AM
        168 responses
        2,266 views
        0 likes
        Last Post sidlercom80  
        Started by Barry Milan, Yesterday, 10:35 PM
        3 responses
        13 views
        0 likes
        Last Post NinjaTrader_Manfred  
        Working...
        X