Overall Statistics |
Total Trades 2 Average Win 1.18% Average Loss 0% Compounding Annual Return 30.631% Drawdown 0.500% Expectancy 0 Net Profit 1.178% Sharpe Ratio 3.843 Probabilistic Sharpe Ratio 75.987% Loss Rate 0% Win Rate 100% Profit-Loss Ratio 0 Alpha 0.239 Beta 0.004 Annual Standard Deviation 0.062 Annual Variance 0.004 Information Ratio 4.339 Tracking Error 0.193 Treynor Ratio 64.894 Total Fees $8.60 |
namespace QuantConnect.Algorithm.CSharp { public class MultidimensionalDynamicCircuit : QCAlgorithm { public override void Initialize() { SetStartDate(2020, 10,15); //Set Start Date SetCash(100000); //Set Strategy Cash AddEquity("AAPL", Resolution.Daily); AddData<Signal>("SIGNAL", Resolution.Daily); } /// 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 void OnData(Signal data) { if (data.Value == 1) { SetHoldings("AAPL", 1); } else if (data.Value == 0) { Liquidate("AAPL"); } } } } public class Signal : BaseData { public decimal MaxC = 0; public decimal MinC = 0; public string errString = ""; public override SubscriptionDataSource GetSource( SubscriptionDataConfig config, DateTime date, bool isLive) { var source = "https://raw.githubusercontent.com/shilewenuw/FileHost/master/data.csv"; return new SubscriptionDataSource(source, SubscriptionTransportMedium.RemoteFile); } public override BaseData Reader( SubscriptionDataConfig config, string line, DateTime date, bool isLive) { if (string.IsNullOrWhiteSpace(line) || char.IsLetter(line[0])) return null; var data = line.Split(','); return new Signal() { Time = DateTime.ParseExact(data[0], "MM/dd/yyyy", null), Symbol = data[1], Value = Convert.ToDecimal(data[2]) }; } }