Announcement
Collapse
No announcement yet.
Partner 728x90
Collapse
NinjaTrader
Time based strategy
Collapse
X
-
Great thank you. That is very good to know.
It seems like there still may be benefit to account for that in the code as various countries adjust their times on different weeks. For example, an indicator or strategy that looks to take advantage of the London opening time would be ineffective for people living in America during the 2 week discrepancy in changes.
Is there a way of taking care of this in the code?
Comment
-
Hello jg123,
Thank you for your response.
Unfortunately, it would not be possible to change the session template within the code to adjust for the difference in two time zones. Your PC time and the session templates time zone should properly convert when being displayed on the chart. Are you running into an instance where this is not occurring? Are you using any custom session templates?
Comment
-
At this point I am not using any templates.
My main thought is that I live in Europe and next week I will be flying to America for a couple of weeks. America has already done its time change to Daylight Savings and England has not - but it will while I am there.
While I am there, the 08:00 UK time bar will be equivalent to the 03:00 bar on my computer and chart - but after UK time change occurs, it will be equivalent to my 02:00 computer and chart time. Very soon I will be writing an indicator that will create a box around the times that I need to be paying attention to and I expect that this will influence its ability to work correctly.
This is the discrepancy that I am trying to work out if possible.
Comment
-
Wouldn't leaving your PC in your local time zone solve all the issues?Originally posted by jg123 View PostAt this point I am not using any templates.
My main thought is that I live in Europe and next week I will be flying to America for a couple of weeks. America has already done its time change to Daylight Savings and England has not - but it will while I am there.
While I am there, the 08:00 UK time bar will be equivalent to the 03:00 bar on my computer and chart - but after UK time change occurs, it will be equivalent to my 02:00 computer and chart time. Very soon I will be writing an indicator that will create a box around the times that I need to be paying attention to and I expect that this will influence its ability to work correctly.
This is the discrepancy that I am trying to work out if possible.
Comment
-
Hello jg123,
Thank you for your response.
As sledge suggested you can leave the computer on the time zone it has always been on. However, if you want to change the time zone you could incorporate user defined variables in your indicator that will allow you to specify the times for the begin and end Ys for the rectangles.
Comment
-
Hello jg123,
Thank you for your response.
The following is an example of user definable ints that allow us to check within a certain time frame on our charts:
Code:#region Variables private int beginTime = 83000; private int endTime = 170000; #endregion protected override void Initialize() { } protected override void OnBarUpdate() { if(ToTime(Time[0]) >= beginTime && ToTime(Time[0]) <= endTime) { // do something } } #region Properties [Description("Begin Time")] [GridCategory("Parameters")] public int BeginTime { get { return beginTime; } set { beginTime = Math.Max(1, value); } } [Description("End Time")] [GridCategory("Parameters")] public int EndTime { get { return endTime; } set { endTime = Math.Max(1, value); } } #endregion
Comment
Latest Posts
Collapse
| Topics | Statistics | Last Post | ||
|---|---|---|---|---|
|
Started by Geovanny Suaza, 02-11-2026, 06:32 PM
|
0 responses
649 views
0 likes
|
Last Post
|
||
|
Started by Geovanny Suaza, 02-11-2026, 05:51 PM
|
0 responses
370 views
1 like
|
Last Post
|
||
|
Started by Mindset, 02-09-2026, 11:44 AM
|
0 responses
109 views
0 likes
|
Last Post
by Mindset
02-09-2026, 11:44 AM
|
||
|
Started by Geovanny Suaza, 02-02-2026, 12:30 PM
|
0 responses
574 views
1 like
|
Last Post
|
||
|
Started by RFrosty, 01-28-2026, 06:49 PM
|
0 responses
576 views
1 like
|
Last Post
by RFrosty
01-28-2026, 06:49 PM
|

Comment