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)
One assumption is that the vendor has coded the indicator so you are able to reference it. Here are the other things to check:
1. Open a Ninjascript in Ninja to edit the code, right click, go to references, make sure the DLL is referenced--if its not, add the reference (there are other threads that describe this). Restart Ninja if it was already there
2. Go to bin\Custom and make sure there is a CS file with the same name as your DLL. Add the CS if it wasn't there and restart and compile
3. Open the CS file
4. In the CS file, find the name of the indicator that you are trying to reference. If you can't find it, you are out of luck. Even if you can find it, does not mean you are in the clear yet
5. You want the part that looks like "public INDICATOR_NAME (Color variable1, bool variable2, int variable 3, etc.) { return INDICATOR_NAME(variable1, variable2, variable3) }"--replace everything in quotes with the specific variables and names for your indicator
6. Now, in the indicator you are trying to use to reference the vendors indicator, you will need to reference it using everything in step 5. Some vendors leave it blank, so you will have to reference the indicator like this: IndicatorName().
7. Assuming you make it to step 6, you will have to use Ninja intellisense to finish reference the public portion of the DLL, which sometimes is not public, so you could do all this work and it could be for nothing. Enter the reference for the indicator (i.e. IndicatorReference(variable1, variable2, variable 3)) and then put a period after it and Ninja should bring up a list of public variables for that indicator. If it doesn't then you can try one more thing
8. Go to the vendor indicator and in the parameters area, see if a plot is at the bottom where you can change the color and dash styles. Get the name of the plot and try referencing it in step 7. If that doesn't work, go to the vendor and ask them to make the variables public so you can reference them externally
One assumption is that the vendor has coded the indicator so you are able to reference it. Here are the other things to check:
1. Open a Ninjascript in Ninja to edit the code, right click, go to references, make sure the DLL is referenced--if its not, add the reference (there are other threads that describe this). Restart Ninja if it was already there
2. Go to bin\Custom and make sure there is a CS file with the same name as your DLL. Add the CS if it wasn't there and restart and compile
3. Open the CS file
4. In the CS file, find the name of the indicator that you are trying to reference. If you can't find it, you are out of luck. Even if you can find it, does not mean you are in the clear yet
5. You want the part that looks like "public INDICATOR_NAME (Color variable1, bool variable2, int variable 3, etc.) { return INDICATOR_NAME(variable1, variable2, variable3) }"--replace everything in quotes with the specific variables and names for your indicator
6. Now, in the indicator you are trying to use to reference the vendors indicator, you will need to reference it using everything in step 5. Some vendors leave it blank, so you will have to reference the indicator like this: IndicatorName().
7. Assuming you make it to step 6, you will have to use Ninja intellisense to finish reference the public portion of the DLL, which sometimes is not public, so you could do all this work and it could be for nothing. Enter the reference for the indicator (i.e. IndicatorReference(variable1, variable2, variable 3)) and then put a period after it and Ninja should bring up a list of public variables for that indicator. If it doesn't then you can try one more thing
8. Go to the vendor indicator and in the parameters area, see if a plot is at the bottom where you can change the color and dash styles. Get the name of the plot and try referencing it in step 7. If that doesn't work, go to the vendor and ask them to make the variables public so you can reference them externally
Thanks Jack for your valuable reply.
1. I actually cannot add reference because, the user can add dll in custom directory and I think user will not add reference to each new dll each time.
2. I use Reflection to get the DataSeries (for SMA any other Ninja's indicator, I can get DataSeries)
Type type = base.GetType();
MethodInfo mi = type.GetMethod("SMA", new Type[] { Type.GetType("System.Int32") });
DataSeries dataSeries = new DataSeries((IndicatorBase)mi.Invoke(this, new object[] { 14 }));
but I cannot get the DataSeries for Third-party indicators with the below code(Note that GetTypeFromAllAssemblies() is a method which loop through all assemblies and return as Type)
Type type = this.GetTypeFromAllAssemblies("NinjaTrader.Indicator.KPMWAP");
MethodInfo mi = type.GetMethod("KPMWAP", new Type[] { Type.GetType("System.Int32") });
DataSeries dataSeries = new DataSeries((IndicatorBase)mi.Invoke(this, new object[] { 3 }))
What is the possible way to get DataSeries for Third-party indicators?