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 cmoran13, 04-16-2026, 01:02 PM
            0 responses
            43 views
            0 likes
            Last Post cmoran13  
            Started by PaulMohn, 04-10-2026, 11:11 AM
            0 responses
            25 views
            0 likes
            Last Post PaulMohn  
            Started by CarlTrading, 03-31-2026, 09:41 PM
            1 response
            162 views
            1 like
            Last Post NinjaTrader_ChelseaB  
            Started by CarlTrading, 04-01-2026, 02:41 AM
            0 responses
            98 views
            1 like
            Last Post CarlTrading  
            Started by CaptainJack, 03-31-2026, 11:44 PM
            0 responses
            158 views
            2 likes
            Last Post CaptainJack  
            Working...
            X