Yet, entries and exits happen only on bar open/close (which I understand are the same) events on the main data series. Even though Ninjascript output appears to confirm entries are on second dataseries.
Caluclations are set to Calculate = Calculate.OnPriceChange and I've tried with different indicators as well and get the same behavior.
What I would expect to see is the entry/exit happening is the entry exit happening at random points along a bar instead of always at close/open. What am I missing?
edit: tried to format code and it made it even less readable - how do I format code correctly?
2nd edit: Removed "Code" tags and now the INDENT function is working properly and it's readable
{
Name = "AZL";
Calculate = Calculate.OnPriceChange;
EntriesPerDirection = 1;
EntryHandling = EntryHandling.AllEntries;
IsExitOnSessionCloseStrategy = true;
ExitOnSessionCloseSeconds = 1800;
IsFillLimitOnTouch = false;
MaximumBarsLookBack = MaximumBarsLookBack.TwoHundredFiftySix;
OrderFillResolution = OrderFillResolution.High;
OrderFillResolutionType = BarsPeriodType.Tick;
OrderFillResolutionValue = 1;
Slippage = 0;
StartBehavior = StartBehavior.ImmediatelySubmitSynchronizeAccount;
TimeInForce = TimeInForce.Gtc;
TraceOrders = true;
RealtimeErrorHandling = RealtimeErrorHandling.StopCancelClose;
StopTargetHandling = StopTargetHandling.PerEntryExecution;
BarsRequiredToTrade = 20;
IsInstantiatedOnEachOptimizationIteration = false;
else if (State == State.Configure)
{
else if (State == State.DataLoaded)
{
linReg = LinReg(linRegLength);
protected override void OnBarUpdate()
{
if(BarsInProgress == 1) // 1 tick series
{
Print(Time[0] + " on BIP = " + BarsInProgress + " | Close[0]: " + Close[0]);
// Enter Long
if (CrossAbove(linReg, ema, 1))
{
// Enter Short
if (CrossBelow(linReg, ema, 1))
{

Comment