| Overall Statistics |
|
Total Trades 344 Average Win 0.16% Average Loss -0.01% Compounding Annual Return 14.094% Drawdown 9.000% Expectancy 5.889 Net Profit 9.212% Sharpe Ratio 2.722 Probabilistic Sharpe Ratio 99.979% Loss Rate 59% Win Rate 41% Profit-Loss Ratio 16.00 Alpha 0.106 Beta -0.042 Annual Standard Deviation 0.035 Annual Variance 0.001 Information Ratio -1.178 Tracking Error 0.115 Treynor Ratio -2.28 Total Fees $0.00 Estimated Strategy Capacity $770000.00 Lowest Capacity Asset ETHUSD XJ |
using System.Collections.Generic;
using QuantConnect.Data;
using QuantConnect.Indicators;
namespace QuantConnect.Algorithm.CSharp
{
public class CryptoTest : QCAlgorithm
{
Dictionary<Symbol, MomentumPercent> moms = new Dictionary<Symbol, MomentumPercent>();
string[] symbols = new string[] {"ETHUSD", "BTCUSD"};
public override void Initialize()
{
SetStartDate(2021, 1, 1); // Set Start Date
SetEndDate(2021, 9, 1); // Set Start Date
SetCash("USD", 10000); // Set Strategy Cash
//etBrokerageModel(Brokerages.BrokerageName.GDAX, AccountType.Cash);
foreach (string symbol in symbols) {
AddCrypto(symbol, Resolution.Minute);
moms[symbol] = MOMP(symbol, 60, Resolution.Minute);
}
}
/// 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)
{
foreach (KeyValuePair<Symbol, MomentumPercent> kvp in moms) {
if (data.Bars.ContainsKey(kvp.Key)) {
var last_price = data.Bars[kvp.Key].Close;
if (kvp.Value < -9) {
SetHoldings(kvp.Key, 0.2);
} else {
Liquidate(kvp.Key);
}
}
}
}
}
}