Announcement
Collapse
No announcement yet.
Partner 728x90
Collapse
NinjaTrader
Exposing variables
Collapse
X
-
Exposing variables
Hello- I created a custom indicator that takes in a certain instrument for calculations. It's a multi-instrument indicator (2 BIP's). I also have a milti-instrument strategy that calls this indicator. However, I would like to synch up the time frames between the strategy and indicator. In order to do this, I would need to find a way (if one exists) to make the time frame in the indicator an "exposed variable" that can be loaded by the strategy. Is there a way to do this? At the moment I'm doing this manually. Thanks.Tags: None
-
Hello ciro1963,
Thanks for your post.
You can expose values that are not plots by doing something similar to this reference sample:
https://ninjatrader.com/support/helpGuides/nt7/?exposing_indicator_values_that.htm
Let me know if I can clarify anything in that sample.Last edited by NinjaTrader_JoshG; 01-15-2019, 01:03 PM.Josh G.NinjaTrader Customer Service
-
Hi Josh -Yes I’m already doing this with a different variable. But the period type ( week, day, minute, etc ) that is part of the add statement in my indicator are reserved words I believe. I’m not sure if I can pass this variable from the strategy into the indicator without causing other issues. If there’s a way can you show me a specific example? Thank youLast edited by ciro1963; 01-15-2019, 03:46 PM.
Comment
-
No I’m trying to set the time period of the indicator from the strategy. It appears that the time period of the indicator is already exposed because if you apply any indicator in a chart you can set the time period externally in the chart dialog box. I just want to get access to it from a strategy
Comment
-
ciro1963,
It sounds like you are trying to dynamically add a data series, which is not going to be possible. Have you tried just calling the indicator(s) from inside your strategy using the correct BarsArray of your Add() method?
This would not allow you to see the indicator on the chart but it would allow your strategy to use the indicator for calculations.
If you really needed to plot those values on your chart as well you could use the concepts in this reference sample:
Josh G.NinjaTrader Customer Service
- Likes 1
Comment
Latest Posts
Collapse
| Topics | Statistics | Last Post | ||
|---|---|---|---|---|
|
Started by Geovanny Suaza, 02-11-2026, 06:32 PM
|
0 responses
577 views
0 likes
|
Last Post
|
||
|
Started by Geovanny Suaza, 02-11-2026, 05:51 PM
|
0 responses
334 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
553 views
1 like
|
Last Post
|
||
|
Started by RFrosty, 01-28-2026, 06:49 PM
|
0 responses
551 views
1 like
|
Last Post
by RFrosty
01-28-2026, 06:49 PM
|

Comment