Overall Statistics |
Total Trades 1 Average Win 0% Average Loss 0% Compounding Annual Return 0.362% Drawdown 0.900% Expectancy 0 Net Profit 0.363% Sharpe Ratio 0.274 Probabilistic Sharpe Ratio 21.822% Loss Rate 0% Win Rate 0% Profit-Loss Ratio 0 Alpha -0.002 Beta 0.117 Annual Standard Deviation 0.012 Annual Variance 0 Information Ratio -0.499 Tracking Error 0.085 Treynor Ratio 0.028 Total Fees $0.00 Estimated Strategy Capacity $0 |
class VentralCalibratedRadiator(QCAlgorithm): def Initialize(self): self.SetCash(100000) self.SetStartDate(2005, 1, 1) # Set Start Date self.SetEndDate(2006, 1, 1) # End Date CFD = self.AddCfd("SPX500USD", Resolution.Hour, Market.Oanda) self.SPX = CFD.Symbol # Define the symbol from which you use for indicator calculation self.slow = self.EMA(self.SPX, 300, Resolution.Hour) self.fast = self.EMA(self.SPX, 100, Resolution.Hour) overlayPlot = Chart("Price Chart") Indicators = Chart("Indicators") overlayPlot.AddSeries(Series("SPX500USD", SeriesType.Candle, 0)) # This is for formatting the graph overlayPlot.AddSeries(Series("Buy", SeriesType.Scatter, 0)) self.AddChart(overlayPlot) # Adds the chart to the dashboard self.AddChart(Indicators) # pass def OnData(self, data): '''OnData event is the primary entry point for your algorithm. Each new data point will be pumped in here. Arguments: data: Slice object keyed by symbol containing the stock data ''' self.Plot("Price Chart", "SPX500USD", data["SPX500USD"].Value) # Define where you get your values to plot self.Plot("Indicators","Slow", self.slow.Current.Value) self.Plot("Indicators", "Fast", self.fast.Current.Value) # Condition for long, just a place holder if self.slow.Current.Value < self.fast.Current.Value and not self.Portfolio.Invested: self.MarketOrder("SPX500USD", 10) BuyOrder = data["SPX500USD"].Value # sets the value of the entry to current price of the index self.Plot("Price Chart", "Buy", BuyOrder) # Draws the entry on the price chart