Overall Statistics |
Total Trades 157 Average Win 0.44% Average Loss -0.24% Compounding Annual Return 6.943% Drawdown 13.300% Expectancy 1.504 Net Profit 106.231% Sharpe Ratio 0.898 Loss Rate 13% Win Rate 87% Profit-Loss Ratio 1.88 Alpha 0.047 Beta 0.126 Annual Standard Deviation 0.063 Annual Variance 0.004 Information Ratio -0.123 Tracking Error 0.167 Treynor Ratio 0.453 Total Fees $157.00 |
namespace QuantConnect { public class DontLoseMoneySaysBuffet : QCAlgorithm { public override void Initialize() { SetStartDate(2007, 1, 1); SetEndDate(DateTime.Now); // cash allocation SetCash(10000); AddEquity("SPY", Resolution.Daily); AddEquity("TLT", Resolution.Daily); AddEquity("IEF", Resolution.Daily); AddEquity("GLD", Resolution.Daily); AddEquity("PCRCX", Resolution.Daily); } private DateTime _lastRebalance; public override void OnData(Slice data) { if (_lastRebalance != DateTime.MinValue && _lastRebalance.Month == Time.Month) return; _lastRebalance = Time; SetHoldings("SPY", 0.3); SetHoldings("TLT", 0.4); SetHoldings("IEF", 0.15); SetHoldings("GLD", 0.075); SetHoldings("PCRCX", 0.075); } } }