In other words is there a centralized, thread-safe data store that can be written to/read from anywhere?
Announcement
Collapse
No announcement yet.
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 Hwop38, 05-04-2026, 07:02 PM
|
0 responses
160 views
0 likes
|
Last Post
by Hwop38
05-04-2026, 07:02 PM
|
||
|
Started by CaptainJack, 04-24-2026, 11:07 PM
|
0 responses
307 views
0 likes
|
Last Post
by CaptainJack
04-24-2026, 11:07 PM
|
||
|
Started by Mindset, 04-21-2026, 06:46 AM
|
0 responses
245 views
0 likes
|
Last Post
by Mindset
04-21-2026, 06:46 AM
|
||
|
Started by M4ndoo, 04-20-2026, 05:21 PM
|
0 responses
348 views
0 likes
|
Last Post
by M4ndoo
04-20-2026, 05:21 PM
|
||
|
Started by M4ndoo, 04-19-2026, 05:54 PM
|
0 responses
178 views
0 likes
|
Last Post
by M4ndoo
04-19-2026, 05:54 PM
|

Comment