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 11-19-2009, 11:54 PM   #1
tazatek
Senior Member
 
Join Date: Jul 2008
Location: Grand Junction, CO
Posts: 148
Thanks: 0
Thanked 0 times in 0 posts
Send a message via Skype™ to tazatek
Default Passing DataSeries as Parameter

I'm creating a function library in my own namespace like so:

Code:
namespace NS {
class cname{

public double func1(DataSeries data) {

// Accessing High, Low, Close data from a DataSeries object
return data.Indicator.High[0];

}


}

}
But the problem I can't seem to figure out, is how to pass in the OHLCV data into the function from OnBarUpdate()...

Code:
OnBarUpdate() {

func1(this); // error

myDataSeries = new DataSeries(this);
func1(myDataSeries); // Error
}

I would think I can pull everything out of the current Dataseries, but I don't know how it's called/named.

I'd rather not create a parameter for each price point I might need, because some functions could get ugly in a hurry... (20+ parameters)

Thoughts?

Thanks
tazatek is offline  
Reply With Quote
Old 11-20-2009, 12:07 AM   #2
tazatek
Senior Member
 
Join Date: Jul 2008
Location: Grand Junction, CO
Posts: 148
Thanks: 0
Thanked 0 times in 0 posts
Send a message via Skype™ to tazatek
Default

answered yet another of my own questions tonight..

I forgot to instantiate my class as an object... was access the class directly - DOH!

Sorry - going to bed now.
tazatek 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
Passing dataseries to my custom .net dll zlpele General Programming 2 03-11-2009 06:21 AM
Passing DataSeries to Function SystemTrading General Programming 1 12-21-2008 02:50 PM
Passing variable caldolegare General Programming 6 11-17-2008 09:23 AM
Passing period parameter to Add function as a variable JangoFolly Strategy Development 11 05-10-2008 04:32 PM
Example for passing Time/Date as a Parameter zoltran General Programming 7 05-17-2007 09:32 AM


All times are GMT -6. The time now is 06:48 PM.