NexusFi: Find Your Edge


Home Menu

 





Current Time CME


Discussion in NinjaTrader

Updated
      Top Posters
    1. looks_one mk77ch with 3 posts (0 thanks)
    2. looks_two sam028 with 2 posts (5 thanks)
    3. looks_3 Quick Summary with 1 posts (0 thanks)
    4. looks_4 decs0057 with 1 posts (1 thanks)
    1. trending_up 2,862 views
    2. thumb_up 6 thanks given
    3. group 3 followers
    1. forum 6 posts
    2. attach_file 0 attachments




 
Search this Thread
  #1 (permalink)
 
mk77ch's Avatar
 mk77ch 
Switzerland
 
Experience: Advanced
Platform: NinjaTrader
Broker: Dorman
Trading: Currency Futures, ES
Posts: 162 since Oct 2010
Thanks Given: 30
Thanks Received: 423

Hello,

Im trying to create a little indicator which displays the current time for the e-mini session.
if im right, this would be the time of chicago, the central time zone.

Could anybody tell me how i get this current time?

thank you,
mike

Update:

got it

DateTime UTCLocal = DateTime.Now.ToUniversalTime().AddHours(-5);
DrawTextFixed("time",UTCLocal.ToLongTimeString(),TextPosition.BottomLeft);


Started this thread Reply With Quote

Can you help answer these questions
from other members on NexusFi?
Beijing Summit Closes: Xi Pledges Hormuz Help -- $1.14B …
Prediction Markets & Event Contracts
Orban at 29pct as Hungary Votes Tomorrow -- McIlroy Surg …
Prediction Markets & Event Contracts
The May 31 Binary: 60% Trump Declares Iran Ops Over, Onl …
Prediction Markets & Event Contracts
Topstep Slashes XFA Payout Caps by Up to 60% -- Flagship …
Funded Trading Evaluation Firms
Ripple Prime Joins Nodal Clear as Clearing Member -- $3 …
Cryptocurrency
 
Best Threads (Most Thanked)
in the last 7 days on NexusFi
Sober Journey With S&P
21 thanks
2026 Jlab journal
10 thanks
Algo automated / semi-automated trading anyone?
6 thanks
Lady Vols Primer: Trading Volatility Journal
6 thanks
Trying to learn Volume and price action correlation
5 thanks
  #3 (permalink)
 
sam028's Avatar
 sam028 
Site Moderator
 
Posts: 3,756 since Jun 2009
Thanks Given: 3,825
Thanks Received: 4,632


Hmm, it's not always -5 hours, 365 days/year, be careful.
You maye use TimeZoneInfo.FindSystemTimeZoneById("Central Standard Time") with TimeZoneInfo.ConvertTime(), to avoid any problems.


Success requires no deodorant! (Sun Tzu)
Follow me on X Reply With Quote
Thanked by:
  #4 (permalink)
 
mk77ch's Avatar
 mk77ch 
Switzerland
 
Experience: Advanced
Platform: NinjaTrader
Broker: Dorman
Trading: Currency Futures, ES
Posts: 162 since Oct 2010
Thanks Given: 30
Thanks Received: 423

hey sam,

thank you very much for your reply.
could you please provide a small sample code how this could be done?

im stuck after the intitla part of the timezone:

TimeZoneInfo tzi = TimeZoneInfo.FindSystemTimeZoneById("Central Standard Time");

thak you and cheers,
mike


Started this thread Reply With Quote
  #5 (permalink)
 
sam028's Avatar
 sam028 
Site Moderator
 
Posts: 3,756 since Jun 2009
Thanks Given: 3,825
Thanks Received: 4,632

Not tested:

 
Code
                            
private DateTime nowtimeinChicago;

private 
TimeZoneInfo cst;     
protected 
override void Initialize()
{
    
cst TimeZoneInfo.FindSystemTimeZoneById("Central Standard Time");
}
protected 
override void OnBarUpdate()
{
    
now DateTime.Now;
    
timeinChicago TimeZoneInfo.ConvertTime(now cst);
    Print(
"Time in Chicago: " timeinChicago);


Success requires no deodorant! (Sun Tzu)
Follow me on X Reply With Quote
Thanked by:
  #6 (permalink)
 
mk77ch's Avatar
 mk77ch 
Switzerland
 
Experience: Advanced
Platform: NinjaTrader
Broker: Dorman
Trading: Currency Futures, ES
Posts: 162 since Oct 2010
Thanks Given: 30
Thanks Received: 423

you are the man, it works!

thank you very much,
mike


Started this thread Reply With Quote
  #7 (permalink)
 decs0057 
Munich, Germany
 
Experience: Intermediate
Platform: NinjaTrader, TWS
Broker: IB, NinjaTrader Brokerage
Trading: ES,NQ,6E
Posts: 73 since Feb 2010
Thanks Given: 15
Thanks Received: 25

you can use timezone info from session of Instrument

TimeZoneInfo tzi = Instrument.MasterInstrument.Session.TimeZoneInfo;


Reply With Quote
Thanked by:




Last Updated on May 15, 2013


© 2026 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 - Downloads - Top
no new posts