Announcement
Collapse
Looking for a User App or Add-On built by the NinjaTrader community?
Visit NinjaTrader EcoSystem and our free User App Share!
Have a question for the NinjaScript developer community? Open a new thread in our NinjaScript File Sharing Discussion Forum!
Have a question for the NinjaScript developer community? Open a new thread in our NinjaScript File Sharing Discussion Forum!
See more
See less
Partner 728x90
Collapse
NinjaTrader
Start/End of day plot
Collapse
X
-
Could you please elaborate on what you mean exactly. By default it will plot all of the days data. This means if data starts coming in at midnight (00:00) it will start plotting there and if the data ends for the day in 24 hrs (24:00) it will stop that days data there and start a new days data at 00:00. Does that make sense?
By default it will not truncate any of the data from being displayed.Josh P.NinjaTrader Customer Service
-
Perhaps what you could do is something like this
Code:if (ToTime(Time[0]) == 93000 || ToTime(Time[0]) == 161500) DrawVerticalLine("Market Session" + CurrentBar, 0, Color.Black, DashStyle.Dash, 2);
Josh P.NinjaTrader Customer Service
Comment
-
You might try my TimeScale indicator, which displays the time and date by a red vertical line every hour, and gives the screen a slight background tint during trading hours.
I hadn't posted this before because it needs work for certain intervals. But here it is in case anyone finds it useful.
I put it up when I'm trying to look over a lot of backtest data and can't find which day is which, and it does that pretty well.
You might have to turn off the hourly bars, as sometimes they display the times over what you're looking at, and this is done by setting "DateOnly".
Hope this helps.
KBJAttached Files
Comment
-
Finally figured it out
I know this is an old thread, but for others that are searching: Below is some simple code to draw something at a given time of day, everyday.
if (Bars.FirstBarOfSession == true)
{
DateTime myTime = DateTime.Parse((Time[0]).ToString("d") + " 9:30 AM");
DrawVerticalLine("myTime" + CurrentBar, myTime, Color.Blue, DashStyle.Dash, 2);
Print(myTime);
}
Just replace " 9:30 AM" with whatever time you want to draw the object, making sure to include a space before the hour numeral.
The print output should look like this: 6/28/2011 9:30:00 AM
Comment
-
Originally posted by motownlucas View PostI know this is an old thread, but for others that are searching: Below is some simple code to draw something at a given time of day, everyday.
if (Bars.FirstBarOfSession == true)
{
DateTime myTime = DateTime.Parse((Time[0]).ToString("d") + " 9:30 AM");
DrawVerticalLine("myTime" + CurrentBar, myTime, Color.Blue, DashStyle.Dash, 2);
Print(myTime);
}
Just replace " 9:30 AM" with whatever time you want to draw the object, making sure to include a space before the hour numeral.
The print output should look like this: 6/28/2011 9:30:00 AM
(Bars.FirstBarOfSession == true) or something different as the IF() statement?
Comment
Latest Posts
Collapse
Topics | Statistics | Last Post | ||
---|---|---|---|---|
Started by ageeholdings, Today, 07:43 AM
|
0 responses
7 views
0 likes
|
Last Post
by ageeholdings
Today, 07:43 AM
|
||
Started by pibrew, Today, 06:37 AM
|
0 responses
4 views
0 likes
|
Last Post
by pibrew
Today, 06:37 AM
|
||
Started by rbeckmann05, Yesterday, 06:48 PM
|
1 response
14 views
0 likes
|
Last Post
by bltdavid
Today, 05:43 AM
|
||
Started by llanqui, Today, 03:53 AM
|
0 responses
6 views
0 likes
|
Last Post
by llanqui
Today, 03:53 AM
|
||
Started by burtoninlondon, Today, 12:38 AM
|
0 responses
12 views
0 likes
|
Last Post Today, 12:38 AM |
Comment