Can I alter the structure in the following way to check for a Handshake on each tick
and process the rest of the multi Time frame indicator on Bar close.
Here is what I think I could be done. Is this going to work as I expect ?
namespace NinjaTrader.NinjaScript.Indicators
{
public class CalculateOnBarClose : Indicator
{
protected override void OnStateChange()
{
if (State == State.SetDefaults)
{
Description = @"Set a portion of Indicator to Update on Each Tick";
Name = "CalculateOnBarClose";
Calculate = Calculate.OnEachTick;
IsOverlay = false;
DisplayInDataBox = true;
DrawOnPricePanel = true;
DrawHorizontalGridLines = true;
DrawVerticalGridLines = true;
PaintPriceMarkers = true;
ScaleJustification = NinjaTrader.Gui.Chart.ScaleJustification.Right;
IsSuspendedWhileInactive = true;
}
else if (State == State.Configure)
{
}
}
protected override void OnBarUpdate()
{
if (IsFirstTickOfBar )
{
// HandShake with Strategy
}
else
switch(BarsInProgress)
{
// MultiTime Frame Code normally processsed on Bar Close is processed here.
}
}
}
}
Comment