| Overall Statistics |
|
Total Trades 9079 Average Win 0.03% Average Loss -0.02% Compounding Annual Return 2.288% Drawdown 13.800% Expectancy 0.113 Net Profit 11.989% Sharpe Ratio 0.296 Probabilistic Sharpe Ratio 3.651% Loss Rate 50% Win Rate 50% Profit-Loss Ratio 1.23 Alpha 0.032 Beta -0.097 Annual Standard Deviation 0.071 Annual Variance 0.005 Information Ratio -0.439 Tracking Error 0.202 Treynor Ratio -0.216 Total Fees $3525.59 |
namespace QuantConnect.Algorithm.CSharp
{
public class QuantumHorizontalContainmentField : QCAlgorithm
{
public override void Initialize()
{
// Set Start Date so that backtest has 5+ years of data
SetStartDate(2015, 8, 4);
// No need to set End Date as the final submission will be tested
// up until the review date
// Set $1m Strategy Cash to trade significant AUM
SetCash(1000000);
// Add a relevant benchmark, with the default being SPY
AddEquity("SPY");
SetBenchmark("SPY");
// Use the Alpha Streams Brokerage Model, developed in conjunction with
// funds to model their actual fees, costs, etc.
// Please do not add any additional reality modelling, such as Slippage, Fees, Buying Power, etc.
SetBrokerageModel(new AlphaStreamsBrokerageModel());
AddAlpha(new MacdAlphaModel(12, 26, 9, MovingAverageType.Exponential, Resolution.Daily));
SetExecution(new StandardDeviationExecutionModel(1, 2, Resolution.Daily));
SetPortfolioConstruction(new EqualWeightingPortfolioConstructionModel());
SetRiskManagement(new TrailingStopRiskManagementModel(0.03m));
AddUniverseSelection(new G10CurrencySelectionModel());
}
/// 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");
// }
}
}
}namespace QuantConnect.Algorithm.Framework.Selection {
public class G10CurrencySelectionModel : ManualUniverseSelectionModel
{
public G10CurrencySelectionModel() :
base(new[]
{
"EURUSD",
"GBPUSD",
"USDJPY",
"AUDUSD",
"NZDUSD",
"USDCAD",
"USDCHF",
"USDNOK",
"USDSEK"
}.Select(x => Symbol.Create(x,SecurityType.Forex, Market.Oanda))){
}
}
}