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 sjsj2732, Yesterday, 04:31 AM
          0 responses
          38 views
          0 likes
          Last Post sjsj2732  
          Started by NullPointStrategies, 03-13-2026, 05:17 AM
          0 responses
          287 views
          0 likes
          Last Post NullPointStrategies  
          Started by argusthome, 03-08-2026, 10:06 AM
          0 responses
          288 views
          0 likes
          Last Post argusthome  
          Started by NabilKhattabi, 03-06-2026, 11:18 AM
          0 responses
          134 views
          1 like
          Last Post NabilKhattabi  
          Started by Deep42, 03-06-2026, 12:28 AM
          0 responses
          95 views
          0 likes
          Last Post Deep42
          by Deep42
           
          Working...
          X