The price is calculated correctly.
What am I missing?
if ( Close[1] > Open[1] )
longprice = Close[1] + ((Close[1]-Open[1])/2) + (offset * TickSize);
else if ( Close[1] < Open[1] )
longprice = Open[1] + ((Open[1]-Close[1])/2) + (offset * TickSize);
Print("Current ask price : "+ GetCurrentAsk(0)+" , buy stop market should be placed at : "+longprice);
TriggerCustomEvent(o =>
{
//Order stopOrder = null;
longOrder = myAccount.CreateOrder(Instrument,
OrderAction.Buy,
OrderType.StopMarket,
TimeInForce.Day,
nContractQuantity,
longprice,
0,
string.Empty,
"Entry",
null);
NinjaTrader.NinjaScript.AtmStrategy.StartAtmStrategy(AtmStrategyName1, longOrder);
myAccount.Submit(new[] { longOrder });
}, null);
}

Comment