• If this is your first visit, you will have to register before you can post. To view messages, please scroll below and select the forum that you would like to visits. Questions? Be sure to check out the Forum FAQ.

Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

No exit on session close in historical run.

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

    No exit on session close in historical run.


    the strategy is set to exit on session close 180sec. when I initiate it just before today's new session starts, it runs through the history of a few days and then waits for the realtime session start.
    I can see the trades marked as closed in history of the 2 days ago exactly like they should .
    but the yesterday trade is NOT closed at session end. and only at the first tick of the REAL TIME session (today's) is executes the EXIT trade.

    I assume settings of the trading hours are correct. otherwise it would also have issues in history even before yesterday.
    So what can be the issue?

    #2
    Hello dadarara,

    Thanks for your post.

    Could you confirm the instrument this has occured on?

    When you test this against other instruments do you see the same issue?

    Yesterday was a quickly scheduled trading holiday and our Trading Hours templates were not updated to reflect yesterday's early closes.

    I look forward to being of further assistance.
    JimNinjaTrader Customer Service

    Comment


      #3
      it happened on various stocks I am working on including futures on DAX for example. and it is something that I have seen before yesterday.
      Last edited by dadarara; 12-06-2018, 09:23 AM.

      Comment


        #4
        Hello dadarara,

        Thanks for the reply.

        When I test a sample strategy that simply enters when flat and exits on session close, I see ExitOnSessionCloses as I would expect. Could you confirm if you are getting the same results testing the code below on FDAX?

        Code:
        protected override void OnStateChange()
        {
            if (State == State.SetDefaults)
            {
                Description                                    = @"Enter the description for your new custom Strategy here.";
                Name                                        = "FDAX ExitOnSessionClose Test";
                IsExitOnSessionCloseStrategy                = true;
                ExitOnSessionCloseSeconds                    = 180;
            }
        }
        
        protected override void OnBarUpdate()
        {
            if(Position.MarketPosition == MarketPosition.Flat)
                EnterLong();
        }
        I look forward to being of further assistance.
        Attached Files
        JimNinjaTrader Customer Service

        Comment

        Latest Posts

        Collapse

        Topics Statistics Last Post
        Started by HighTrade, Today, 11:11 AM
        2 responses
        7 views
        0 likes
        Last Post HighTrade  
        Started by cupir2, Today, 09:52 AM
        1 response
        6 views
        0 likes
        Last Post NinjaTrader_JoshG  
        Started by RedDuke, Today, 09:53 AM
        2 responses
        7 views
        0 likes
        Last Post RedDuke
        by RedDuke
         
        Started by dmking, Today, 09:23 AM
        2 responses
        6 views
        0 likes
        Last Post dmking
        by dmking
         
        Started by U0000999, Today, 02:54 AM
        1 response
        12 views
        0 likes
        Last Post NinjaTrader_Jim  
        Working...
        X