Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

add additional period

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

    add additional period

    Hi,
    How do I calculate a snippet of code on an added periodtype which I added into a strategy, e.g. add(PeriodType.Minute, 5) and the rest of the code on the PeriodType and Period of the chart?
    I tried to add the second Dataseries by add(PeriodType,.Minute, 5), but by just doing that, it messes up my whole drawings ( do not show up any more ). I want to just calculate a little snippet on code on the added period without influencing the rest of the code.

    Thamks in advance.

    #2
    Hello keepsimple,

    Thank you for your post.

    You would separate the code via BarsInProgress: http://www.ninjatrader.com/support/h...inprogress.htm

    Please refer to the following link for further information on multiple series scripts: http://www.ninjatrader.com/support/h...nstruments.htm

    Please let me know if you have any questions.

    Comment


      #3
      Thanks Patrick,

      found the issue, which messed it up, works now.

      One question, how do I make the PeriodType for the additional instrument an input in the strategy properties?

      I have an input for the period, how whould that work for the PeriodType?

      Thanks

      Comment


        #4
        Hello keepsimple,

        Thank you for your response.

        This would require passing either a variable such as a string and then checking that value in Initialize() or developing an enumeration to allow for a drop down menu to select the desired Period Type. The Value can just be an Int.

        For an example of using an enumeration please visit the following link: http://www.ninjatrader.com/support/f...ead.php?t=3420

        For information on user defined variables please visit the following link: http://www.ninjatrader.com/support/f...ead.php?t=5782

        Please let me know if you have any questions.

        Comment


          #5
          Thanks Patrick,

          one of them should work.

          Comment

          Latest Posts

          Collapse

          Topics Statistics Last Post
          Started by Geovanny Suaza, 02-11-2026, 06:32 PM
          0 responses
          558 views
          0 likes
          Last Post Geovanny Suaza  
          Started by Geovanny Suaza, 02-11-2026, 05:51 PM
          0 responses
          324 views
          1 like
          Last Post Geovanny Suaza  
          Started by Mindset, 02-09-2026, 11:44 AM
          0 responses
          101 views
          0 likes
          Last Post Mindset
          by Mindset
           
          Started by Geovanny Suaza, 02-02-2026, 12:30 PM
          0 responses
          545 views
          1 like
          Last Post Geovanny Suaza  
          Started by RFrosty, 01-28-2026, 06:49 PM
          0 responses
          547 views
          1 like
          Last Post RFrosty
          by RFrosty
           
          Working...
          X