I do set PriceTypeSupported = true, but PriceType is not showing up as an option.
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
PriceType option not showing up in Indicator dialog when PriceTypeSupported in Init
Collapse
X
-
PriceType option not showing up in Indicator dialog when PriceTypeSupported in Init
My understanding is that when I set PriceTypeSupported = true in Initialize of the indicator in question I will get a PriceType option in the Indicator dialog. Is this true?
I do set PriceTypeSupported = true, but PriceType is not showing up as an option.Tags: None
-
Hello bernie_c,
Thanks for posting today.
This setting is no longer necessary in the current version of NinjaScript. To change the price type this can be changed directly from the Indicator parameters.
- From inside a chart right mouse click and select Indicators...
- Locate the Data>Input Series setting
- Left mouse click to the left and select the ... symbol
- Select the price type you would like to use for your Input Series
The PriceTypeSupported object does not affect this functionality as of the current NinjaScript.
However, you can add a secondary instrument and control the market data type and the bar type. Here is a link explaining how to do this.
http://www.ninjatrader.com/support/h....html?add3.htm
The primary data series can be controlled as listed above...
Please let us know if we may be of further assistance for anything NinjaTrader.Alex G.NinjaTrader Customer Service
-
Hi bernie_c,
The primary data series of an indicator called from a strategy will be the same primary series of the strategy which is the data series on the chart.
You can add a secondary series to an indicator that is called from a strategy.
The primary series of both indicators and strategies will always be the instrument on the chart.Chelsea B.NinjaTrader Customer Service
Comment
-
You can call any indicator with a different input series from a strategy. For example if you wish to call an EMA calculated from the typical price, you will not call EMA(period), but EMA(Typical, period). Here is a code sample:
Code:#region Variables ..... private Indicator.EMA myEMA = null; #endregion protected override void Initialize() { myEMA = EMA(Typical, period); Add(myEMA); .... }
Comment
-
Hello bernie_c,
As Harry posted in his example, you can call an indicator with a data series from a strategy and define the priceType for the particular data series.
Here is a link to the help guide showing a Simple Moving Average method. http://www.ninjatrader.com/support/h...simple_sma.htm
Code:Returns default value SMA(int period)[int barsAgo] SMA(IDataSeries input, int period)[int barsAgo]
Please let us know if we may be of further assistance for anything NinjaTrader.Alex G.NinjaTrader Customer Service
Comment
-
Thanks Harry and Alex,
It appears that what you both suggest works without doing anything special in my strategy. My indicator is freerunning. It does not need anything from the strategy. The indicator just creates several plots. The strategy comes along every OnBarUpdate and collects all plot points. I did a test (see below) where I print out Input(0) and it matches Close perfectly. I suppose that if I could change the Input selection I would see it reflected in my test. I am pretty sure I should be able to do this from the control panel, but I can't seem to find it.
From Strategy:
Code:protected override void Initialize() { Add( bcC() ); protected override void OnBarUpdate() { if( CurrentBar < 10 ) return; // ----- Get the data only once: ----- for( int i=0; i < 6; i++ ) { local_values[ i ][0] = bcC.Values[ i ][0]; }
From indicator:
Code:protected override void OnBarUpdate() { if( CurrentBar < 10) { Print( Input[0].ToString() ); return; }
Comment
-
I do see the Input Series option in the indicators dialog when running the indicator standalone which is only when I am debugging the indicator. When my strategy starts the indicator the options in the indicator dialog are not available. The Input Series in the strategy dialog does offer the same options.
Comment
-
Hello bernie_c,
Thanks for your reply.
If the indicator is implemented from inside a strategy you will not be able to access the Input series for that specific indicator from the Strategies property as it will be set to the default input series.
This must be set from the code as demonstrated from the example from Harry.
Code:#region Variables ..... private Indicator.EMA myEMA = null; #endregion protected override void Initialize() { myEMA = EMA(Typical, period); Add(myEMA); .... }
Alex G.NinjaTrader Customer Service
Comment
Latest Posts
Collapse
Topics | Statistics | Last Post | ||
---|---|---|---|---|
Started by Touch-Ups, Today, 10:36 AM
|
0 responses
2 views
0 likes
|
Last Post
by Touch-Ups
Today, 10:36 AM
|
||
Started by geddyisodin, 04-25-2024, 05:20 AM
|
8 responses
61 views
0 likes
|
Last Post Yesterday, 10:45 AM | ||
Started by jxs_xrj, 01-12-2020, 09:49 AM
|
4 responses
3,289 views
1 like
|
Last Post
by jgualdronc
Today, 10:02 AM
|
||
Can someone turn this thinkscript into a ninjascript. 5PM CST OHL and Previous Day
by Option Whisperer
Started by Option Whisperer, Today, 09:55 AM
|
0 responses
5 views
0 likes
|
Last Post Today, 09:55 AM | ||
Started by halgo_boulder, 04-20-2024, 08:44 AM
|
2 responses
22 views
0 likes
|
Last Post Today, 09:41 AM |
Comment