Announcement
Collapse
No announcement yet.
Partner 728x90
Collapse
NinjaTrader
What is Input ?
Collapse
X
-
Hello,
Input is the collection of Input IDataSeries a item has.
To ensure I am referring to the same as you are, this is the Input I am describing: http://www.ninjatrader.com/support/h.../nt7/input.htm
An example of this is the SMA(IDataSeries, Period)
The IDataSeries could be Close prices for example, so we have :
the code inside SMA indicator:Code:double someValue = SMA(Close, 12)[0];
This line says to Set the CurrentBar's value from Input or Input[0]. Value is the generic name for the index 0 Plot of this indicator.Code:Value.Set(Input[0]);
also
Is the calculation for the SMA using the input IDataSeries for its prices, this means that i could pass in Close, Open, High, Low, Volume or any IDataSeries value to the SMA indicator.Code:Value.Set((last + Input[0] - Input[Period]) / Math.Min(CurrentBar, Period)); else Value.Set((last + Input[0]) / (Math.Min(CurrentBar, Period) + 1));
I look forward to being of further assistance.
-
Hi, It means, that if SMA take it's value from another( not primary) instrument( Bars object ), but from, for example, second( Bars object ), and I wrote so:Originally posted by NinjaTrader_Jesse View PostAn example of this is the SMA(IDataSeries, Period)
The IDataSeries could be Close prices for example, so we have :
the code inside SMA indicator:Code:double someValue = SMA(Close, 12)[0];
This line says to Set the CurrentBar's value from Input or Input[0]. Value is the generic name for the index 0 Plot of this indicator.Code:Value.Set(Input[0]);
the cjde inside SMA indicator will be like this?Code:double someValue = SMA(Close, 12)[1];
It is correctly?Code:Value.Set(Input[1]);
value from Input or Input[0] ? Which difference among them?Originally posted by NinjaTrader_Jesse View PostThis line says to Set the CurrentBar's value from Input or Input[0]. Value is the generic name for the index 0 Plot of this indicator.
Comment
-
Hello,
The Input and Input[0] are a Collection and an Index location of that collection.
Input represents the DataSeries that you gave to the indicator, in the SMA(Close,12) call, we provide the SMA Close prices to use.
In the code for the SMA, Input represents the passed series.
Input[0] would be the amount of BarsAgo to get the price value for. The last bar on the chart is the CurrentBar or 0 bars ago.
I look forward to being of further assistance.
Comment
-
That is means that here:Originally posted by NinjaTrader_Jesse View PostHello,
The Input and Input[0] are a Collection and an Index location of that collection.
Input - Collection.Code:input[0]
[0] - an Index location of that collection/
It is correct?
If I'm right... Input it is Collection of which?
And Input ... is Collection without any index?
Hm.. And why did not take the price value using Close, Hight or Low? Why in many indicator's using Input[0] ?Originally posted by NinjaTrader_Jesse View PostInput[0] would be the amount of BarsAgo to get the price value for.
Comment
-
Hello,
You are correct, Input is a collection or to be correct would be a DataSeries.Input - Collection.
[0] - an Index location of that collection/
It is correct?
If I'm right... Input it is Collection of which?
And Input ... is Collection without any index?
This is a collection of whatever you provided to the indicator, lets look at the SMA again.
If I call the SMA like the following:
SMA(Close, 12)
I provided the Close DataSeries to the SMA. Inside the SMA it uses Input because it expects a series to be provided to it so it can calculate values. I provided the Close in this example so Input would be Close.
If I instead called SMA(High, 12), input is now the High series.
This does have an index but not like a normal collection. The BarsAgo is used, looking at the statement:
Close[0]
This gets the last index of this collection (bar on the right of the chart or CurrentBar),
the statement:
Close[1]
This would be the the last index of the collection minus 1. It is much easier to think of this in a BarsAgo value instead of a Index location, If i want the Current price I use [0], if I want a previous price i use [1] or [2] etc.. for how many bars ago you need a value from.
Many indicators use Input instead of a specific series like Close because like the SMA you can tell the indicator what values you want it to calculate based off of.
If the SMA was using Close instead of Input, you could only use the SMA for Close prices and that would be all, using Input the SMA can be used to apply a moving average to a number of different items.
I look forward to being of further assistance.
Comment
-
Hm. I'd understand! It is, in some way, extern parameter... of indicator. If calling indicator like this:Originally posted by NinjaTrader_Jesse View PostHello,
You are correct, Input is a collection or to be correct would be a DataSeries.
This is a collection of whatever you provided to the indicator, lets look at the SMA again.
If I call the SMA like the following:
In indicator passed element of dataseries - close.Code:SMA(Close, 12)
If calling indicator like this:
In indicator passed element of dataseries - Low.Code:SMA(Low, 12)
But it is not parameter exactly, so elements of dataseries passed to same indicators using interace( IDataSeries ).
innit?Last edited by hozman; 06-17-2015, 10:40 AM.
Comment
-
Hello,
I am sorry but I don't quite understand your question:
Can you please re form this question and I will be happy to provide an answer.In indicator passed element of dataseries - Low.
But it is not parament exactly, so elements of dataseries passed to same indicators using interace( IDataSeries ).
innit?
I look forward to being of further assistance.
Comment
-
Originally posted by NinjaTrader_Jesse View PostHello,
Input is the collection of Input IDataSeries a item has.
To ensure I am referring to the same as you are, this is the Input I am describing: http://www.ninjatrader.com/support/h.../nt7/input.htm
An example of this is the SMA(IDataSeries, Period)
The IDataSeries could be Close prices for example, so we have :
the code inside SMA indicator:Code:double someValue = SMA(Close, 12)[0];
This line says to Set the CurrentBar's value from Input or Input[0]. Value is the generic name for the index 0 Plot of this indicator.Code:Value.Set(Input[0]);
also
Is the calculation for the SMA using the input IDataSeries for its prices, this means that i could pass in Close, Open, High, Low, Volume or any IDataSeries value to the SMA indicator.Code:Value.Set((last + Input[0] - Input[Period]) / Math.Min(CurrentBar, Period)); else Value.Set((last + Input[0]) / (Math.Min(CurrentBar, Period) + 1));
I look forward to being of further assistance.
Could you please explain to me what's wrong with this code:
if (CurrentBar == 0)
Value.Set(Input[0]);
else
{
double last = Value[1] * Math.Min(CurrentBar, Period);
if (CurrentBar >= Period)
Value.Set((last + Input[0] - Input[Period]) / Math.Min(CurrentBar, Period));
else
Value.Set((last + Input[0]) / (Math.Min(CurrentBar, Period) + 1));
}
If I'm not mistaken this is an original SMA indicator, right?
Comment
-
Hello,
This does look like the SMA code, but I am unsure of what your question is related to this code.
Are you getting an error or is there syntax you do not understand? Can you please put this into the form of a question specific to what is happening or what you are seeing?
I look forward to being of further assistance.
Comment
-
There are FEW! logical mistakes in this short code.Originally posted by NinjaTrader_Jesse View PostHello,
This does look like the SMA code, but I am unsure of what your question is related to this code.
Are you getting an error or is there syntax you do not understand? Can you please put this into the form of a question specific to what is happening or what you are seeing?
I look forward to being of further assistance.
Comment
-
-
Latest Posts
Collapse
| Topics | Statistics | Last Post | ||
|---|---|---|---|---|
|
Started by Geovanny Suaza, 02-11-2026, 06:32 PM
|
0 responses
571 views
0 likes
|
Last Post
|
||
|
Started by Geovanny Suaza, 02-11-2026, 05:51 PM
|
0 responses
330 views
1 like
|
Last Post
|
||
|
Started by Mindset, 02-09-2026, 11:44 AM
|
0 responses
101 views
0 likes
|
Last Post
by Mindset
02-09-2026, 11:44 AM
|
||
|
Started by Geovanny Suaza, 02-02-2026, 12:30 PM
|
0 responses
549 views
1 like
|
Last Post
|
||
|
Started by RFrosty, 01-28-2026, 06:49 PM
|
0 responses
549 views
1 like
|
Last Post
by RFrosty
01-28-2026, 06:49 PM
|

Comment