Same Strategy, Same Market, Same Time = Different trades!
I've been sim trading a strategy that calls an ATM when getting buy or sell signals, and last night copied it and took out the buy/sell actions and replaced them with playsound and drawarrow commands so it was a "signal only" strat.
I then ran both on live ES data, using signals generated by the "signal only" strat to manually enter trades in one of my brokerage accounts. All in a days work.
BUT... the "signal only" strat was generating calls that the sim trader never took, and in some cases sim trader kicked in a few bars later. The "signal only" strat appeared to follow the conditions in the strat perfectly, while the one that does the buy/sell was less predictable.
Any ideas on where I should look for errors?
FWIW the ATM call strategy is cut-and-paste from the factory example.
The call ATM one has this instead of the drawarrowup, etc:
// ATM Strategy code cut-and-paste from NT
// Make sure this strategy does not execute against historical data
// 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 'ES 2 w BE and Trail' CREATED IN NINJATRADER (SUPERDOM FOR EXAMPLE) FOR THIS TO WORK ****
if (orderId.Length == 0 && atmStrategyId.Length == 0 && Close > Open)
atmStrategyId = GetAtmStrategyUniqueId();
orderId = GetAtmStrategyUniqueId();
AtmStrategyCreate(Action.Buy, OrderType.Market, 0, 0, TimeInForce.Day, orderId, "ES 2 w BE and Trail", atmStrategyId);
// Check for a pending entry order
if (orderId.Length > 0)
string status = GetAtmStrategyEntryOrderStatus(orderId);
// If the status call can't find the order specified, the return array length will be zero otherwise it will hold elements
if (status.GetLength(0) > 0)
// Print out some information about the order to the output window
Print("The entry order average fill price is: " + status);
Print("The entry order filled amount is: " + status);
Print("The entry order order state is: " + status);
// If the order state is terminal, reset the order id value
if (status == "Filled" || status == "Cancelled" || status == "Rejected")
orderId = string.Empty;
} // If the strategy has terminated reset the strategy id
elseif (atmStrategyId.Length > 0 && GetAtmStrategyMarketPosition(atmStrategyId) == Cbi.MarketPosition.Flat)
atmStrategyId = string.Empty;
if (atmStrategyId.Length > 0)
// You can change the stop price
if (GetAtmStrategyMarketPosition(atmStrategyId) != MarketPosition.Flat)
AtmStrategyChangeStopTarget(0, Low - 3 * TickSize, "STOP1", atmStrategyId);
// Print some information about the strategy to the output window
Print("The current ATM Strategy market position is: " + GetAtmStrategyMarketPosition(atmStrategyId));
Print("The current ATM Strategy position quantity is: " + GetAtmStrategyPositionQuantity(atmStrategyId));
Print("The current ATM Strategy average price is: " + GetAtmStrategyPositionAveragePrice(atmStrategyId));
Print("The current ATM Strategy Unrealized PnL is: " + GetAtmStrategyUnrealizedProfitLoss(atmStrategyId));
i know from some examples where the printed values of indicators hasnt been the same as the values using this indicator in a strategy - always because of a special + unique coding-problem.
so your arrow+sound is a plotting-thing + order-execution is a strategy-thing.
i see you use the ADXVMA -- thats one of the examples i am talking about -- i had trouble too with that some time ago.
here is a link -- have a look + test it .