NexusFi: Find Your Edge


Home Menu

 





Bar Time


Discussion in NinjaTrader

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




 
Search this Thread

Bar Time

  #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?
Increase in trading performance by 75%
The Elite Circle
Pivot Indicator like the old SwingTemp by Big Mike
NinjaTrader
How to apply profiles
Traders Hideout
NT7 Indicator Script Troubleshooting - Camarilla Pivots
NinjaTrader
PowerLanguage & EasyLanguage. How to get the platfor …
EasyLanguage Programming
 
Best Threads (Most Thanked)
in the last 7 days on NexusFi
Just another trading journal: PA, Wyckoff & Trends
31 thanks
Spoo-nalysis ES e-mini futures S&P 500
28 thanks
Tao te Trade: way of the WLD
24 thanks
Bigger Wins or Fewer Losses?
20 thanks
GFIs1 1 DAX trade per day journal
17 thanks
  #3 (permalink)
 
vvhg's Avatar
 vvhg 
Northern Germany
 
Experience: Intermediate
Platform: NT
Trading: FDAX, CL
Posts: 1,583 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,442 since Jun 2009
Thanks Given: 33,215
Thanks Received: 101,602

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

Mike

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,583 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,583 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