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 i2w8am9ii2, Today, 06:29 PM
    2 responses
    7 views
    0 likes
    Last Post i2w8am9ii2  
    Started by Kirk Thorns, Today, 05:34 PM
    0 responses
    6 views
    0 likes
    Last Post Kirk Thorns  
    Started by JobDjassem, Today, 05:24 PM
    0 responses
    11 views
    0 likes
    Last Post JobDjassem  
    Started by Kirk Thorns, Today, 05:06 PM
    0 responses
    12 views
    0 likes
    Last Post Kirk Thorns  
    Started by CyberNate, Today, 03:11 PM
    5 responses
    31 views
    0 likes
    Last Post CyberNate  
    Working...
    X