• 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

Minutes of a bar

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

  • guillembm
    started a topic Minutes of a bar

    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.

  • bltdavid
    replied
    Try,

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

    Leave a comment:


  • guillembm
    replied
    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?)"

    Leave a comment:


  • NinjaTrader_AlanP
    replied
    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.

    Leave a comment:

Latest Posts

Collapse

Topics Statistics Last Post
Started by fredfred, Today, 03:41 AM
3 responses
11 views
0 likes
Last Post NinjaTrader_ChristopherS  
Started by TraderYoda, Today, 03:33 AM
0 responses
2 views
0 likes
Last Post TraderYoda  
Started by pjsmith, Today, 02:56 AM
0 responses
5 views
0 likes
Last Post pjsmith
by pjsmith
 
Started by ntbone, Yesterday, 08:10 PM
0 responses
12 views
0 likes
Last Post ntbone
by ntbone
 
Started by chrislou, 08-28-2015, 03:27 AM
14 responses
2,884 views
0 likes
Last Post nkhoi
by nkhoi
 
Working...
X