Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

How to get the current chart data Series info?

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

    How to get the current chart data Series info?

    for example, if the current chart is 5 minute, 30 minute, or 1 day.

    which function in script can get this info? Thanks

    #2
    Hello LadGta2018,

    Thanks for your post.

    This can be found with the BarsPeriod property of the script. This should be accessed only after State.DataLoaded has passed.

    BarsPeriod - https://ninjatrader.com/support/help...barsperiod.htm

    The instrument can be read from the Instrument object.

    Instrument - https://ninjatrader.com/support/help...instrument.htm

    We look forward to assisting.

    Comment


      #3
      Originally posted by NinjaTrader_Jim View Post
      Hello LadGta2018,

      Thanks for your post.

      This can be found with the BarsPeriod property of the script. This should be accessed only after State.DataLoaded has passed.

      BarsPeriod - https://ninjatrader.com/support/help...barsperiod.htm

      The instrument can be read from the Instrument object.

      Instrument - https://ninjatrader.com/support/help...instrument.htm

      We look forward to assisting.

      Thanks for your help. Could you show me some code how to get string of Instrument and BarsPeriod? like: "This Chart is SPY 30 Min"


      I tried to use:

      TextString = "This Chart is " + Instrument.MasterInstrument.Name + BarsPeriod.BaseBarsPeriodValue + "Min";

      but I got error:

      "operator "+" cannot be applied to operands of type "method group" and "string"

      Comment


        #4
        Already fixed my code. Thanks

        Comment

        Latest Posts

        Collapse

        Topics Statistics Last Post
        Started by Geovanny Suaza, 02-11-2026, 06:32 PM
        0 responses
        649 views
        0 likes
        Last Post Geovanny Suaza  
        Started by Geovanny Suaza, 02-11-2026, 05:51 PM
        0 responses
        370 views
        1 like
        Last Post Geovanny Suaza  
        Started by Mindset, 02-09-2026, 11:44 AM
        0 responses
        109 views
        0 likes
        Last Post Mindset
        by Mindset
         
        Started by Geovanny Suaza, 02-02-2026, 12:30 PM
        0 responses
        574 views
        1 like
        Last Post Geovanny Suaza  
        Started by RFrosty, 01-28-2026, 06:49 PM
        0 responses
        576 views
        1 like
        Last Post RFrosty
        by RFrosty
         
        Working...
        X