NinjaTrader Support Forum  

Go Back   NinjaTrader Support Forum > NinjaScript Development Support > General Programming

General Programming General NinjaScript programming questions.

Reply
 
Thread Tools Display Modes
Old 05-11-2012, 01:43 PM   #1
JoshDance
Senior Member
 
Join Date: Dec 2010
Posts: 406
Thanks: 22
Thanked 23 times in 12 posts
Default Ninjascript - retrieve yesterday's settlement price

In an intraday chart indicator, I need to retrieve yesterday's settlement price.

The Pivots indicator has the ability to do this, and rather than reinvent the wheel I wondered if there is a way by calling this indicator programatically, or by some other exposed value elsewhere, that I can retrieve the value I'm looking for.
JoshDance is offline  
Reply With Quote
Old 05-11-2012, 02:10 PM   #2
NinjaTrader_Matthew
NinjaTrader Customer Service
 
NinjaTrader_Matthew's Avatar
 
Join Date: Apr 2010
Location: Denver, CO, USA
Posts: 4,856
Thanks: 162
Thanked 579 times in 570 posts
Default

Josh,

There are not any exposed methods for doing so from the Pivots indicator.

You could use the Add() method to get the Daily series input and then use Closes[1][1] to access this value from IQFeed.

If you would rather not use the Add() method, you would have to duplicate the DailyBars logic in the pivot indicator, create a copy of the Pivots and expose the values you are after.
NinjaTrader_Matthew is offline  
Reply With Quote
Old 05-13-2012, 08:23 PM   #3
JoshDance
Senior Member
 
Join Date: Dec 2010
Posts: 406
Thanks: 22
Thanked 23 times in 12 posts
Default

Quote:
Originally Posted by NinjaTrader_Matthew View Post
Josh,

There are not any exposed methods for doing so from the Pivots indicator.

You could use the Add() method to get the Daily series input and then use Closes[1][1] to access this value from IQFeed.

If you would rather not use the Add() method, you would have to duplicate the DailyBars logic in the pivot indicator, create a copy of the Pivots and expose the values you are after.
Thanks Matthew, I did use the Add() method and it was quite easy, compared with other messy logic, as long as it does as I expect
JoshDance is offline  
Reply With Quote
Old 06-26-2012, 07:01 AM   #4
Harry
Senior Member
 
Join Date: Oct 2007
Posts: 1,859
Thanks: 16
Thanked 97 times in 80 posts
Default

The Add() method has two restrictions when applied to daily bars:

-> it does not insert the daily bars correclty, if you use a session template with subsessions
-> you cannot load daily data from the period prior to the first day for which chart data is loaded

Both can be achieved with the approach shown for the Pivots indicator. However, the pivot indicator can not be called from a strategy or another indicator, when set to daily bars and when connected to a datafeed.
Harry is offline  
Reply With Quote
The following user says thank you to Harry for this post:
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
Settlement price vs Close price - eurex bund Pourleau General Programming 2 05-25-2011 06:14 AM
Charting the EOD Settlement Price DTdr2 General Programming 0 08-04-2010 06:42 PM
Retrieve exit price within a strategy laparker General Programming 3 05-29-2009 11:15 AM
YM Settlement FatCanary Market Analyzer 6 07-11-2008 09:34 AM
TT Settlement Savage1701 News and Announcements 8 07-19-2005 11:20 PM


All times are GMT -6. The time now is 12:13 AM.