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)
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.
TIA
Can you help answer these questions from other members on NexusFi?
If you need something that one study calculates available for another study, as long as you declare it as an 'exposed' dataSeries or variable, any study you create can access that information.
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.
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).
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:
Initialize section:
add("^TICK", PeriodType.Second,4)
add("^ADD", PeriodType.Second,4)
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.