Is there a way to look up properties such as PointValue, etc, that can be looked up for the MasterInstrument? If not there should be...
Announcement
Collapse
No announcement yet.
Partner 728x90
Collapse
NinjaTrader
Is there a way to get properties of secondary instrument?
Collapse
X
-
Is there a way to get properties of secondary instrument?
In a multi-instrument indicator/strategy, I can pass the symbol of the secondary instrument as a parameter, then Add() it.
Is there a way to look up properties such as PointValue, etc, that can be looked up for the MasterInstrument? If not there should be...Tags: None
-
I'm asking about a secondary instrument. Even in OnBarUpdate, can I look up the PointValue or other properties of a secondary instrument? i.e. if my indicator has a parameter "Symbol2" which is the symbol for a secondary instrument, and I Add() Symbol2 in Initialize(), is there any way to look up the PointValue of Symbol2, even in OnBarUpdate?
Thanks
Comment
-
The same with NT 6.5 multi-instrument strategy :
This is NT7 beta forum but the issue is relevant for NT 6.5 either.
What I wanted to do is to add secondary instruments having the same PeriodType and Period value as the master instrument.
From my own experiments and from your answer to Kevin I understand it's impossible , because we can know master instrument properties only in OnBarUpdate and of course it is too late to Add() new instruments there.
My workaround to this problem is to add all instruments including replicated master instrument, specifying PeriodType and its period for all instruments participating in my strategy, e.g. add EUR , JPY , EURJPY , everyone of them is Range 20 , despite my master instrument, EURJPY , Range 20 already exists.
It works , but it wastes precious resources . May be , in NT7 with its supposedly better memory management it's not an issue at all.
Comment
-
It's not hard, see code below. I made the property getter a bit more complicated so it will default to a secondary instrument displayed on the chart.
Code:in Variables: private string symbol2 = ""; in Initialize: Add(Symbol2, BarsPeriod.Id, BarsPeriod.Value); in Properties: [Description("Symbol 2; i.e. SPY or ES 03-10\nDefault = Secondary chart instrument")] [GridCategory("Parameters")] // Force this parameter to be displayed first [Gui.Design.DisplayName ("\tSymbol 2")] public string Symbol2 { get { if ((symbol2 == "") && (ChartControl != null) && (Instruments != null)) for(int i=0; i<ChartControl.BarsArray.Length; i++) if (ChartControl.BarsArray[i].Instrument.FullName != Instruments[0].FullName) { symbol2 = ChartControl.BarsArray[i].Instrument.FullName; break; } return symbol2; } set { symbol2 = value.ToUpper(); } }
Comment
-
Thank you, it's not exactly what I'm looking for, but it helped me.Originally posted by kdoren View PostIt's not hard, see code below. I made the property getter a bit more complicated so it will default to a secondary instrument displayed on the chart.
I used just:
Where sPr includes all needed information about the master instrument, it only needs to be parsed.Code:if ( ChartControl != null) { sPr = ChartControl.BarsArray[0].ToString() ; }
Comment
Latest Posts
Collapse
| Topics | Statistics | Last Post | ||
|---|---|---|---|---|
|
Started by Geovanny Suaza, 02-11-2026, 06:32 PM
|
0 responses
597 views
0 likes
|
Last Post
|
||
|
Started by Geovanny Suaza, 02-11-2026, 05:51 PM
|
0 responses
343 views
1 like
|
Last Post
|
||
|
Started by Mindset, 02-09-2026, 11:44 AM
|
0 responses
103 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
556 views
1 like
|
Last Post
|
||
|
Started by RFrosty, 01-28-2026, 06:49 PM
|
0 responses
555 views
1 like
|
Last Post
by RFrosty
01-28-2026, 06:49 PM
|

Comment