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




 
Search this Thread

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

  #1 (permalink)
 
matevisky's Avatar
 matevisky 
Nelson, New Zealand
 
Experience: Beginner
Posts: 470 since May 2013
Thanks Given: 633
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 Twitter Visit my NexusFi Trade Journal Started this thread Reply With Quote

Can you help answer these questions
from other members on NexusFi?
REcommedations for programming help
Sierra Chart
NT7 Indicator Script Troubleshooting - Camarilla Pivots
NinjaTrader
OrderFlow-Based Support/Resistance Levels
Emini and Emicro Index
Cheap historycal L1 data for stocks
Stocks and ETFs
Quantum physics & Trading dynamics
The Elite Circle
 
Best Threads (Most Thanked)
in the last 7 days on NexusFi
Funded Trader platforms
28 thanks
Just another trading journal: PA, Wyckoff & Trends
22 thanks
Trading with Intuition
17 thanks
ApexTraderFunding.com experience and review
12 thanks
GFIs1 1 DAX trade per day journal
9 thanks
  #2 (permalink)
 
matevisky's Avatar
 matevisky 
Nelson, New Zealand
 
Experience: Beginner
Posts: 470 since May 2013
Thanks Given: 633
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 Twitter 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: 470 since May 2013
Thanks Given: 633
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 Twitter Visit my NexusFi Trade Journal Started this thread Reply With Quote
  #4 (permalink)
 
matevisky's Avatar
 matevisky 
Nelson, New Zealand
 
Experience: Beginner
Posts: 470 since May 2013
Thanks Given: 633
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 Twitter Visit my NexusFi Trade Journal Started this thread Reply With Quote
Thanked by:




Last Updated on October 23, 2014


© 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