Overall Statistics |
Total Trades 1 Average Win 0% Average Loss 0% Compounding Annual Return 15.775% Drawdown 5.700% Expectancy 0 Net Profit 15.946% Sharpe Ratio 1.422 Loss Rate 0% Win Rate 0% Profit-Loss Ratio 0 Alpha 0.161 Beta -0.49 Annual Standard Deviation 0.106 Annual Variance 0.011 Information Ratio 1.236 Tracking Error 0.106 Treynor Ratio -0.309 Total Fees $3.27 |
namespace QuantConnect.Algorithm.CSharp { /// <summary> /// Basic template algorithm simply initializes the date range and cash. This is a skeleton /// framework you can use for designing an algorithm. /// </summary> public class BasicTemplateAlgorithm : QCAlgorithm { private Symbol _spy = QuantConnect.Symbol.Create("SPY", SecurityType.Equity, Market.USA); /// <summary> /// Initialise the data and resolution required, as well as the cash and start-end dates for your algorithm. All algorithms must initialized. /// </summary> public override void Initialize() { SetStartDate(2013, 10, 07); //Set Start Date SetEndDate(2014, 10, 11); //Set End Date SetCash(100000); //Set Strategy Cash // Find more symbols here: http://quantconnect.com/data // Forex, CFD, Equities Resolutions: Tick, Second, Minute, Hour, Daily. // Futures Resolution: Tick, Second, Minute // Options Resolution: Minute Only. AddEquity("SPY", Resolution.Minute); // There are other assets with similar methods. See "Selecting Options" etc for more details. // AddFuture, AddForex, AddCfd, AddOption } /// <summary> /// OnData event is the primary entry point for your algorithm. Each new data point will be pumped in here. /// </summary> /// <param name="data">Slice object keyed by symbol containing the stock data</param> public override void OnData(Slice data) { if (!Portfolio.Invested) { SetHoldings(_spy, 1); Debug("Purchased Stock"); } } } }