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
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 love2code2trade, Today, 01:45 PM
|
1 response
8 views
0 likes
|
Last Post Today, 02:10 PM | ||
Started by Gibranes, Today, 10:05 AM
|
5 responses
21 views
0 likes
|
Last Post Today, 01:55 PM | ||
Started by 09try, 03-29-2024, 01:27 PM
|
9 responses
81 views
0 likes
|
Last Post
by ntcat
Today, 01:16 PM
|
||
Started by ninza33, Today, 06:28 AM
|
4 responses
17 views
0 likes
|
Last Post
by ninza33
Today, 12:38 PM
|
||
Started by ScottWalsh, Yesterday, 04:29 PM
|
4 responses
18 views
0 likes
|
Last Post Today, 12:00 PM |
Comment