![]() |
This website will be down for maintenance from Friday May 24th at 6PM MDT until Saturday May 25th at 11AM MDT. We apologize for the inconvenience. If you need assistance during this time, please email sales@ninjatrader.com
|
|||||||
| General Programming General NinjaScript programming questions. |
![]() |
|
|
Thread Tools | Display Modes |
|
|
#1 |
|
Senior Member
Join Date: Jan 2009
Posts: 216
Thanks: 0
Thanked 1 time in 1 post
|
Hi NT experts,
There is an indicator LinRegSlopeSFX in the file shareing indicator postion. I would like to use its slop value in a strategy. It is declared as a public varibale in LinRegSlopeSFX. Any way to do that? Regards, |
|
|
|
|
|
#2 |
|
NinjaTrader Customer Service
Join Date: Sep 2008
Location: Germany
Posts: 22,414
Thanks: 252
Thanked 978 times in 961 posts
|
You would either need to make it a plot so it can be accessed (aka MyIndicator.MyIndicatorPlotValue) or you can also expose internal calcs with the concept shown in this sample -
http://www.ninjatrader-support2.com/...ead.php?t=4991
Bertrand
NinjaTrader Customer Service |
|
|
|
|
|
#3 |
|
Member
Join Date: Oct 2008
Posts: 70
Thanks: 1
Thanked 2 times in 2 posts
|
Hi Bertrand
I am trying to do the opposite (I think thats what you would call it) My strategy takes 1 position at a time, long or short --- and checks the current state using Position.Quantity When I have an open position, I would like my indicator to stop printing messages to the output window something like: if (Position.Quantity > 0) do nothing else print a bunch of stuff to the output window I know I cannot uses Open.Position from the indicator -- but I'm thinking I can pass a value from the strategy back to the indicator is this possible? thanks |
|
|
|
|
|
#4 |
|
NinjaTrader Customer Service
Join Date: Sep 2008
Location: Germany
Posts: 22,414
Thanks: 252
Thanked 978 times in 961 posts
|
Unfortunately this is not supported, as strategies do not allow cross communication. I think you could achieve what you want by reading / writing values from / to text files.
http://www.ninjatrader-support2.com/...ead.php?t=3477
Bertrand
NinjaTrader Customer Service |
|
|
|
|
|
#5 |
|
Member
Join Date: Oct 2008
Posts: 70
Thanks: 1
Thanked 2 times in 2 posts
|
Thanks Bertrand
I will go that route, I'm new to C# so taking it one step at a time |
|
|
|
![]() |
| Thread Tools | |
| Display Modes | |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Variable transfer/access between OnBarUpdate and OnExecution | noincomenojobnoassets | Strategy Development | 9 | 09-23-2009 03:36 AM |
| ADX indicator not providing public access to data | RandyT | Automated Trading | 8 | 06-02-2009 03:02 PM |
| How can access a variable defined in other section | jrbolsa | General Programming | 6 | 04-06-2009 12:42 PM |
| Can I access Public Indicator Variables from Strategy | rrv1980 | Strategy Development | 13 | 08-24-2008 05:31 PM |
| access variable outside of if block? | auspiv | General Programming | 6 | 07-13-2008 07:52 PM |