//This namespace holds Indicators in this folder and is required. Do not change it.
namespace NinjaTrader.NinjaScript.Indicators
{
public class Aziocane : Indicator
{
MemoryMappedFile file;
private int nData = 0;
private double bidPrice;
private double askPrice;
protected override void OnStateChange()
{
if (State == State.SetDefaults)
{
Description = @"Enter the description for your new custom Indicator here.";
Name = "Aziocane";
Calculate = Calculate.OnBarClose;
IsOverlay = false;
DisplayInDataBox = true;
DrawOnPricePanel = true;
DrawHorizontalGridLines = true;
DrawVerticalGridLines = true;
PaintPriceMarkers = true;
ScaleJustification = NinjaTrader.Gui.Chart.ScaleJustification.Right;
//Disable this property if your indicator requires custom values that cumulate with each new market data event.
//See Help Guide for additional information.
IsSuspendedWhileInactive = true;
}
else if (State == State.Configure)
{
file = MemoryMappedFile.CreateOrOpen("Test", 1000, MemoryMappedFileAccess.ReadWrite);
}
else if (State == State.Terminated)
{
file.Dispose();
}
}
protected override void OnBarUpdate()
{
//Add your custom indicator logic here.
}
protected override void OnMarketData(MarketDataEventArgs e)
{
nData++;
try
{
Print(nData++.ToString());
}
catch
{
Print("Data file busy...");
}
}
}
}
when i print a variable nData jump some number ?? o_O i think is slow increase variable and change Tostring , is possible resolve this bug ??

Comment