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 argusthome, Yesterday, 10:06 AM
    0 responses
    20 views
    0 likes
    Last Post argusthome  
    Started by NabilKhattabi, 03-06-2026, 11:18 AM
    0 responses
    18 views
    0 likes
    Last Post NabilKhattabi  
    Started by Deep42, 03-06-2026, 12:28 AM
    0 responses
    14 views
    0 likes
    Last Post Deep42
    by Deep42
     
    Started by TheRealMorford, 03-05-2026, 06:15 PM
    0 responses
    9 views
    0 likes
    Last Post TheRealMorford  
    Started by Mindset, 02-28-2026, 06:16 AM
    0 responses
    38 views
    0 likes
    Last Post Mindset
    by Mindset
     
    Working...
    X