So I cloned the "RSI with Martingale Position Sizing" algorithm from the university, stripped out all of the martingale logic to test a custom indicator. I was attempting to modify the custom RSI indicator and add a SMA crossover signal to it. Unfortunately I'm not well versed in C#
Does Anyone have any idea why I keep getting this error when I try and run a backtest? Here is the Stacktrace:
at System.Decimal.op_Addition (Decimal d1, Decimal d2) [0x00000] in :0
at QuantConnect.RelativeStrengthIndexCustom.UpdateDirectionalSMA (QuantConnect.FixedSizedQueue`1& queue, System.Decimal& sum, Decimal sample) [0x00000] in :0
at QuantConnect.RelativeStrengthIndexCustom.AddSample (QuantConnect.Data.Market.TradeBar bar) [0x00000] in :0
at QuantConnect.Constitution.OnData (QuantConnect.Data.Market.TradeBars data) [0x00000] in :0
at (wrapper remoting-invoke-with-check) QuantConnect.Constitution:OnData (QuantConnect.Data.Market.TradeBars)
at (wrapper dynamic-method) QuantConnect.Constitution:invoke (object,object[])
at QuantConnect.Lean.Engine.AlgorithmManager.Run (QuantConnect.Packets.AlgorithmNodePacket job, IAlgorithm algorithm, IDataFeed feed, ITransactionHandler transactions, IResultHandler results, IRealTimeHandler realtime, ICommandQueueHandler commands, CancellationToken token) [0x00000] in Lean.Engine.AlgorithmManager.Run (QuantConnect.Packets.AlgorithmNodePacket job, IAlgorithm algorithm, IDataFeed feed, ITransactionHandler transactions, IResultHandler results, IRealTimeHandler realtime, ICommandQueueHandler commands, CancellationToken token) [0x00000] in :0
LukeI
Michael Handschuh
LukeI
Michael Handschuh
var rsi = RSI("SPY", 14); var smaOfRsi = new SimpleMovingAverage(10).Of(rsi);
The 'Of' method here wires up the indicators such that the output from the 'rsi' is pumped into the SimpleMovingAverage, the result being an SMA of RSI :)LukeI
LukeI
The material on this website is provided for informational purposes only and does not constitute an offer to sell, a solicitation to buy, or a recommendation or endorsement for any security or strategy, nor does it constitute an offer to provide investment advisory services by QuantConnect. In addition, the material offers no opinion with respect to the suitability of any security or specific investment. QuantConnect makes no guarantees as to the accuracy or completeness of the views expressed in the website. The views are subject to change, and may have become unreliable for various reasons, including changes in market conditions or economic circumstances. All investments involve risk, including loss of principal. You should consult with an investment professional before making any investment decisions.
To unlock posting to the community forums please complete at least 30% of Boot Camp.
You can continue your Boot Camp training progress from the terminal. We hope to see you in the community soon!