NinjaTrader Support Forum  

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-21-2008, 06:18 AM   #1
clearpicks
Senior Member
 
Join Date: Jan 2008
Posts: 257
Thanks: 0
Thanked 0 times in 0 posts
Default How to access daily data series from an indicator running on intraday charts?

Hello,

Could you help me on how to access daily data series from an indicator running on intraday charts?
The Add() function only works in strategies not indicators.


By modifying the pivot indicator source code I came up with the following code, which seems working to
some extend. However I am not quite understand how the Data class and Bars class are defined, thus
I donot quite understand the following code. the dailyBars supposely should be from 40 calendar day ago to present, but why is the oldest daily bar is of less index so that I have to use dailyBars.Get(dailyBars.Count-1) to access
the last daily bar? Also where are Bars.From and Bars.To defined? Where can I find more information about these classes?


What is the best way to convert the function getValue() and getValueAbsolute() in eSignal EFS APIs into NinjaScript,
especially when accessing the data of other time frame and/or symbol? For example,

var C = getValueAbsolute("Close", 0, -8, "ES M8,D")
creates an eight element array, in which C[0] is the most recent daily close price of "ES M8" and C[7] is the daily
close price seven days ago.


protected override void OnBarUpdate()
{
if ( ! isDailyDataLoaded && ! isInitializing )
{
isInitializing = true;
dailyBars = Data.Bars.GetBars(Bars.Instrument, new Period(PeriodType.Day, 1), Bars.To.AddDays(-40), Bars.To, (Session) Bars.Session.Clone(), Data.Bars.SplitAdjust, Data.Bars.DividendAdjust);
existsHistDailyData = (dailyBars.Count <= 1) ? false : true;
isInitializing = false;
isDailyDataLoaded = true;
}
if (existsHistDailyData)
{
if ( ( Count -1 - CurrentBar ) == 0 ) {
yesterdayDailyBar = dailyBars.Get(dailyBars.Count-1);
if ( yesterdayDailyBar.Time != D1 || FirstTickOfBar ) {
D1 = yesterdayDailyBar.Time;
double YC = yesterdayDailyBar.Close;
......
}
}
}
}



- Clearpicks
clearpicks is offline  
Reply With Quote
Old 04-21-2008, 06:41 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

>> Could you help me on how to access daily data series from an indicator running on intraday charts?
Unfortunately this is not supported.
NinjaTrader_Dierk is offline  
Reply With Quote
Old 04-21-2008, 06:55 AM   #3
clearpicks
Senior Member
 
Join Date: Jan 2008
Posts: 257
Thanks: 0
Thanked 0 times in 0 posts
Default

I heard that NinjaTrader is going to support multi-symbol data series in inidicators in NT 7.0. When is it going to be released? Will it support multi-timeframe also?

- Clearpicks
clearpicks is offline  
Reply With Quote
Old 04-21-2008, 06:57 AM   #4
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

We have multi-series support for indicators on our list for NT7. We expect to have beta available by end of this year.
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
Access daily ATR from intraday chart sunnyrain Indicator Development 8 11-12-2008 01:39 PM
historical data, daily charts... funk101 Miscellaneous Support 4 11-15-2007 06:06 AM
Daily Charts with IB Data Feed MichaelB Charting 4 11-05-2007 01:13 AM
Referencing daily data within an intraday script jonesr227 Strategy Development 2 08-20-2007 10:42 PM
Daily charts ..using tradestation data riccja Charting 5 06-13-2007 11:36 AM


All times are GMT -6. The time now is 10:46 AM.