• If this is your first visit, you will have to register before you can post. To view messages, please scroll below and select the forum that you would like to visits. Questions? Be sure to check out the Forum FAQ.

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...
    http://www.ninjatrader.com/support/h...barsperiod.htm

    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 seagraph, Today, 03:27 PM
        0 responses
        11 views
        0 likes
        Last Post seagraph  
        Started by dedouglas, Today, 02:54 PM
        1 response
        10 views
        0 likes
        Last Post NinjaTrader_Jesse  
        Started by elkhatabi, 08-01-2019, 06:36 PM
        5 responses
        52 views
        0 likes
        Last Post NinjaTrader_RyanL  
        Started by mr_trade, Today, 01:01 PM
        4 responses
        19 views
        0 likes
        Last Post mr_trade  
        Started by Renorail, Today, 12:31 PM
        1 response
        13 views
        0 likes
        Last Post NinjaTrader_PaulH  
        Working...
        X