NexusFi: Find Your Edge


Home Menu

 





Bar Time


Discussion in NinjaTrader

Updated
      Top Posters
    1. looks_one FTrader with 3 posts (0 thanks)
    2. looks_two vvhg with 3 posts (1 thanks)
    3. looks_3 Big Mike with 1 posts (0 thanks)
    4. looks_4 Quick Summary with 1 posts (0 thanks)
    1. trending_up 4,468 views
    2. thumb_up 1 thanks given
    3. group 2 followers
    1. forum 7 posts
    2. attach_file 0 attachments




 
Search this Thread
  #1 (permalink)
 FTrader 
Munich
 
Experience: Advanced
Platform: NinjaTrader
Posts: 12 since Apr 2010
Thanks Given: 3
Thanks Received: 1

Hello,

how can I get the datetime value of a time based bar in NinjaTrader?

Started this thread Reply With Quote

Can you help answer these questions
from other members on NexusFi?
How to plot a custom icon for crossover
NinjaTrader
MC Advanced Simulated Trading.
MultiCharts
Pivot Indicator based on Level2 data
NinjaTrader
Help re translation of ninjascript to EL
NinjaTrader
tick data interval discrepancy
NinjaTrader
 
  #3 (permalink)
 
vvhg's Avatar
 vvhg 
Northern Germany
 
Experience: Intermediate
Platform: NT
Trading: FDAX, CL
Posts: 1,580 since Mar 2011
Thanks Given: 1,016
Thanks Received: 2,824



FTrader View Post
Hello,

how can I get the datetime value of a time based bar in NinjaTrader?

You want to use:
 
Code
Time[n]
where n is the barsago you want to access.

vvhg

Hic Rhodos, hic salta.
Reply With Quote
  #4 (permalink)
 
Big Mike's Avatar
 Big Mike 
Manta, Ecuador
Site Administrator
Developer
Swing Trader
 
Experience: Advanced
Platform: Custom solution
Broker: IBKR
Trading: Stocks & Futures
Frequency: Every few days
Duration: Weeks
Posts: 50,607 since Jun 2009
Thanks Given: 33,344
Thanks Received: 101,970

Also possibly GetBar() depending on your exact requirements, which you didn't really specify.

Mike



Join the free Markets Chat beta: Real-time Trading Insights

We're here to help: just ask the community or contact our Help Desk

Quick Links: Change your Username or Register as a Vendor
Searching for trading reviews? Review this list
Lifetime Elite Membership: Sign-up for only $149 USD
Exclusive money saving offers from our Site Sponsors: Browse Offers
Report problems with the site: Using the NexusFi changelog thread
Follow me on Twitter Visit my NexusFi Trade Journal Reply With Quote
  #5 (permalink)
 
vvhg's Avatar
 vvhg 
Northern Germany
 
Experience: Intermediate
Platform: NT
Trading: FDAX, CL
Posts: 1,580 since Mar 2011
Thanks Given: 1,016
Thanks Received: 2,824


Big Mike View Post
Also possibly GetBar() depending on your exact requirements, which you didn't really specify.

Mike

Well, GetBar() does the exact opposite and retrieves the BarsAgo for a DateTime.

vvhg

Hic Rhodos, hic salta.
Reply With Quote
  #6 (permalink)
 FTrader 
Munich
 
Experience: Advanced
Platform: NinjaTrader
Posts: 12 since Apr 2010
Thanks Given: 3
Thanks Received: 1

Thanks for your help, but when I read Time[0], I get '01.01.1800 00:00:00'.
The reason I want to read these values: I store bar values and some indicator values in a database. When I have to reload the chart, all old values are processed again. To avoid this, I want to use the bar time.

Started this thread Reply With Quote
  #7 (permalink)
 
vvhg's Avatar
 vvhg 
Northern Germany
 
Experience: Intermediate
Platform: NT
Trading: FDAX, CL
Posts: 1,580 since Mar 2011
Thanks Given: 1,016
Thanks Received: 2,824


FTrader View Post
Thanks for your help, but when I read Time[0], I get '01.01.1800 00:00:00'.
The reason I want to read these values: I store bar values and some indicator values in a database. When I have to reload the chart, all old values are processed again. To avoid this, I want to use the bar time.

So you don't want to process any historical data? Or just some? If it's the former you can use
 
Code
if (Historical) return;
vvhg

Hic Rhodos, hic salta.
Reply With Quote
Thanked by:
  #8 (permalink)
 FTrader 
Munich
 
Experience: Advanced
Platform: NinjaTrader
Posts: 12 since Apr 2010
Thanks Given: 3
Thanks Received: 1

Thanks,
this solved the problem.

Started this thread Reply With Quote




Last Updated on October 30, 2012


© 2024 NexusFi™, s.a., All Rights Reserved.
Av Ricardo J. Alfaro, Century Tower, Panama City, Panama, Ph: +507 833-9432 (Panama and Intl), +1 888-312-3001 (USA and Canada)
All information is for educational use only and is not investment advice. There is a substantial risk of loss in trading commodity futures, stocks, options and foreign exchange products. Past performance is not indicative of future results.
About Us - Contact Us - Site Rules, Acceptable Use, and Terms and Conditions - Privacy Policy - Downloads - Top
no new posts