Back

CandlestickPatterns not available in Python ?

Hi there,

I'm trying to add some candlestick pattern indicators to my algo in python.

I did it the same as in the doc but the pattern method doesn't even exist on the CandlesticksPatterns class, is that normal ?

During the algorithm initialization, the following exception has occurred: Trying to dynamically access a method that does not exist throws a TypeError exception. To prevent the exception, ensure each parameter type matches those required by the Doji method. Please checkout the API documentation.
at Initialize in main.py:line 54
:: doji = CandlestickPatterns.Doji(self.pairSymbol)
TypeError : No method matches given arguments for Doji

self.pairSymbol comes from:

self.pairSymbol = self.AddForex("EURUSD", Resolution.Hour)

What am I missing here ? It does the same for all other CandlestickPatterns by the way.

Thanks in advance

 

Update Backtest







0

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.


Hi - AddForex returns a Security object. To access the Symbol of the Security, please use self.pairSymbol.Symbol.

I would recommend renaming pairSymbol to pairSecurity (for readability) or define it as follows:

self.pairSymbol = self.AddForex("EURUSD", Resolution.Hour).Symbol

 

1

Update Backtest





0

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.


Loading...

This discussion is closed