Welcome to NexusFi: the best trading community on the planet, with over 150,000 members Sign Up Now for Free
Genuine reviews from real traders, not fake reviews from stealth vendors
Quality education from leading professional traders
We are a friendly, helpful, and positive community
We do not tolerate rude behavior, trolling, or vendors advertising in posts
We are here to help, just let us know what you need
You'll need to register in order to view the content of the threads and start contributing to our community. It's free for basic access, or support us by becoming an Elite Member -- see if you qualify for a discount below.
-- Big Mike, Site Administrator
(If you already have an account, login at the top of the page)
Is it possible for two different charts that use the same symbol in their DataSeries to share a common variable ? Does the concept of Global Variable exist in Ninja ?
Can you help answer these questions from other members on NexusFi?
If I understand your question, the answer would be no. Two charts cannot communicate with one another. I suspect you have something else in mind such as an Indicator or Strategy. If this is the case, give more information and there may be a programming technique to get what youneed.
I might have some ideas but if Global variables are not supported then i am not sure what to think. I/RT supports it very well. Let's take an easy task (in my mind), i use a SMA(8) on a Range chart and would like to pass the current value of this RangeChart(x).SMA(8) to another chart that is a tick chart for example. Is this possible ?
If you are only trying to display the value, you are looking at a multi timeframe Indicator. The indicator would be applied to the "other chart". you wouldn't actually need the RangeChart open. This is not trivial, but can be done, and would need to be coded.
You could just add both series to a single chart, apply the indicator to the range series but it plot it over top of the other tick series and hide the range series...If I understand what you want to do correctly.
I haven't had the need tor two charts to talk to each other, but I get an indicator to talk to a strategy using this:
//### This is for External strategies.
//### Update() ensures this exposed variable is up to date, when external strategy Add()'s this indicator
public string TradeCommand {
get { Update(); return tradeCommand; }
Set { tradeCommand = value; }
}
And I get one indicator to share variables with another indicator like this:
public class GlobalChartVars {
public static Dictionary<string, string> chartIds = new Dictionary<string, string>();
public static Dictionary<string, string> SoundFiles = new Dictionary<string, string>();
}
I think the 2nd one should be able to share data between charts. I haven't tried it that way, but maybe that can give you some ideas.
- I have done some work in this space
- it is possible to share the values using globalvariable.dll (tradestation dll)
- I would do a cleanup of the code and post in elite downloads section soon.