• 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

Problem with Time

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

    Problem with Time

    Hey guys, I'm still having an issue with the trade Time and/or bar # for a day:

    When I use this code in a backtest, it assumes that all trades occurred at the same time i.e. whatever time im running the backtest:

    if (ToTime(Time[0]) >= 125500

    Is there a way to refer to the actual trade time, or else the # of bars that have occurred since that trading days opening bar? For example market opens 930am, thats bar 1, then next 30 minutes bar 2, next 30 minutes bar 3, etc?

    #2
    You can use BarsSinceSession to get the bar number:

    http://www.ninjatrader.com/support/h...ncesession.htm

    This will be based off the session template you're using. If you'd like to start the count at 9:30AM, you'd need to use an existing session template that starts at 9:30AM, or create a custom session template under Tools--> Session Manager
    MatthewNinjaTrader Product Management

    Comment

    Latest Posts

    Collapse

    Topics Statistics Last Post
    Started by Ringo, Today, 04:50 AM
    0 responses
    11 views
    0 likes
    Last Post Ringo
    by Ringo
     
    Started by zulok, Today, 04:44 AM
    0 responses
    7 views
    0 likes
    Last Post zulok
    by zulok
     
    Started by Skyfly1715, Yesterday, 03:36 PM
    1 response
    13 views
    0 likes
    Last Post NinjaTrader_Marco  
    Started by samatron, Yesterday, 09:49 PM
    1 response
    15 views
    0 likes
    Last Post NinjaTrader_ChrisSch  
    Started by Dr3am, Yesterday, 05:10 PM
    1 response
    11 views
    0 likes
    Last Post NinjaTrader_ChrisSch  
    Working...
    X