• 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 hir04068, Today, 06:04 AM
    0 responses
    1 view
    0 likes
    Last Post hir04068  
    Started by vitixs, Today, 04:45 AM
    1 response
    11 views
    0 likes
    Last Post NinjaTrader_Marco  
    Started by J4Runner, Yesterday, 07:21 PM
    1 response
    29 views
    0 likes
    Last Post NinjaTrader_Marco  
    Started by dtl-saw, Yesterday, 08:44 PM
    0 responses
    16 views
    0 likes
    Last Post dtl-saw
    by dtl-saw
     
    Started by ballboy11, Yesterday, 04:29 PM
    0 responses
    15 views
    0 likes
    Last Post ballboy11  
    Working...
    X