Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Identify chart information

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

    Identify chart information

    Hello, within ninjascript, I need to identify 3 pieces of info regarding the chart my strategy is running on:

    1) what type of period is being used on that chart (eg, Tick, Minute, Day, etc)
    2) whats the value of the period, eg. "100" tick
    3) and where I'm at within that value, eg, tick 27 of 100

    Can you assist me in locating this information ... thank you!!

    #2
    Hello pman777,

    Thanks for your note.

    1) To get the period type use BarsPeriod.BasePeriodType.

    2) To get the interval value use BarsPeriod.Value

    Below is a link to the help guide language reference on BarsPeriod.
    http://www.ninjatrader.com/support/h...barsperiod.htm

    3) Getting the amount of tick or time remaining would require some work.
    For getting the amount of remaining ticks in a bar I recommend you take a look at the included TickCounter indicator. They accomplish this in the Miscellaneous region in a Plot override.

    For getting the amount of time left in a time based bar I recommend you look at the included BarTimer indicator.

    You could copy the code out of these or you could modify these to return a value when called.


    Please let me know if this does not resolve your inquiry.
    Chelsea B.NinjaTrader Customer Service

    Comment

    Latest Posts

    Collapse

    Topics Statistics Last Post
    Started by charlesugo_1, 05-26-2026, 05:03 PM
    0 responses
    66 views
    0 likes
    Last Post charlesugo_1  
    Started by DannyP96, 05-18-2026, 02:38 PM
    1 response
    149 views
    0 likes
    Last Post NinjaTrader_ChelseaB  
    Started by CarlTrading, 05-11-2026, 05:56 AM
    0 responses
    162 views
    0 likes
    Last Post CarlTrading  
    Started by CarlTrading, 05-10-2026, 08:12 PM
    0 responses
    99 views
    0 likes
    Last Post CarlTrading  
    Started by Hwop38, 05-04-2026, 07:02 PM
    0 responses
    286 views
    0 likes
    Last Post Hwop38
    by Hwop38
     
    Working...
    X