2012 was a rough year for SPY.

using System;

using System.Collections;

using System.Collections.Generic;

namespace QuantConnect {

using QuantConnect.Securities;

using QuantConnect.Models;

public partial class BasicTemplateAlgorithm : QCAlgorithm, IAlgorithm {

bool bTraded = false;

DateTime nextDate = new DateTime();

public override void Initialize() {

SetStartDate(2012, 06, 01);

SetEndDate(2012, 06, 30);

SetCash(30000);

SetRunMode(RunMode.Series);

AddSecurity(SecurityType.Equity, "SPY", Resolution.Minute);

}

public override void OnTradeBar(Dictionary securityData) {

if (Time.Date > nextDate) {

if (Time.Hour > 12 && !bTraded) {

Order("SPY", 10);

bTraded = false;

nextDate = Time.Date.AddHours(48);

}

}

}

}

}