I write my custom indicators in NinjaTrader, which has a scripting language built in C #. I would like to share data between different stock charts, but there is no inherent way for this. Each indicator is inherited from the Indicator class, and, of course, each chart launches a unique instance of any applied indicators.
For example, I would like to be able to βsendβ the current IBM price to an AAPL chart. Conceptually, on the βsendβ diagram, I need to do something like:
static double IBM = 190.72;
however, when the user changes the chart ticket from IBM to DELL, for example, I now need something like:
static double DELL = 9.25;
On my "receiving" chart, I would like to do something like Print (DELL);
So, my tendency is to have a variable name that is assigned dynamically based on the ticker symbol that the user has selected for the chart, however, I know that this is not possible in C #. So, what is a good alternative approach to storing and retrieving data that needs to be indexed by a ticker when there is an almost unlimited set of potential ticker values?
Casey source share