interesting that the moving average with period 1 doesn't equal the base value...?
additionally, why doesn't the moving average show up for the first month of backtesting in my SMAs plot?
QUANTCONNECT COMMUNITY
interesting that the moving average with period 1 doesn't equal the base value...?
additionally, why doesn't the moving average show up for the first month of backtesting in my SMAs plot?
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.
NathanGeorge
Jared Broad
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.
NathanGeorge
Jared Broad
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.
Michael Handschuh
_smaLow = SMA(_symbol, 1, Resolution.Daily); _smaHigh = SMA(_symbol, 1, Resolution.Daily);
The helper indicator functions (such as SMA, EMA, BB, ect...) perform the registration for you, so there's no need to call the RegisterIndicator function with them. If you do register an indicator that has already been registered then it will receive multiple updates, producing incorrect values. Additionally, the default value that gets sent into your indicator will be the Value property. If you'd like a different value to be sent into your indicator, currently you'll need to manually create the indicator using the 'new' keyword and then register the indicator.var _smaLow = new SimpleMovingAverage(1); var _smaHigh = new SimpleMovingAverage(1); RegisterIndicator(symbol, _smaLow, ResolveConsolidator(symbol, Resolution.Daily), x => ((TradeBar)x).Low); RegisterIndicator(symbol, _smaHigh, ResolveConsolidator(symbol, Resolution.Daily), x => ((TradeBar)x).High);
Tomorrow I'll work on adding an overload to each of the indicator helper functions that accepts the 'selector' function so you could simply write:_smaLow = SMA(symbol, Resolution.Daily, x => ((TradeBar)x).Low);
NathanGeorge
Michael Handschuh
x => x.Property
This can be read as 'x becomes x dot property' and defines a function of a single parameter, x, that returns x.Property. They're super handy at allowing calling code to specify intricate behavior without the need for additional classes/interfaces. I often think of it as an interface of a singular method.Michael Handschuh
NathanGeorge
NathanGeorge
NathanGeorge
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!