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

Do not exit on close

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

    Do not exit on close

    Hi,

    I am new to the platform and at present I am back testing some strats. On the back tester, the theoretical positions are closed at the end of each day. My strategy works with overnight positions being held, my question is how can i do this on the back test system to ensure the most correct results once i put this strat live?

    Thanks in advance

    #2
    Hello,

    Thank you for the question.

    If you want to use overnight hours, you would need to disable the Exit on Close if you do not wish to exit at the close of the session. This can be found when you configure the strategy in the "Order Handling" section. Set Exit On Close to False.

    Also the Session template you use will matter, if the instrument by default does not trade overnight, you would need to change the session template from <Use Instrument Settings> to either Default 24/5 or 24/7 or create a custom session template for the times needed.

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

    Comment


      #3
      Overnight continued

      To add a session template to the Add series I believe that:

      AddDataSeries(string instrumentName, BarsPeriod barsPeriod, string tradingHoursName)



      AddDataSeries("ES 06-18", BarsPeriod barsPeriod, "CME US Index Futures RTH")


      The Barsperiod barsperiod imput is unclear to me...I need an example - many thanks
      Last edited by elliot5; 04-17-2018, 06:00 AM.

      Comment


        #4
        Hello everington_f,

        Thank you for the reply.

        This overload pattern is new with NT8. It looks like we are in the NT7 subforum so I will move this post to the NT8 subforum.

        Regarding AddDataSeries and the BarsPeriod overload, there is actually a sample in the Tips area on the AddDataSeries page. Here is the sample:

        Code:
        AddDataSeries(new BarsPeriod() { BarsPeriodType = (BarsPeriodType)14, Value = 10, Value2 = 20 });
        The BarsPeriod can have its various properties set between the { and }.

        To find the id of the BarsTypes you have, you can use the following indicator:



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

        Comment


          #5
          AddDataSeries("ES 03-18", new BarsPeriod { BarsPeriodType = BarsPeriodType.Minute, Value = 4 }, "US Index Futures RTH");

          thankyou very much.
          Last edited by elliot5; 04-17-2018, 08:24 AM.

          Comment

          Latest Posts

          Collapse

          Topics Statistics Last Post
          Started by DavidHP, Today, 07:56 AM
          1 response
          5 views
          0 likes
          Last Post NinjaTrader_Erick  
          Started by kujista, Today, 06:23 AM
          3 responses
          6 views
          0 likes
          Last Post kujista
          by kujista
           
          Started by Mindset, Yesterday, 02:04 AM
          2 responses
          17 views
          0 likes
          Last Post NinjaTrader_RyanS  
          Started by f.saeidi, Today, 08:03 AM
          1 response
          5 views
          0 likes
          Last Post NinjaTrader_Jesse  
          Started by samish18, 04-17-2024, 08:57 AM
          15 responses
          52 views
          0 likes
          Last Post NinjaTrader_BrandonH  
          Working...
          X