Overall Statistics
Total Trades
0
Average Win
0%
Average Loss
0%
Compounding Annual Return
0%
Drawdown
0%
Expectancy
0
Net Profit
0%
Sharpe Ratio
0
Loss Rate
0%
Win Rate
0%
Profit-Loss Ratio
0
Alpha
0
Beta
0
Annual Standard Deviation
0
Annual Variance
0
Information Ratio
0
Tracking Error
0
Treynor Ratio
0
Total Fees
$0.00
using System;
using System.Linq;
using QuantConnect.Data;
using QuantConnect.Data.Market;
using QuantConnect.Orders;
using QuantConnect.Securities;

namespace QuantConnect.Algorithm.CSharp
{
    public class BasicTemplateFuturesAlgorithm : QCAlgorithm
    {
        private const string RootSP500 = Futures.Indices.SP500EMini;
        public Symbol SP500 = QuantConnect.Symbol.Create(RootSP500, SecurityType.Future, Market.USA);

        public override void Initialize()
        {
            SetStartDate(2016, 08, 17);
            SetEndDate(2016, 08, 20);
            SetCash(1000000);

            var futureSP500 = AddFuture(SP500.Underlying.Value);
            futureSP500.SetFilter(TimeSpan.Zero, TimeSpan.FromDays(182));
			
            //var consolidator = new TradeBarConsolidator(TimeSpan.FromMinutes(5));
            //consolidator.DataConsolidated += OnDataConsolidated;
            //SubscriptionManager.AddConsolidator(SP500.Value, consolidator);			

            var benchmark = AddEquity("SPY");
            SetBenchmark(benchmark.Symbol);
        }

        public void OnDataConsolidated(object sender, TradeBar tradeBar)
        {
        }
    }
}