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,434 views
    2. thumb_up 1 thanks given
    3. group 2 followers
    1. forum 7 posts
    2. attach_file 0 attachments




 
 

Bar Time

 
 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

Can you help answer these questions
from other members on NexusFi?
What broker to use for trading palladium futures
Commodities
NT7 Indicator Script Troubleshooting - Camarilla Pivots
NinjaTrader
Cheap historycal L1 data for stocks
Stocks and ETFs
MC PL editor upgrade
MultiCharts
Pivot Indicator like the old SwingTemp by Big Mike
NinjaTrader
 
 
 
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.
 
 
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,470 since Jun 2009
Thanks Given: 33,250
Thanks Received: 101,673

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

Mike



Join the free Markets Chat beta: one platform, all the trade rooms!

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
 
 
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.
 
 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
 
 
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.
Thanked by:
 
 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

 



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