Announcement

Collapse

Looking for a User App or Add-On built by the NinjaTrader community?

Visit NinjaTrader EcoSystem and our free User App Share!

Have a question for the NinjaScript developer community? Open a new thread in our NinjaScript File Sharing Discussion Forum!
See more
See less

Partner 728x90

Collapse

Problem with Time

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

  • NinjaTrader_Matthew
    replied
    You can use BarsSinceSession to get the bar number:



    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

    Leave a comment:


  • elitetradernyc
    started a topic Problem with Time

    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?

Latest Posts

Collapse

Topics Statistics Last Post
Started by geddyisodin, 04-25-2024, 05:20 AM
8 responses
60 views
0 likes
Last Post NinjaTrader_Gaby  
Started by jxs_xrj, 01-12-2020, 09:49 AM
4 responses
3,287 views
1 like
Last Post jgualdronc  
Started by Option Whisperer, Today, 09:55 AM
0 responses
5 views
0 likes
Last Post Option Whisperer  
Started by halgo_boulder, 04-20-2024, 08:44 AM
2 responses
22 views
0 likes
Last Post halgo_boulder  
Started by mishhh, 05-25-2010, 08:54 AM
19 responses
6,189 views
0 likes
Last Post rene69851  
Working...
X