NexusFi: Find Your Edge


Home Menu

 





Getting Time[0] in session template timezone with a supereasy method...?


Discussion in NinjaTrader

Updated
    1. trending_up 1,698 views
    2. thumb_up 3 thanks given
    3. group 0 followers
    1. forum 3 posts
    2. attach_file 0 attachments




 
Search this Thread
  #1 (permalink)
 
matevisky's Avatar
 matevisky 
Nelson, New Zealand
 
Experience: Beginner
Posts: 446 since May 2013
Thanks Given: 634
Thanks Received: 1,533

I am trying to cleanup my code, and make it work in everytimezone. I've checked many forum, about to how to make it simple, but as I see it is not simple, but maybe.
So here is the deal:
I am using 24/7 template to show my tick chart. My indicator only useable on this template anyway, so not a big deal.
I can spot, when the new session is starting that is cool ( Bars.FirstBarOfSession )

But here is the problem. Is there any supereasy way to get SessionTime in the Session Timezone instead of getting Time, on the current timezone? Really It would be superhelpfull to get all the time in the given sessiontemplate session timezone? Checking the time of day, checking is that a weekend or not, checking is that a holiday date or not would be much more easier....

If not, than I guess I have to use @Fat Tail conversition logic, to get the right time...

Thx in advnace

Mate


Follow me on X Visit my NexusFi Trade Journal Started this thread Reply With Quote

Can you help answer these questions
from other members on NexusFi?
April 2026 Jobs Report: +115k vs +65k Expected
Traders Hideout
Iran Talks Final Stages -- Two VLCCs Exit Hormuz, Record …
Traders Hideout
Saylors 41-Month HODL Breaks: Strategy Sells 32 BTC as $ …
Prediction Markets & Event Contracts
Iran Fired a Missile at Israel Last Night. The $8M June …
Prediction Markets & Event Contracts
Would a node-based workflow for automated trading be useful?
Traders Hideout
 
Best Threads (Most Thanked)
in the last 7 days on NexusFi
NexusFi site changelog and issues/problem reporting
15 thanks
Darmok and Jalad at Tanagra
3 thanks
Big Mike in Ecuador
1 thanks
30 Sessions
1 thanks
  #2 (permalink)
 
matevisky's Avatar
 matevisky 
Nelson, New Zealand
 
Experience: Beginner
Posts: 446 since May 2013
Thanks Given: 634
Thanks Received: 1,533

Oke sorry. After some more deeper investigation: here is the answer

 
Code
				
Print(Bars.GetSessionDateFromLocal(Bars.Session, Time[0]));


Máté
Full time trader Live journal here
Follow me on X Visit my NexusFi Trade Journal Started this thread Reply With Quote
Thanked by:
  #3 (permalink)
 
matevisky's Avatar
 matevisky 
Nelson, New Zealand
 
Experience: Beginner
Posts: 446 since May 2013
Thanks Given: 634
Thanks Received: 1,533



matevisky View Post
Oke sorry. After some more deeper investigation: here is the answer

 
Code
				
Print(Bars.GetSessionDateFromLocal(Bars.Session, Time[0]));

Hm, this is stupid, but this function only give back the date, but not the time... I thought it is converting the Time[0] to session time, but not... make no sense. I will use @Fat Tail approach, as I see there is no easy way to do this, only the hard one. Converting the timezone into the session timezone


Máté
Full time trader Live journal here
Follow me on X Visit my NexusFi Trade Journal Started this thread Reply With Quote
  #4 (permalink)
 
matevisky's Avatar
 matevisky 
Nelson, New Zealand
 
Experience: Beginner
Posts: 446 since May 2013
Thanks Given: 634
Thanks Received: 1,533

Oke, here is the solution. It is looks good:

 
Code
DateTime instrumentSessionDate = TimeZoneInfo.ConvertTime(Time[0], TimeZoneInfo.Local, Bars.Session.TimeZoneInfo);


Máté
Full time trader Live journal here
Follow me on X Visit my NexusFi Trade Journal Started this thread Reply With Quote
Thanked by:




Last Updated on October 23, 2014


© 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