| Overall Statistics |
|
Total Trades 1 Average Win 0% Average Loss 0% Compounding Annual Return 5.845% Drawdown 14.400% Expectancy 0 Net Profit 0% Sharpe Ratio 0.742 Loss Rate 0% Win Rate 0% Profit-Loss Ratio 0 Alpha 0 Beta 0 Annual Standard Deviation 0.079 Annual Variance 0.006 Information Ratio 0 Tracking Error 0 Treynor Ratio 0 Total Fees $1.00 |
namespace QuantConnect
{
/*
* QuantConnect University: Generic Quandl Data Importer
*
* Using the underlying dynamic data class "Quandl" we take care of the data
* importing and definition for you. Simply point QuantConnect to the Quandl Short Code.
*
* The Quandl object has properties which match the spreadsheet headers.
* If you have multiple quandl streams look at data.Symbol to distinguish them.
*/
public class QCUQuandlImporter : QCAlgorithm
{
string dividendCode = "SEC/AAPL_COMMONSTOCKDIVIDENDSPERSHAREDECLARED_Q";
string grossProfit = "SEC/AAPL_GROSSPROFIT_Q";
//Initialize the data and resolution you require for your strategy:
public override void Initialize()
{
SetCash(25000);
SetStartDate(2012, 1, 1);
SetEndDate(DateTime.Now.Date.AddDays(-1));
//Add Generic Quandl Data:
AddSecurity(SecurityType.Equity, "AAPL", Resolution.Minute);
AddData<QuandlSEC>(dividendCode, Resolution.Daily);
AddData<QuandlSEC>(grossProfit, Resolution.Daily);
}
public override void OnData(Slice data)
{
if (!Portfolio.Invested) Order("AAPL", 100);
var quandls = data.Get<Quandl>();
foreach(var key in quandls.Keys) {
Console.WriteLine(Time.ToString("o") + key + " " + quandls[key]);
}
}
}
// Custom quandl data type for setting customized value column name.
// Value column is used for the primary trading calculations and charting.
public class QuandlSEC : Quandl {
public QuandlSEC() : base(valueColumnName: "Value")
{
}
}
}