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

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 llanqui, Today, 11:13 AM
          4 responses
          6 views
          0 likes
          Last Post llanqui
          by llanqui
           
          Started by samish18, 04-17-2024, 08:57 AM
          27 responses
          117 views
          0 likes
          Last Post NinjaTrader_BrandonH  
          Started by ETFVoyageur, 04-30-2024, 02:04 PM
          7 responses
          45 views
          0 likes
          Last Post eDanny
          by eDanny
           
          Started by f.saeidi, Today, 07:07 AM
          5 responses
          16 views
          0 likes
          Last Post NinjaTrader_ChelseaB  
          Started by Creamers, 04-27-2024, 05:32 AM
          9 responses
          60 views
          0 likes
          Last Post Creamers  
          Working...
          X