Announcement

Collapse
No announcement yet.

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.
    BrettNinjaTrader Product Management

    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.
        BrettNinjaTrader Product Management

        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 Geovanny Suaza, 02-11-2026, 06:32 PM
            0 responses
            605 views
            0 likes
            Last Post Geovanny Suaza  
            Started by Geovanny Suaza, 02-11-2026, 05:51 PM
            0 responses
            351 views
            1 like
            Last Post Geovanny Suaza  
            Started by Mindset, 02-09-2026, 11:44 AM
            0 responses
            105 views
            0 likes
            Last Post Mindset
            by Mindset
             
            Started by Geovanny Suaza, 02-02-2026, 12:30 PM
            0 responses
            560 views
            1 like
            Last Post Geovanny Suaza  
            Started by RFrosty, 01-28-2026, 06:49 PM
            0 responses
            561 views
            1 like
            Last Post RFrosty
            by RFrosty
             
            Working...
            X