• 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 pharofx, Today, 09:30 PM
    0 responses
    10 views
    0 likes
    Last Post pharofx
    by pharofx
     
    Started by swcooke, Today, 08:39 PM
    0 responses
    6 views
    0 likes
    Last Post swcooke
    by swcooke
     
    Started by bboyle1234, Today, 08:10 PM
    1 response
    14 views
    0 likes
    Last Post bboyle1234  
    Started by shodson, 02-11-2020, 07:26 PM
    3 responses
    21 views
    0 likes
    Last Post shodson
    by shodson
     
    Started by ksarin, Today, 04:31 PM
    0 responses
    4 views
    0 likes
    Last Post ksarin
    by ksarin
     
    Working...
    X