Announcement
Collapse
Looking for a User App or Add-On built by the NinjaTrader community?
Visit NinjaTrader EcoSystem and our free User App Share!
Have a question for the NinjaScript developer community? Open a new thread in our NinjaScript File Sharing Discussion Forum!
Have a question for the NinjaScript developer community? Open a new thread in our NinjaScript File Sharing Discussion Forum!
See more
See less
Partner 728x90
Collapse
NinjaTrader
NT7 Forum Indicators
Collapse
X
-
Hi p_mid,
I see, to clarify, Input[0] refers to something different. Accessing Input[0] is only useful when using PriceType. When you are not using PriceType, Close[0] and Input[0] show the same information by default.
More info at - http://www.ninjatrader-support.com/H...ide.html?Input
and - http://www.ninjatrader-support.com/H...html?PriceType
If you want to access the close of your dataseries, you would use myDataSeries[0], this will get you the close of the the original dataseries.
If you want to pass in the close price of the dataseries to another indicator from the Indicator GUI, you can do what I mentioned in post #11.Last edited by NinjaTrader_Tim; 04-21-2010, 09:47 AM.TimNinjaTrader Customer Service
Comment
-
Sorry,
but this seems to take me far from what I'm trying to accomplish: myDataSeries should be assigned a DataSeries defined in code, not an user parameter).
I just want to write an indicator which, when added to a graph containing a dataseries, takes the prices of the dataseries, and adds the value of an indicator defined by the user as a parameter in its Data/Input Series field.
So, Data/Input Series will be, e.g., SMA(RIMM (Daily),14), and the code would look like this:
protected override void OnBarUpdate()
{
...
double userIndicatorValue = Input[0]; // <<-- this will contain the user indicator value defined as a parameter (e.g. SMA(20))
double originalDataSeriesValue = ??; // how do I retrieve this?
Plot0.Set(userIndicatorValue + originalDataSeriesValue);
...
}
Very simple, but I just can't figure out how to retrieve the original dataseries value.
I hope to have been able to clarify what I'm trying to obtain: the SMA(), or any other indicator to be added to the original dataseries, must not be defined in code, but must be a parameter entered by the user.
Regards,
Paolo
Comment
-
Hi p_mid,
Unfortunately that is not how the value Input[0] works, please see my previous response.
If you want to create a user-defined series, that will be added to your series. You can create enums that contain the series you wish to select from (for example, SMA values).
More info at - http://www.ninjatrader-support2.com/...ead.php?t=3420TimNinjaTrader Customer Service
Comment
Latest Posts
Collapse
Topics | Statistics | Last Post | ||
---|---|---|---|---|
Started by rbeckmann05, Yesterday, 06:48 PM
|
1 response
12 views
0 likes
|
Last Post
by bltdavid
Today, 05:43 AM
|
||
Started by llanqui, Today, 03:53 AM
|
0 responses
6 views
0 likes
|
Last Post
by llanqui
Today, 03:53 AM
|
||
Started by burtoninlondon, Today, 12:38 AM
|
0 responses
10 views
0 likes
|
Last Post Today, 12:38 AM | ||
Started by AaronKoRn, Yesterday, 09:49 PM
|
0 responses
15 views
0 likes
|
Last Post
by AaronKoRn
Yesterday, 09:49 PM
|
||
Started by carnitron, Yesterday, 08:42 PM
|
0 responses
11 views
0 likes
|
Last Post
by carnitron
Yesterday, 08:42 PM
|
Comment