Overall Statistics |
Total Trades 0 Average Win 0% Average Loss 0% Compounding Annual Return 0% Drawdown 0% Expectancy 0 Net Profit 0% Sharpe Ratio NaN Loss Rate 0% Win Rate 0% Profit-Loss Ratio 0 Alpha NaN Beta NaN Annual Standard Deviation NaN Annual Variance NaN Information Ratio NaN Tracking Error NaN Treynor Ratio NaN Total Fees $0.00 |
using System; using QuantConnect.Algorithm; using QuantConnect.Data.Market; namespace QuantConnect { /* * QuantConnect University: Full Basic Template: * * The underlying QCAlgorithm class is full of helper methods which enable you to use QuantConnect. * We have explained some of these here, but the full algorithm can be found at: * https://github.com/QuantConnect/QCAlgorithm/blob/master/QuantConnect.Algorithm/QCAlgorithm.cs */ public class BasicTemplateAlgorithm : QCAlgorithm { private Series scatter; //Initialize the data and resolution you require for your strategy: public override void Initialize() { //Start and End Date range for the backtest: SetStartDate(2015, 01, 07); SetEndDate(2015, 01, 07); //Cash allocation SetCash(25000); //Add as many securities as you like. All the data will be passed into the event handler: AddSecurity(SecurityType.Equity, "SPY", Resolution.Minute); var chart = new Chart("data"); scatter = new Series("scatter", SeriesType.Scatter); chart.AddSeries(scatter); AddChart(chart); } //Data Event Handler: New data arrives here. "TradeBars" type is a dictionary of strings so you can access it by symbol. public void OnData(TradeBars data) { var x = Time.Millisecond + Time.Ticks; scatter.AddPoint(new DateTime(x), (decimal) (Time.Hour*Math.Cos(x))); } } }