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




 
Search this Thread

Current Time CME

  #1 (permalink)
 
mk77ch's Avatar
 mk77ch 
Switzerland
 
Experience: Advanced
Platform: NinjaTrader
Broker: Dorman
Trading: Currency Futures, ES
Posts: 132 since Oct 2010
Thanks Given: 27
Thanks Received: 350

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?
What broker to use for trading palladium futures
Commodities
Pivot Indicator like the old SwingTemp by Big Mike
NinjaTrader
Quant vue
Trading Reviews and Vendors
MC PL editor upgrade
MultiCharts
Trade idea based off three indicators.
Traders Hideout
 
  #3 (permalink)
 
sam028's Avatar
 sam028 
Site Moderator
 
Posts: 3,765 since Jun 2009
Thanks Given: 3,825
Thanks Received: 4,629


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 Twitter Reply With Quote
Thanked by:
  #4 (permalink)
 
mk77ch's Avatar
 mk77ch 
Switzerland
 
Experience: Advanced
Platform: NinjaTrader
Broker: Dorman
Trading: Currency Futures, ES
Posts: 132 since Oct 2010
Thanks Given: 27
Thanks Received: 350

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,765 since Jun 2009
Thanks Given: 3,825
Thanks Received: 4,629

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 Twitter Reply With Quote
Thanked by:
  #6 (permalink)
 
mk77ch's Avatar
 mk77ch 
Switzerland
 
Experience: Advanced
Platform: NinjaTrader
Broker: Dorman
Trading: Currency Futures, ES
Posts: 132 since Oct 2010
Thanks Given: 27
Thanks Received: 350

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: 71 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


© 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