Overall Statistics
Total Orders
1
Average Win
0%
Average Loss
0%
Compounding Annual Return
-1.096%
Drawdown
36.300%
Expectancy
0
Net Profit
-10.384%
Sharpe Ratio
-0.217
Sortino Ratio
-0.147
Probabilistic Sharpe Ratio
0.004%
Loss Rate
0%
Win Rate
0%
Profit-Loss Ratio
0
Alpha
-0.036
Beta
0.189
Annual Standard Deviation
0.099
Annual Variance
0.01
Information Ratio
-0.659
Tracking Error
0.152
Treynor Ratio
-0.114
Total Fees
$0.00
Estimated Strategy Capacity
$0
Lowest Capacity Asset
WIKI/IBM.NasdaqCustomColumns 2S
Portfolio Turnover
0.03%
#region imports
    using System;
    using System.Collections;
    using System.Collections.Generic;
    using System.Linq;
    using System.Globalization;
    using System.Drawing;
    using QuantConnect;
    using System.Text.RegularExpressions;
    using QuantConnect.Algorithm.Framework;
    using QuantConnect.Algorithm.Framework.Selection;
    using QuantConnect.Algorithm.Framework.Alphas;
    using QuantConnect.Algorithm.Framework.Portfolio;
    using QuantConnect.Algorithm.Framework.Execution;
    using QuantConnect.Algorithm.Framework.Risk;
    using QuantConnect.Algorithm.Selection;
    using QuantConnect.Parameters;
    using QuantConnect.Benchmarks;
    using QuantConnect.Brokerages;
    using QuantConnect.Util;
    using QuantConnect.Interfaces;
    using QuantConnect.Algorithm;
    using QuantConnect.Indicators;
    using QuantConnect.Data;
    using QuantConnect.Data.Consolidators;
    using QuantConnect.Data.Custom;
    using QuantConnect.DataSource;
    using QuantConnect.Data.Fundamental;
    using QuantConnect.Data.Market;
    using QuantConnect.Data.UniverseSelection;
    using QuantConnect.Notifications;
    using QuantConnect.Orders;
    using QuantConnect.Orders.Fees;
    using QuantConnect.Orders.Fills;
    using QuantConnect.Orders.Slippage;
    using QuantConnect.Scheduling;
    using QuantConnect.Securities;
    using QuantConnect.Securities.Equity;
    using QuantConnect.Securities.Future;
    using QuantConnect.Securities.Option;
    using QuantConnect.Securities.Forex;
    using QuantConnect.Securities.Crypto;   
    using QuantConnect.Securities.Interfaces;
    using QuantConnect.Storage;
    using QCAlgorithmFramework = QuantConnect.Algorithm.QCAlgorithm;
    using QCAlgorithmFrameworkBridge = QuantConnect.Algorithm.QCAlgorithm;
#endregion

namespace QuantConnect.Algorithm.CSharp
{
    public class NasdaqImporterAlgorithm : QCAlgorithm
{
    private string nasdaqCode = "WIKI/IBM";
    private SimpleMovingAverage sma;

    public override void Initialize()
    {
        // Initialise the data and resolution required, as well as the cash and start-end dates for your algorithm.
        // All algorithms must be initialized.
        // Optional argument - personal token necessary for restricted dataset
        // NasdaqDataLink.SetAuthCode(this.GetParameter("nasdaq-data-link-api-key"));
        SetStartDate(2014, 4, 1);                           //Set Start Date
        SetEndDate(DateTime.Today.AddDays(-1));             //Set End Date
        SetCash(25000);                                     //Set Strategy Cash
        AddData<NasdaqCustomColumns>(nasdaqCode, Resolution.Daily, TimeZones.NewYork);
        sma = SMA(nasdaqCode, 14);
    }

    public override void OnData(Slice data)
    {
        // OnData event is the primary entry point for your algorithm. Each new data point will be pumped in here.
        if (!Portfolio.HoldStock)
        {
            SetHoldings(nasdaqCode, 1);
            Debug("Purchased " + nasdaqCode + " >> " + Time);
        }

        Plot(nasdaqCode, "PriceSMA", sma.Current.Value);
    }
}
}

// NasdaqDataLink often doesn't use close columns so need to tell LEAN which is the "value" column.
public class NasdaqCustomColumns : NasdaqDataLink
{
    // Custom nasdaq data type for setting customized value column name.
    // Value column is used for the primary trading calculations and charting.
    public NasdaqCustomColumns() : base("adj. close")
    {
        ValueColumnName = "adj. close";
    }
}