In other words is there a centralized, thread-safe data store that can be written to/read from anywhere?
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
Global Variables?
Collapse
X
-
Global Variables?
Hello I am in a situation where I would like to share data between two of my indicators. For example I would like to use the value returned by indicator A to derive the value of indicator B. Is there a way to do this?
In other words is there a centralized, thread-safe data store that can be written to/read from anywhere?Tags: None
-
Hello spiralhead,
Global variables in C# can be used but are not supported. I'm not sure you will need them in this case. You can easily access plots from other indicators. If the value is not a plot, we have a sample available for accessing these values from other indicators:
Ryan M.NinjaTrader Customer Service
-
-
Plots can be accessed by calling the indicator directly. The line below gets the most recent MACD average plot.
MACD(12, 26, 9).Avg[0]
The easiest way to get syntax for multi plot indicators is using the strategy wizard. You can select which plot you want from the GUI and then click view code option.
Ryan M.NinjaTrader Customer Service
Comment
-
Ninjatrader,
I need to know if UserDefinedMethods and Startegies are thread safe.
I'm running multiple strategies each of which call the same methods inside UserDefinedMethods.cs. In the methods, the below functions are called which are ment to refer to the the calling strategy.
Will each strategy & method combo be in it's own seperate thread? Or will the UserDefinedMethods pass results back to a 'wrong' strategy?
functions used ...
Position.MarketPosition == MarketPosition.Short
Position.AvgPrice
Performance.AllTrades.TradesPerformance.Currency.A vgProfit
DefaultQuantity
and so on
Comment
-
superstar,
We have automated strategy development webinars every other tuesday at 5:30 PM EST. These webinars are free, live and interactive.
Please see a link to our webinar schedule here : http://www.ninjatrader.com/webinars
Additionally, we have some tutorials in our help guide, please find a link below.
If you have limited time or programming abilities, you could contact one of our NinjaScript consultants.
Please let us know if you require additional assistance.Adam P.NinjaTrader Customer Service
Comment
Latest Posts
Collapse
Topics | Statistics | Last Post | ||
---|---|---|---|---|
Started by mly916, Today, 09:48 PM
|
0 responses
6 views
0 likes
|
Last Post
by mly916
Today, 09:48 PM
|
||
Started by Mikey_, Today, 09:21 PM
|
0 responses
10 views
0 likes
|
Last Post
by Mikey_
Today, 09:21 PM
|
||
Started by cre8able, Today, 05:53 PM
|
3 responses
13 views
0 likes
|
Last Post
by cre8able
Today, 09:20 PM
|
||
Started by Aryan Kumar, Today, 09:04 PM
|
0 responses
4 views
0 likes
|
Last Post
by Aryan Kumar
Today, 09:04 PM
|
||
Started by yertle, Yesterday, 05:49 PM
|
3 responses
16 views
0 likes
|
Last Post
by Mindset
Today, 08:38 PM
|
Comment