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

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, 10: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 RubenCazorla, 08-30-2022, 06:36 AM
        3 responses
        77 views
        0 likes
        Last Post PaulMohn  
        Started by f.saeidi, Yesterday, 12:14 PM
        9 responses
        23 views
        0 likes
        Last Post f.saeidi  
        Started by Tim-c, Today, 03:54 AM
        0 responses
        3 views
        0 likes
        Last Post Tim-c
        by Tim-c
         
        Started by FrancisMorro, Today, 03:24 AM
        0 responses
        4 views
        0 likes
        Last Post FrancisMorro  
        Started by Segwin, 05-07-2018, 02:15 PM
        10 responses
        1,772 views
        0 likes
        Last Post Leafcutter  
        Working...
        X