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 > General Programming

General Programming General NinjaScript programming questions.

Reply
 
Thread Tools Display Modes
Old 12-28-2007, 10:14 AM   #1
Burga1
Senior Member
 
Join Date: Nov 2007
Posts: 388
Thanks: 0
Thanked 0 times in 0 posts
Default calculate value during a time period?

Hi,

Is it possible to calculate values, such as the HIGH price between two particular time periods...for example between 12:00-16:00 GMT and store this in a variable? Thanks in advance.
Burga1 is offline  
Reply With Quote
Old 12-28-2007, 11:35 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
Default

There is no method for this in NinjaScript layer. You would have to self calculate by checking bar times and storing values appropriately.
NinjaTrader_Ray is offline  
Reply With Quote
Old 12-28-2007, 11:57 AM   #3
Burga1
Senior Member
 
Join Date: Nov 2007
Posts: 388
Thanks: 0
Thanked 0 times in 0 posts
Default

Thank you. So I guess something like this might be appropriate?

if(ToTime(Time[0]) == 160000)
{
//do something to check for high price back correct # of bars (based upon chart timeframe) to 12:00...
}
Burga1 is offline  
Reply With Quote
Old 12-28-2007, 11:59 AM   #4
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
Default

Yes, something like that... You are on the right track.
NinjaTrader_Ray is offline  
Reply With Quote
Old 12-28-2007, 12:03 PM   #5
Burga1
Senior Member
 
Join Date: Nov 2007
Posts: 388
Thanks: 0
Thanked 0 times in 0 posts
Default

Thanks, I guess I'll work with it then...
Burga1 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

Similar Threads
Thread Thread Starter Forum Replies Last Post
Calculate time in seconds between the close of two bars OnePutt General Programming 14 05-29-2008 01:38 AM
Period 14 crossing Period Linear Regression 25 Viper3 Strategy Development 8 10-21-2007 10:51 AM
Calculate High for every x minutes NinjaTrader_Josh Indicator Development 5 07-20-2007 06:31 AM
How to write a time period in wizard? Jenny Strategy Development 19 06-18-2007 07:04 AM
Calculate time in seconds between the close of two bars OnePutt Automated Trading 0 12-31-1969 06:00 PM


All times are GMT -6. The time now is 04:27 AM.