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 10-31-2007, 08:44 AM   #1
sbgtrading
Certified NinjaScript Consultant
 
Join Date: Oct 2007
Location: Northern Illinois
Posts: 256
Thanks: 0
Thanked 3 times in 3 posts
Default Bars on chart or price range on chart

Are there a functions I can call to determine:

1) The number of bars on the current chart
2) The max & min price on the current chart
sbgtrading is offline  
Reply With Quote
Old 10-31-2007, 08:46 AM   #2
NinjaTrader_Dierk
Administrator
 
NinjaTrader_Dierk's Avatar
 
Join Date: Mar 2005
Location: Bamberg, Germany
Posts: 9,994
Thanks: 0
Thanked 6 times in 6 posts
Default

Unfortunately this is not supported.
NinjaTrader_Dierk is offline  
Reply With Quote
Old 11-01-2007, 01:00 AM   #3
NinjaTrader_Josh
NinjaTrader Product Manager
 
NinjaTrader_Josh's Avatar
 
Join Date: May 2007
Location: Denver, CO
Posts: 17,458
Thanks: 1
Thanked 106 times in 70 posts
Default

To get the number of bars in your bars object you can use this property:
Code:
CurrentBar
http://www.ninjatrader-support.com/H...urrentBar.html

To get max and min price of the current chart you will just have to roll your own algorithm. Store the value of a high and a low. If the next bar is higher then replace that high. etc etc.
NinjaTrader_Josh is offline  
Reply With Quote
Old 11-01-2007, 04:46 AM   #4
sbgtrading
Certified NinjaScript Consultant
 
Join Date: Oct 2007
Location: Northern Illinois
Posts: 256
Thanks: 0
Thanked 3 times in 3 posts
Default

The CurrentBar gives a count of the total number of bars loaded (which could be 5 days worth of intraday bars). I'm looking for a way to determine how many bars are displayed in the current chart window. It would be helpful to know this so we can write text data to the screen at the leftmost bar of the window, at the topmost price of the window. Metatrader has a number of window functions (WindowBarsOnChart specifically, as well as WindowPriceMin and WindowPriceMax) that get us this info.
sbgtrading is offline  
Reply With Quote
Old 11-01-2007, 04:47 AM   #5
NinjaTrader_Dierk
Administrator
 
NinjaTrader_Dierk's Avatar
 
Join Date: Mar 2005
Location: Bamberg, Germany
Posts: 9,994
Thanks: 0
Thanked 6 times in 6 posts
Default

Unfortunately this is not supported.
NinjaTrader_Dierk 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
Range Bars Doc Suggestions And Feedback 10 08-05-2011 01:14 PM
Range Bars? momentom Charting 1 09-10-2007 08:18 AM
fixed range on chart - chart times Laura47 Charting 13 07-10-2007 01:20 AM
Chart does not update when set to some Bars Back Alfred Charting 3 06-13-2007 10:45 AM
Momentum bars or Price Range Bars Akros Indicator Development 7 06-10-2007 04:55 AM


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