My Ninja worked itself into a tangle so let me start from the beginning:
I started programing my indicator called CompareTickers.
The indicator compiled but when I added in onto a candlestick chart it
produced no results. There were no lines in the bottom of the window.
(I figure that 'it compiled' so it was coherent to the compiler
but 'my programing logic/code was wrong')
Then I went to bed.
The following day I reflected on the problem and decided that perhaps
someone may have already done something similar, so why debug my code
and 're-invent the wheel' instead of searching for the indicator on the web.
OK, I found a KJcorrelation.cs at
I downloaded it and then searched on the web where to put the file so that
Ninja can access it. It said in Documents/NinjaTrader7/bin/Custom
so that's where I put it.
I then went to import it in Ninja 7 Control Centre:
File - Utilities - Import NinjaScript
.... and this is where things start to get just a little weird ...
It gave me an error message saying it can't compile because other Ninja Script
Assemblies have compile errors in them and these need to be corrected first.
So I thought, 'It must be the CompareTickers indicator I was working on the other night', so I went to Edit and Compile this CompareTickers to see what sort of error it supposedly had even though I believed it DID compile on the previous night and only
produced a null result in the window - which is not the same as not compiling.
Or so I thought.
(First I tried: Tools/Edit Ninjascript and Delete CompareTickers, but it wouldn't allow me to do that.)
Anyway, upon trying to compile the indicator CompareTickers it game me a compile error which said something like 'alglib not present' line 11 pos 7.
And that's really weird! It's bizarre because CompareTickers had NOTHING to do with the alglib maths library - the maths library was used by KJcorrelation!
So I thought 'Well the KJcorrelation must have imported, otherwise why would the
system be looking for "alglib"?' But when I checked, KJcorrelation was not among
the indicators!!
Now I realise that in the forum thread above, it had specified a specific
sequence of events to making KJcorrelation work by firstly downloading and
copying the alglib math library files into Documents/ninjatrader7/bin/Custom/Indicators BEFORE trying to get the KJcorrelation indicator on board (and not by importing it, but by copying it to ...bin/Custom/Indicators and then Editing it and Compiling it - of all things) and so I haven't followed this special sequence, I do admit this but sheesh, is this complicated or what?
And of course now, I am in an even more difficult position because
I have these two indicators that don't compile - neither of them!
Well at that point I thought I better follow the special sequence of unzipping and
copying the alglib files to ...bin/Custom/Indicators and hopefuly Ninja will find all the files and both of the indicators will hopefully compile. I also moved the KJcorrelation from ..bin/Custom to ../bin/Custom/Indicator.
But that didn't help, the error is:
Indicator\KJCorrelation.cs A using namespace directive can only be applied to namespaces; 'alglib' is a type not a namespace CS0138-click for info L11 Col7
Then I commented out all (two actually) references to alglib in the KJcorrelation (Line11 pos7 and one other place)
indicator code (of course there were no references to it in CompareTickers) and tried
to compile it - the error given differs from previous one but neither file compiles - I am pulling my hair out!!
Indicator\alglib_info.cs Duplicate 'System.Reflection.AssemblyCompanyAttribute' attribute CS0579-click for info L2 Col11
Indicator\alglib_info.cs Duplicate 'System.Reflection.AssemblyProductAttribute' attribute CS0579-click for info L3 Col11
Is there some way to either untangle this mess or just to 'start over' by deleting something and getting a clean slate?
Many thanks in advance, Mark.
Comment