Hi there folks, I need some help with the market hours.

I want to send orders only when the market is open, the way I'm trying to do it is as follow:

// Class fields

bool is MarketOpen

SecurityExchange Market = new SecurityExchange();

public void OnData(TradeBars data)

{

isMarketOpen = Market.DateTimeIsOpen(Time) && Market.DateTimeIsOpen(Time.AddMinutes(10));

if (isMarketOpen)

{

// Loss all your money, but efficiently

}

}

But when I run the backtest, some days, some orders are sent at 16:00 hs.

// Log output

2015-01-02 16:00:00 Converted OrderID: 238 into a MarketOnOpen order.

2015-01-05 16:00:00 Converted OrderID: 338 into a MarketOnOpen order.

2015-01-13 16:00:00 Converted OrderID: 1071 into a MarketOnOpen order.

2015-01-13 16:00:00 Converted OrderID: 1072 into a MarketOnOpen order.

2015-01-14 16:00:00 Converted OrderID: 1190 into a MarketOnOpen order.

2015-01-16 16:00:00 Converted OrderID: 1433 into a MarketOnOpen order.

2015-01-20 16:00:00 Converted OrderID: 1548 into a MarketOnOpen order.

2015-01-30 16:00:00 Converted OrderID: 2419 into a MarketOnOpen order.

Am I missing something?

Thanks in advance, JJ