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)
NT indicator script compiling issuses / error while importing
Now I followed these directions on this page that some was kinda enough to give to me again, since I know you guys get this question a lot. That can be found here again at the top of the page.
How to import a .cs- file into NT (indicator or strategy)
- open the .cs-file in windows editor -- you should see lot of text here.
- do in Ninja > Tools > Edit NinjaSript > Indicator --- and open one indicator - no …
Now once I have copy and pasted and I hit the compile button I get this error message " The following Ninja Script file [s] have programming errors and must be resolved before compiling.
First in the download their are three seperate cs files. Do I place these all on the same sheet one after the other. Or do I open different sheets, and compile them seperately.
And if I do compile them seperately, on the first cs file, I'm receving the above error message.
Also I'm unsure of the name I'm supposed to copy. I think that it is in line 2, but the directions say it is "mostly" found in line 20 to 30. Is the copying of the name such a big deal? I mean would that make the code not work right? And if it is not such a big deal then the only problem I'm having is the above "error message" In detail is says
"Indicator\saedfhjasdhf.cs........The namespace "NinjaTrade.Indicator' already c....CS101 click for info...22.....18
"Indicator\ZigZagagnew.cs.......The namespace "NinjaTrader.Indicator'already c....CS101 click for info...52.....18
So their ya go, I hope someone can help, cause I have no clue
Thanks for any help, it's appreciated.
Can you help answer these questions from other members on NexusFi?
Ok through talking with someone at NJ, through email, I figured out how to figure out where the "error" is. So here is a copya and psate of what the program is high lighting when I double click on the error message. The part that I'm being told is the "error message" is in red and underlined.
And this is just a snipit of the indicator script, just to show where the "error message" is.
"
// This namespace holds all indicators and is required. Do not change it.
namespace NinjaTrader.Indicator
{
///<summary>
/// ZigZag indicator from the Ultimate Trading Guide by Hill, Pruitt, and Hill. A swing high occurs when price takes out the low of the highest bar. A swing low occurs when price takes out the high of the lowest bar. Span setting determines how many bars to look back for highest highs and lowest lows; i.e. span=5 on daily bars find weekly swings.
/// add HH/LL trend lines and rays 11/14/09 -Cory
/// add fib suite 11/25/09 - cory
///</summary>
[Description("ZigZag indicator from the Ultimate Trading Guide by Hill, Pruitt, and Hill. A swing high occurs when price takes out the low of the highest bar. A swing low occurs when price takes out the high of the lowest bar. Span setting determines how many bars to look back for highest highs and lowest lows; i.e. span=5 on daily bars find weekly swings.")]
publicclassZigZagUTC_TL_BarCount_Fibs_v5_1 : Indicator
{
#region Variables
// Wizard generated variables
privateint span = 2; // Default setting for Span
The red above is not an error message, it's a class name. But I digress. I downloaded the zip file and it compiled fine (NT 7 beta 18).
Here's what I think happened to you ... you most likely created another .cs file containing the class name above (which you highlighted in red), by following the import directions in your first post. Can you check something out ? Is there another file in the indicators directory
with this filename ... ZigZagUTC_TL_BarCount_Fibs.cs ?
Which got there via the unzip ? If so, and the file you created is also there, this is the problem. In this case, you should probably move the file you created to another directory
(maybe a subfolder under indicators ... myfiles ?), and then recompile (you just need to open one file
... say ZigZagUTC_TL_BarCount_Fibs.cs and hit F5). The NinjaScript compiler will compile all the source files in the indicators directory into the dll.
If this works, the takeaway from this is ... for the zip files, don't create a new file (unless you need to modify the indicator), just unzip the source into the indicators dir (assuming it's an indicator and not a strategy) and compile. Voila !