Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

getting the chart timeframe into an indicator

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

    getting the chart timeframe into an indicator

    How to do I get the chart time-frame from inside an indicator or strategy. For example, say I have a simple strategy and I apply it to a 1-min chart, a 500-tick chart and a 3-range chart. Based on the chart type I may have different stop settings. Then what code should I add to the indicator/strategy to tell me which chart I am using?

    #2
    Originally posted by frannt View Post
    How to do I get the chart time-frame from inside an indicator or strategy. For example, say I have a simple strategy and I apply it to a 1-min chart, a 500-tick chart and a 3-range chart. Based on the chart type I may have different stop settings. Then what code should I add to the indicator/strategy to tell me which chart I am using?
    Hi frannt

    Using NinjaScript items from BarsPeriod (eg BarsPeriod.Id & BarsPeriod.Value ) should achieve what you're after... here is the link to the NinjaTrader help guide...


    Cheers

    Comment


      #3
      Thanks, that was just what I wanted!

      Comment


        #4
        No worries frannt, cheers

        Comment

        Latest Posts

        Collapse

        Topics Statistics Last Post
        Started by CarlTrading, 03-31-2026, 09:41 PM
        1 response
        53 views
        0 likes
        Last Post NinjaTrader_ChelseaB  
        Started by CarlTrading, 04-01-2026, 02:41 AM
        0 responses
        26 views
        0 likes
        Last Post CarlTrading  
        Started by CaptainJack, 03-31-2026, 11:44 PM
        0 responses
        40 views
        1 like
        Last Post CaptainJack  
        Started by CarlTrading, 03-30-2026, 11:51 AM
        0 responses
        56 views
        0 likes
        Last Post CarlTrading  
        Started by CarlTrading, 03-30-2026, 11:48 AM
        0 responses
        46 views
        0 likes
        Last Post CarlTrading  
        Working...
        X