Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Printing data on two series on same chart

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

    Printing data on two series on same chart

    Hi everyone

    On a chart, I have two data series:

    - Panel 1: time-based bars

    - Panel 2: Renko bars

    What I would like to do is print out (per the Output window) the closing price and time of each time based bar, and likewise for each Renko bar.

    I know how to print data for a chart with just one series but, having looked through Help, I'm still not too clear how to do this for multiple series.

    Any assistance will be be much appreciated.

    #2
    Hello Arbuthnot,

    Thank you for your post.

    You would need to use the AddRenko() and Add() for any extra instruments or timeframes to get that information.

    Then you can use Closes[][] and Times[][] to get the closing price and time of the data series you want to get.

    We have sample built into NinjaTrader, Tools -> Edit NinjaScript -> Strategies -> SampleMultiTimeframe

    Additionally here are links on getting started with Multiple Timeframes -
    http://www.ninjatrader.com/support/h...nstruments.htm
    http://www.ninjatrader.com/support/h...tml?closes.htm
    http://www.ninjatrader.com/support/h...l?addrenko.htm

    Let me know if I can be of further assistance.
    Cal H.NinjaTrader Customer Service

    Comment


      #3
      Thanks very much, Cal. That's very helpful.

      I'll only come back to you if I really get stuck!

      Comment


        #4
        Hi again, Cal

        I'm half-way there now, I think, but I'm stuck when it comes to formatting.

        I have a $EURUSD chart with a) Renko (as primary series) and b) 30-Second bars

        In Initialize(), I've put:

        Code:
        Add(PeriodType.Second, 30);
        In OnBarUpdate(), I've put:

        Code:
                    Print("Renko" );
                    Print(Times[0][0].Ticks );
                    Print(Closes[0][0]);
                    Print("Seconds" );
                    Print(Times[1][0].Ticks );
                    Print(Closes[1][0]);
        This is the output I get:

        Renko
        6.3536816466E+17
        1.3635
        Seconds
        6.353682138E+17
        1.3633
        The times are in a strange format. I'd like these to be in C#."ToString("T")" format, such as 10:11:29 PM.

        I can do this for the 'Time' method, but this doesn't seem to work for 'Times'. Could you kindly show me how to do this.

        Thanks again, Cal.

        Comment


          #5
          You wouldn't want to do the .Ticks as this will be a very obscure value.

          The Times[0][0] will return MM\DD\YYYY HH:MM:SS structure when called.

          You can use Print(Times[0][0].ToShortTimeString()); to get just the time and not include the date.
          Cal H.NinjaTrader Customer Service

          Comment


            #6
            That's exactly what I wanted.

            Much obliged, Cal.
            Last edited by arbuthnot; 05-27-2014, 02:43 PM.

            Comment

            Latest Posts

            Collapse

            Topics Statistics Last Post
            Started by Geovanny Suaza, 02-11-2026, 06:32 PM
            0 responses
            558 views
            0 likes
            Last Post Geovanny Suaza  
            Started by Geovanny Suaza, 02-11-2026, 05:51 PM
            0 responses
            324 views
            1 like
            Last Post Geovanny Suaza  
            Started by Mindset, 02-09-2026, 11:44 AM
            0 responses
            101 views
            0 likes
            Last Post Mindset
            by Mindset
             
            Started by Geovanny Suaza, 02-02-2026, 12:30 PM
            0 responses
            545 views
            1 like
            Last Post Geovanny Suaza  
            Started by RFrosty, 01-28-2026, 06:49 PM
            0 responses
            547 views
            1 like
            Last Post RFrosty
            by RFrosty
             
            Working...
            X