string ohlc = ToDay(Time[0]) + " " + Open[0] + " " + High[0] + " " + Low[0] + " " + Close[0] + Environment.NewLine; //this is line 58
to:
string ohlc = ToDay(Time[0]) + " " + Open[0] + " " + High[0] + " " + Low[0] + " " + Close[0] + " " + Convert.ToString(CurrentBar) + Environment.NewLine;
When I went to compile this, I got the message:
The following Ninja Script files have programming errors and must be resolved before compiling:
Indicator\BarNumsOut2.cs The namespace 'NinjaTrader.Indicator' already contains a definition for 'SampleFileReadWrite' CS0101 - click for info 28 18
//CS0101 has no documentation
I'm new to C#, but have programmed in c before, as well as a few other languages, so I dug around online, and my best guess is that once SampleFileReadWrite was registered(?) as a derived class of NinjaTrader.Indicator, which happened when I tested out the original unaltered SampleFileReadWrite indicator, I was not allowed to compile the same code again (with my minor alteration) because it attempts to register *again* a public class of the same name, SampleFileReadWrite.
*Is this the problem I'm having?* If this is what is happening, would it be right to say that if I had not run the original SampleFileReadWrite indicator, which registered the class in the first place, I would not have had a problem the second time around with my modified version?
Based on this thinking, I first tried to delete the indicator from the list of compiled indicators, but I still got the error message when attempting to compile. So deleting the offending indicator did not remove the added class.
I then went back to my modified version and renamed every occurance of "SampleFileReadWrite" to "SampleFileReadWrite2", thinking this would allow a new class to be registered, albeit with the same functionality. This allowed the modified indicator to compile without the error message, but the indicator then did not appear at all in the indicator list available to a chart, whereas the original SampleFileReadWrite indicator, which is now removed, had done so.
So, having said all that, is there a way to remove the original SampleFileReadWrite class that the first, original indicator registered, so that the modified indicator will install? That would seem to be easiest, but is that even possible, or is that even my goal? Which is the best way to go from here?
Thanks,
Klopfgeist

.
Comment