private string ticker;
Add("SPY", PeriodType.Day, 1);
....store the string "SPY" in ticker....
Print(ticker);
Announcement
Collapse
No announcement yet.
Partner 728x90
Collapse
NinjaTrader
Getting ticker of added instrument?
Collapse
X
-
You could make a string for SPY in the variable section
or use substring if needed on this example (Be sure of BarsInProgress==1..
NT Tips:
2.When working with multi-series indicators, Input always references BarsInProgress 0. Please be mindful as to when you access Input[0] as you will only be able to do so after BarsInProgress 0 has bars. To check to ensure BarsInProgress 0 has some bars you can use CurrentBars[0] to check.
Originally posted by clocker View PostIs it possible to get the ticker of an added instrument?
Code:private string ticker; Add("SPY", PeriodType.Day, 1); ....store the string "SPY" in ticker.... Print(ticker);
-
You are declaring ticker anyway. Why not just initialize it when you declare it?Originally posted by clocker View PostIs it possible to get the ticker of an added instrument?
Code:private string ticker; Add("SPY", PeriodType.Day, 1); ....store the string "SPY" in ticker.... Print(ticker);
Comment
-
In that case,Originally posted by clocker View PostI was illustrating what I want to do since I already had a series of Add() methods. The "ticker" variable is to get my point across.
will show you which ticker is being processed at any given time.Code:ticker = Instruments[BarsInProgress].MasterInstrument.Name;
Comment
Latest Posts
Collapse
| Topics | Statistics | Last Post | ||
|---|---|---|---|---|
|
Started by CaptainJack, 05-29-2026, 05:09 AM
|
0 responses
173 views
0 likes
|
Last Post
by CaptainJack
05-29-2026, 05:09 AM
|
||
|
Started by CaptainJack, 05-29-2026, 12:02 AM
|
0 responses
91 views
0 likes
|
Last Post
by CaptainJack
05-29-2026, 12:02 AM
|
||
|
Started by charlesugo_1, 05-26-2026, 05:03 PM
|
0 responses
129 views
0 likes
|
Last Post
by charlesugo_1
05-26-2026, 05:03 PM
|
||
|
Started by DannyP96, 05-18-2026, 02:38 PM
|
1 response
208 views
0 likes
|
Last Post
|
||
|
Started by CarlTrading, 05-11-2026, 05:56 AM
|
0 responses
186 views
0 likes
|
Last Post
by CarlTrading
05-11-2026, 05:56 AM
|

Comment