![]() |
This website will be down for maintenance from Friday May 24th at 6PM MDT until Saturday May 25th at 11AM MDT. We apologize for the inconvenience. If you need assistance during this time, please email sales@ninjatrader.com
|
|||||||
| Indicator Development Support for the development of custom indicators using NinjaScript. |
![]() |
|
|
Thread Tools | Display Modes |
|
|
#1 |
|
Senior Member
Join Date: Jan 2007
Location: , ,
Posts: 101
Thanks: 1
Thanked 0 times in 0 posts
|
I'm new at programming in NT and probably this question was already answered but I couldn't find it.
I would like to plot an indicator (for instance PriorDayOHLC) only for the current session (not for all previous days), can anyone tell me how to do it or indicate some example? Thanks in advance. |
|
|
|
|
|
#2 |
|
Administrator
Join Date: Nov 2004
Location: Denver, CO, USA
Posts: 11,163
Thanks: 6
Thanked 45 times in 32 posts
|
You would need to add some filtering logic to prevent a value for an indicator's dataseries to be set. Since NT sessions can only be defined within a calendarday, you could do something like:
if (Time[0].Date == DateTime.Now.Date) Plot0.Set(yourValue);
Ray
NinjaTrader Customer Service |
|
|
|
|
|
#3 |
|
Senior Member
Join Date: Jan 2007
Location: , ,
Posts: 101
Thanks: 1
Thanked 0 times in 0 posts
|
Thanks it worked.
|
|
|
|
![]() |
| Thread Tools | |
| Display Modes | |
|
|