Overall Statistics |
Total Trades 163 Average Win 0.41% Average Loss -0.22% Compounding Annual Return 5.856% Drawdown 15.500% Expectancy 1.577 Net Profit 84.730% Sharpe Ratio 0.768 Loss Rate 11% Win Rate 89% Profit-Loss Ratio 1.89 Alpha 0.036 Beta 0.159 Annual Standard Deviation 0.063 Annual Variance 0.004 Information Ratio -0.179 Tracking Error 0.16 Treynor Ratio 0.305 Total Fees $163.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("GLD", Resolution.Daily); AddEquity("TLT", 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.25); SetHoldings("GLD", 0.25); SetHoldings("TLT", 0.25); } } }