Using the SampleATMStrategy as the base
I am trying to get this Strategy to work but there is a small issue that i just cant see
I want that after the bar is complete a BUY order is triggered 2 Ticks above the high of the bar and a Sell order 2 Ticks below the bar
This seem to just trigger both immediatly at the current price
It must be simple but i just cant see it
// Submits an entry limit order at the current low price to initiate an ATM Strategy if both order id and strategy id are in a reset state
// **** YOU MUST HAVE AN ATM STRATEGY TEMPLATE NAMED 'AtmStrategyTemplate' CREATED IN NINJATRADER (SUPERDOM FOR EXAMPLE) FOR THIS TO WORK ****
if (orderIdS.Length == 0 && atmStrategyIdS.Length == 0 )
{
atmStrategyIdS = GetAtmStrategyUniqueId();
orderIdS = GetAtmStrategyUniqueId();
AtmStrategyCreate(Cbi.OrderAction.Sell, OrderType.Limit, Low[0] + 2 * TickSize, 0, TimeInForce.Day, orderIdS, "TF3", atmStrategyIdS);
}
if (orderIdB.Length == 0 && atmStrategyIdB.Length == 0 )
{
atmStrategyIdB = GetAtmStrategyUniqueId();
orderIdB = GetAtmStrategyUniqueId();
AtmStrategyCreate(Cbi.OrderAction.Buy, OrderType.Limit, High[0] + 2 * TickSize, 0, TimeInForce.Day, orderIdB, "TF3", atmStrategyIdB);
}
Comment