https://ninjatrader.com/support/foru...3475&styleid=6
And when I try and use the indicator, it doesn't show up in the list of available indicators. I've opened it and complied it. I've even copied all the code and built a new indicator under that name and recompiled and saved it. No dice - it's still not showing up in the list of available indicators.
Any ideas?
Edit - Also, I did modify it to print OHLC information, but that's it...here's the code
namespace NinjaTrader.NinjaScript.Indicators
{
public class SampleStreamWriter : Indicator
{
private string path;
private StreamWriter sw; // a variable for the StreamWriter that will be used
protected override void OnStateChange()
{
if(State == State.SetDefaults)
{
Calculate = Calculate.OnBarClose;
Name = "Sample stream writer";
path = @"C:\[Removed file path]\Ninjatrader Export" + Instrument.FullName + ".txt";
}
// Necessary to call in order to clean up resources used by the StreamWriter object
else if(State == State.Terminated)
{
if (sw != null)
{
sw.Close();
sw.Dispose();
sw = null;
}
}
}
protected override void OnBarUpdate()
{
if (CurrentBar == 0)
sw = File.AppendText(path);
sw.WriteLine((Time[0]) + " " + Open[0] + " " + High[0] + " " + Low[0] + " " + Close[0]);
sw.Close();
}
}
}
Comment