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 CarlTrading, 03-31-2026, 09:41 PM
    1 response
    67 views
    0 likes
    Last Post NinjaTrader_ChelseaB  
    Started by CarlTrading, 04-01-2026, 02:41 AM
    0 responses
    36 views
    0 likes
    Last Post CarlTrading  
    Started by CaptainJack, 03-31-2026, 11:44 PM
    0 responses
    60 views
    1 like
    Last Post CaptainJack  
    Started by CarlTrading, 03-30-2026, 11:51 AM
    0 responses
    62 views
    0 likes
    Last Post CarlTrading  
    Started by CarlTrading, 03-30-2026, 11:48 AM
    0 responses
    53 views
    0 likes
    Last Post CarlTrading  
    Working...
    X