public class S_Trading_System : Indicator
{
protected override void OnStateChange()
{
if (State == State.SetDefaults)
{
Description = @"Enter the description for your new custom Indicator here.";
Name = "S_Trading_System";
Calculate = Calculate.OnEachTick;
IsOverlay = true;
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)
{
}
}
protected override void OnBarUpdate()
{
//Add your custom indicator logic here.
// Only process entry signals on a bar by bar basis (not tick by tick)
if (IsFirstTickOfBar)
{
if(CrossAbove(EMA(9),EMA(22),1))
Draw.Text(this, "crossabove" + Bars.TickCount, "look for long" , 1, Low[1]);
return;
}
// Process
}
}
}

Comment