| Overall Statistics |
|
Total Trades 1 Average Win 0% Average Loss 0% Compounding Annual Return -37.812% Drawdown 2.800% Expectancy 0 Net Profit -1.933% Sharpe Ratio -4.701 Loss Rate 0% Win Rate 0% Profit-Loss Ratio 0 Alpha 0.596 Beta -58.106 Annual Standard Deviation 0.086 Annual Variance 0.007 Information Ratio -4.879 Tracking Error 0.087 Treynor Ratio 0.007 Total Fees $1.79 |
namespace QuantConnect.Algorithm.CSharp
{
public class BasicTemplateAlgorithm : QCAlgorithm
{
public override void Initialize()
{
SetStartDate(2018, 6, 15); //Set Start Date
SetEndDate(2018, 6, 29); //Set End Date
SetCash(100000); //Set Strategy Cash
AddEquity("SPY", Resolution.Daily, Market.USA, true, 0, true);
Securities["SPY"].SetDataNormalizationMode(DataNormalizationMode.Raw);
}
public void OnData(TradeBars data)
{
if (!Portfolio.Invested)
{
SetHoldings("SPY", 1);
Debug("Purchased Stock");
}
foreach (var x in data)
{
var bar = x.Value;
Plot( "Trade Plot", "Close", bar.Close );
Plot( "Volume Plot", "Volume", bar.Volume ) ;
var startTime = bar.EndTime - bar.Period;
Debug("startTime: " + startTime + ", close: " + bar.Close + ", Volume: " +bar.Volume);
}
}
}
}