I have been using Esignal for 9 years and have written many efs's. Now I would like to convert my efs's to NinjaTrader to take advantage of lower data costs and automated trading. But a feature that I use extensively is the Global Variable where the results from an efs in one subchart are stored in a Global variable then read by an efs in another chart or subchart.
I took a course at the local Junior College to learn the basics of C# and I'm just now starting to convert my code, but I'm not going to get very far without this capablilty. I know I could save the data to a file, but that would cause too much delay. I read in one of the posts that this might be accomplised by writing a dll.
Any help, direction, or examples would be appreciated.
indicator strategies are partial class (see userdefinedmethods.cs). you can define a static property etc and store the values there which can be called by any other indicators etc. very easy and convenient way of passing values.
The following user says Thank You to bukkan for this post:
I agree, a static is one way to go. But remember, a static is a class variable, not an instance variable. If you instantiate multiple instances of your class, they'll all use the same static variable. For example, my strats all use statics. But I only start one instance of each, because it's not clear which strat will update the static if I start multiple instances (a good multithreading issue).
The following 2 users say Thank You to kandlekid for this post:
Let's say I plot an SMA on a TICK chart then another on an ADD chart.
Now I want to access the current SMA data being calculated on TICK and then SMA on ADD.
I know that I can, within a code:
Then in the OnBarsUpdate section refer to the added data series and do an SMA on each but that's a waste of CPU. I want to access the SMA already being calculated on the ADD chart and TICK chart, so that if I add this code to, say 15 different instruments, I don't need to have all 15 instruments recalculating what I is alreayd being calculated on the TICK and the ADD charts.