NinjaTrader Support Forum  
X

Attention!

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


Go Back   NinjaTrader Support Forum > NinjaScript Development Support > Indicator Development

Indicator Development Support for the development of custom indicators using NinjaScript.

Reply
 
Thread Tools Display Modes
Old 04-24-2007, 05:11 AM   #1
max1ci6
Senior Member
 
Join Date: Jan 2007
Location: , ,
Posts: 101
Thanks: 1
Thanked 0 times in 0 posts
Post imported post

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.
max1ci6 is offline  
Reply With Quote
Old 04-24-2007, 05:24 AM   #2
NinjaTrader_Ray
Administrator
 
NinjaTrader_Ray's Avatar
 
Join Date: Nov 2004
Location: Denver, CO, USA
Posts: 11,163
Thanks: 6
Thanked 45 times in 32 posts
Post imported post

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);
NinjaTrader_Ray is offline  
Reply With Quote
Old 04-24-2007, 07:50 PM   #3
max1ci6
Senior Member
 
Join Date: Jan 2007
Location: , ,
Posts: 101
Thanks: 1
Thanked 0 times in 0 posts
Post imported post

Thanks it worked.
max1ci6 is offline  
Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -6. The time now is 03:41 AM.