• If this is your first visit, you will have to register before you can post. To view messages, please scroll below and select the forum that you would like to visits. Questions? Be sure to check out the Forum FAQ.

Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Prining from multiseries chart

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

    Prining from multiseries chart

    Hi everyone

    I have a chart with two series:

    1) 30 second bars (primary), and

    2) 650 Renko bars

    In Initialize in a Strategy, I have this:

    Code:
    Add(PeriodType.Second, 30);
    AddRenko("^DJIA", 650, MarketDataType.Last);
    Then, in OnBarUpdate, I've put:

    Code:
    Print(Closes[0][0]);
    Print(Closes[1][0]);
    In the Output window, it appears to be printing new data for each tick - so there's a vast number of lines of data, most of it repeated.

    What I'd like, is an output giving data only for every 30-second bar with the corresponding Renko levels at those intervals.

    Much obliged in advance for any help with this.

    * If the 650 Renko looks big, it's because this is a ^DJIA chart - the Dow cash - and 650 in this is about 3 in the ES.)

    #2
    Hello,

    Thank you for your post.

    What is the period type and value the indicator or strategy is applied to? (ie. The Input Series)
    Patrick H.NinjaTrader Customer Service

    Comment


      #3
      Thanks very much for your reply, Patrick.

      To answer your questions, the series on the chart are exactly those ‘added’ in Initialize:

      Primary series: 30 seconds
      Secondary: 650 Renko.

      The sole object of this strategy is to print out the values of the two series, so I can take the data over to Excel and do an analysis.

      Since receiving your reply, I’ve changed round the series on the chart to make the Renko the primary series, and it now appears to work fine.

      So, is there a possible reason why the method didn’t seem to work well with the ‘seconds’ series as primary?

      Also, is it necessary to ‘add’ the primary series in Initialize, or should only the secondary series be ‘added’ there?

      Thanks in advance.

      Comment


        #4
        Hello arbuthnot,

        Thank you for your response.

        The Primary series is the instrument and period type you select when enabling the Strategy (either on the chart or the Strategies tab). Whichever series is added first in the code is the primary series and referencing Closes[0][0] actually references the primary series - being the chart or the Instrument selected on the Strategies tab.

        So if I want to reference the two series I would need the following (assuming I added the 30 second bar series first):
        Code:
        Print(Closes[1][0]); // prints the 30 second bar series close
        Print(Closes[2][0]); // prints the 650 renko bar close
        If you want to reference the primary series, it needs to be the instrument and period type the strategy is applied to and not added in the code.
        Patrick H.NinjaTrader Customer Service

        Comment


          #5
          Thanks once more, Patrick, that's very helpful.

          Comment

          Latest Posts

          Collapse

          Topics Statistics Last Post
          Started by indy73, Today, 04:42 PM
          0 responses
          9 views
          0 likes
          Last Post indy73
          by indy73
           
          Started by Italianforex, Today, 06:20 AM
          2 responses
          12 views
          0 likes
          Last Post gplatis
          by gplatis
           
          Started by alextrd, Today, 01:51 PM
          1 response
          13 views
          0 likes
          Last Post NinjaTrader_JoshG  
          Started by Boonfly8, Today, 12:10 PM
          1 response
          5 views
          0 likes
          Last Post NinjaTrader_Jesse  
          Started by NinjaTrader_PaulH, Today, 11:24 AM
          0 responses
          7 views
          0 likes
          Last Post NinjaTrader_PaulH  
          Working...
          X