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 johnMoss, 03-04-2024, 01:53 PM
|
3 responses
46 views
0 likes
|
Last Post
by AndyM
Today, 06:13 PM
|
||
Started by algospoke, Today, 06:01 PM
|
0 responses
8 views
0 likes
|
Last Post
by algospoke
Today, 06:01 PM
|
||
Started by cre8able, Today, 05:53 PM
|
0 responses
8 views
0 likes
|
Last Post
by cre8able
Today, 05:53 PM
|
||
Started by Wessel, 03-23-2024, 02:37 PM
|
3 responses
24 views
0 likes
|
Last Post Today, 04:58 PM | ||
Started by martini, Yesterday, 04:45 PM
|
4 responses
32 views
0 likes
|
Last Post
by martini
Today, 04:48 PM
|
Comment