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

How to add second, variable datastream to v7 indicator

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

    How to add second, variable datastream to v7 indicator

    Hi,

    I can add a second datastream to an indicator OK.

    Code:
     
    [FONT=Courier New][COLOR=#0000ff][FONT=Courier New][COLOR=#0000ff][FONT=Courier New][COLOR=#0000ff]protected [/COLOR][/FONT][/COLOR][/FONT][/COLOR][/FONT][FONT=Courier New][COLOR=#0000ff][FONT=Courier New][COLOR=#0000ff][FONT=Courier New][COLOR=#0000ff]override [/COLOR][/FONT][/COLOR][/FONT][/COLOR][/FONT][FONT=Courier New][COLOR=#0000ff][FONT=Courier New][COLOR=#0000ff][FONT=Courier New][COLOR=#0000ff]void[/COLOR][/FONT][/COLOR][/FONT][/COLOR][/FONT][FONT=Courier New][FONT=Courier New][COLOR=#000000] Initialize()[/COLOR][/FONT]
    [FONT=Courier New]{[/FONT][/FONT]
    [FONT=Courier New][FONT=Courier New]Add([/FONT][/FONT][FONT=Courier New][COLOR=#800000][FONT=Courier New][COLOR=#800000][FONT=Courier New][COLOR=#800000]"^TICK"[/COLOR][/FONT][/COLOR][/FONT][/COLOR][/FONT][FONT=Courier New][FONT=Courier New], PeriodType.Tick, [/FONT][/FONT][FONT=Courier New][COLOR=#800080][FONT=Courier New][COLOR=#800080][FONT=Courier New][COLOR=#800080]150[/COLOR][/FONT][/COLOR][/FONT][/COLOR][/FONT][FONT=Courier New][FONT=Courier New]);[/FONT][/FONT]
    [FONT=Courier New][FONT=Courier New]}[/FONT][/FONT]
    But I want to make the PeriodType and the Interval dependent on the underlying chart. So, if my underlying chart were 5 minutes I want my second datastream to by ^TICK 5 minutes.

    It says specifically in the documentation that I shouldn't use variables in the Initialize() section, so how do I achieve this?

    Thanks
    Last edited by bubblegum; 06-02-2010, 07:21 AM.

    #2
    Hello,

    Thank you for your first forum post!

    Unfortunately though this is not supported, as there are no bar objects in the Initialize to pull from at that point.

    What you can do is add user defined inputs when you add the strategy to set these manually when you first add the strategy. Let me know if you need further information on how to do this if this is what you want to do.



    Let me know if I can be of further assistance.

    Comment


      #3
      Thank you.

      Can this be added as an Enhancement Suggestion somewhere?

      Comment


        #4
        Hello,

        Absolutely, I will get this sent to development for their consideration.

        Thank You.

        Comment


          #5
          Want it as well

          Originally posted by NinjaTrader_Brett View Post
          Hello,

          Absolutely, I will get this sent to development for their consideration.

          Thank You.
          This is something I would like as well - would appreciate this to be added into the next release.

          Comment


            #6
            Thanks for the suggestion, Molecool.
            Ryan M.NinjaTrader Customer Service

            Comment

            Latest Posts

            Collapse

            Topics Statistics Last Post
            Started by hazylizard, Today, 08:38 AM
            1 response
            8 views
            0 likes
            Last Post hazylizard  
            Started by geddyisodin, Today, 05:20 AM
            2 responses
            17 views
            0 likes
            Last Post geddyisodin  
            Started by Max238, Today, 01:28 AM
            5 responses
            45 views
            0 likes
            Last Post Max238
            by Max238
             
            Started by giulyko00, Yesterday, 12:03 PM
            3 responses
            13 views
            0 likes
            Last Post NinjaTrader_BrandonH  
            Started by habeebft, Today, 07:27 AM
            1 response
            16 views
            0 likes
            Last Post NinjaTrader_ChristopherS  
            Working...
            X