Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Minutes of a bar

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

    Minutes of a bar

    Hello,

    is it possible to retrieve how many minutes has a bar in total? I don't mean when a bar is supposed to end. I need to know the time of a bar in a strategy.

    #2
    Hello guillembm,

    Thank you for your note.

    The following would print to the output window the time frame, for example 60 minute, of the bar series the strategy/indicator is running on.

    Code:
    Print(Bars.BarsPeriod.ToString());
    Please let us know if you need further assistance.
    Alan P.NinjaTrader Customer Service

    Comment


      #3
      This doesn't seem to be supported.

      I get this error: "'NinjaTrader.Data.Bars' does not contain a definition for 'BarsPeriod' and no extension method 'BarsPeriod' accepting a first argument of type 'NinjaTrader.Data.Bars' could be found (are you missing a using directive or an assembly reference?)"

      Comment


        #4
        Try,

        Code:
        Print("BarInterval="+BarsPeriod.Value.ToString());

        Comment

        Latest Posts

        Collapse

        Topics Statistics Last Post
        Started by rdtdale, Yesterday, 01:02 PM
        2 responses
        15 views
        0 likes
        Last Post rdtdale
        by rdtdale
         
        Started by TradeSaber, Today, 07:18 AM
        0 responses
        7 views
        0 likes
        Last Post TradeSaber  
        Started by PaulMohn, Today, 05:00 AM
        0 responses
        9 views
        0 likes
        Last Post PaulMohn  
        Started by ZenCortexAuCost, Today, 04:24 AM
        0 responses
        6 views
        0 likes
        Last Post ZenCortexAuCost  
        Started by ZenCortexAuCost, Today, 04:22 AM
        0 responses
        3 views
        0 likes
        Last Post ZenCortexAuCost  
        Working...
        X