I have a strategy that executes a buy based on a different instrument. Eg.
In Initialize() I have
Add("MSFT",PeriodType.Minute,1);
In OnBarUpdate() I have
if (CrossAbove(SMA(Closes[1],10), SMA(Closes[1],20), 1))
{
EnterLong(DefaultQuantity, "");
}
[There are similar statements for shorts, etc. I've confirmed details do not matter.]
In weeks of backtesting and live on Monday and Wensday this executed fine applied to a chart of YM.
Yesterday (Tuesday) the strategy never placed an order. I confirmed via the NT 6.5.1000.4 logs and IB logs that the strategy started, but then never did anything the entire day.
What was different yesterday? The only difference was that I did not have a separate chart of MSFT open in the background to collect data.
This looks like there is a bug in that data is not reaching my live strategy unless there is a different window open. The YM chart did claim to load MSFT when I started the strategy, so it knew it needed to, but it clearly did not receive the MSFT after that. The plotted away normally.
I am a bit concerned about applying this to real money until the origin of this anomaly is tracked down. A temporary fix is to just open another chart for the second instrument, but I want to be certain this is nothing deeper.
Comment