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 judysamnt7, 03-13-2023, 09:11 AM
          4 responses
          59 views
          0 likes
          Last Post DynamicTest  
          Started by ScottWalsh, Today, 06:52 PM
          4 responses
          36 views
          0 likes
          Last Post ScottWalsh  
          Started by olisav57, Today, 07:39 PM
          0 responses
          7 views
          0 likes
          Last Post olisav57  
          Started by trilliantrader, Today, 03:01 PM
          2 responses
          21 views
          0 likes
          Last Post helpwanted  
          Started by cre8able, Today, 07:24 PM
          0 responses
          10 views
          0 likes
          Last Post cre8able  
          Working...
          X