Hi there,
I wanted to convert some python code I had to quantconnect style of code.
Currently I do the following
# period
n1 = 8
# get the hlc3 price for average
ap = hlc3
# get the ema based on the hlc3
esa = ema(ap, n1)
# generate ema based on the absolute value of the average price - the ema on period n1
d = ema(abs(ap - esa), n1)
# return some calculated value with some tolerance
ci = (ap - esa) / (0.015 * d)
# generate ema based on above
tci = ema(ci, n2)
wt1 = tci
# generate sma from tci
wt2 = sma(wt1,4)
Would you recommend just getting data history and constructing it myself using python libraries?
Derek Melchin
Hi Rajats179,
Instead of using just IndicatorExtensions, we recommend placing the indicator logic above inside a custom python indicator. We have the ExponentialMovingAverage and SimpleMovingAverage indicators built-in. `hlc3` is the only internal indicator that would need to be implemented.
Best,
Derek Melchin
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.
Vladimir
Rajats179,
Is hlc3 what is commonly referred to in technical analysis as
Typical Price = (H + L + C) / 3 ?
What is n2 value?
Rajats179
Derek Melchin thats fine I can revert to using close instead of hlc3.
how would I do multiple indicator chaining like this:
Derek Melchin
Hi Rajats179,
The attached backtest demonstrates how we can place the logic inside a custom python indicator. To ensure the indicator `IsReady` immediately, a manual warm-up has been included.
Best,
Derek Melchin
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.
Rajats179
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!