Overall Statistics
Total Trades
0
Average Win
0%
Average Loss
0%
Compounding Annual Return
1203.052%
Drawdown
0%
Expectancy
0
Net Profit
1200%
Sharpe Ratio
16.842
Probabilistic Sharpe Ratio
99.994%
Loss Rate
0%
Win Rate
0%
Profit-Loss Ratio
0
Alpha
20.842
Beta
0.354
Annual Standard Deviation
1.238
Annual Variance
1.533
Information Ratio
16.783
Tracking Error
1.241
Treynor Ratio
58.926
Total Fees
$0.00
namespace QuantConnect.Algorithm.CSharp
{
    public class ModulatedResistanceContainmentField : QCAlgorithm
    {
    	private static decimal monthlyDeposit = 1000m;
		private int? _lastTradeMonth;

        public override void Initialize()
        {
            SetStartDate(2015, 1, 1);
            SetEndDate(2016, 1, 1);
            
            SetCash(1000);
            AddEquity("SPY", Resolution.Hour);
        }

        /// 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)
        {
           	bool isNewMonth = _lastTradeMonth != data.Time.Month;
        	if(isNewMonth)
        	{
        		Portfolio.SetCash(Portfolio.Cash + monthlyDeposit);
        		Debug($"Monthly deposit {monthlyDeposit.ToString("C")} total: {Portfolio.Cash.ToString("C")}");
        		_lastTradeMonth = data.Time.Month;
        	}
        }
    }
}