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,236 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: 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?
Pivot Indicator like the old SwingTemp by Big Mike
NinjaTrader
Pivot Indicator based on Level2 data
NinjaTrader
How to create dashboard like this one?
Platforms and Indicators
Has anyone taken trading from Agnieska Wood - Ahead Coach?
Psychology and Money Management
MC Advanced Simulated Trading.
MultiCharts
 
Best Threads (Most Thanked)
in the last 7 days on NexusFi
ApexTraderFunding.com experience and review
143 thanks
1 Minute Man
64 thanks
HumbleTraders next chapter
40 thanks
Winning attitudes create winning traders
33 thanks
Vinny E-Mini & Algobox Review TRADE ROOM
25 thanks
  #2 (permalink)
 
matevisky's Avatar
 matevisky 
Nelson, New Zealand
 
Experience: Beginner
Posts: 446 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: 446 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: 446 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