| Overall Statistics |
|
Total Trades 1 Average Win 0% Average Loss 0% Compounding Annual Return 742.260% Drawdown 5.900% Expectancy 0 Net Profit 9.152% Sharpe Ratio 4.477 Probabilistic Sharpe Ratio 85.859% Loss Rate 0% Win Rate 0% Profit-Loss Ratio 0 Alpha 1.672 Beta -0.094 Annual Standard Deviation 0.367 Annual Variance 0.135 Information Ratio 3.464 Tracking Error 0.381 Treynor Ratio -17.518 Total Fees $18.20 |
namespace QuantConnect.Algorithm.CSharp
{
public class ProblemWithVXXDataDemo : QCAlgorithm
{
public override void Initialize()
{
SetStartDate(2018, 1, 17); //Set Start Date
SetEndDate(2018, 1, 31); //Set Start Date
//SetStartDate(2013, 10, 11); //Set Start Date
SetCash(100000); //Set Strategy Cash
// Universe Selection. In this case we just buy the market, VXX.
UniverseSettings.Resolution = Resolution.Minute;
var symbols = new [] { QuantConnect.Symbol.Create("VXX", SecurityType.Equity, Market.USA) };
AddUniverseSelection( new ManualUniverseSelectionModel(symbols) );
// Alpha Creation. We want to be long the entire time.
AddAlpha( new ConstantAlphaModel(InsightType.Price, InsightDirection.Up, TimeSpan.FromDays(5*365) ));
// Portfolio Construction. Equal Weight will just assign 100% to our single symbol.
SetBrokerageModel(new DefaultBrokerageModel(AccountType.Margin));
SetPortfolioConstruction( new EqualWeightingPortfolioConstructionModel());
// Risk Management. No risk management.
AddRiskManagement( new NullRiskManagementModel() );
// Execution. Execute with market order.
SetExecution( new ImmediateExecutionModel() );
}
/// OnData event is the primary entry point for your algorithm. Each new data point will be pumped in here.
/// Slice object keyed by symbol containing the stock data
public override void OnData(Slice data)
{
// if (!Portfolio.Invested)
// {
// SetHoldings(_spy, 1);
// Debug("Purchased Stock");
//}
}
}
}