anandanand84 / technicalindicators

A javascript technical indicators written in typescript with pattern recognition right in the browser
MIT License
2.18k stars 563 forks source link

Missing in pattern BearishHarami and BullishHarami #115

Closed tuanna45 closed 6 years ago

tuanna45 commented 6 years ago

I've read the code of two patterns and I see you have a missing between them. The coding of BearishHarami belonged to Bullish Harami pattern and vice verse. The same for BullishHaramiCross and BearishHaramiCross,... Do we need to reverse our input before passing them into these patterns or another thing? Please help me to verify again. Thanks.

image

anandanand84 commented 6 years ago

Can you run npm run test. It will create test images for each candlestick pattern, let me know if it is what you are expecting.

image

A google image search shows conflicting patterns

image

I am open for changes if we reach consensus. I would really appreciate if you can do a pull request

JMoli commented 6 years ago

@anandanand84 I do not see any conflicting images?

tuanna45 commented 6 years ago

Sorry for my late, I find the best definition of these patterns. As you can see below and pay attention to strong text:

What is a 'Bullish Harami'

A bullish harami is a candlestick chart pattern in which a large candlestick is followed by a smaller candlestick whose body is located within the vertical range of the larger body. The bullish harami is a downtrend or bearish candlestick (red) engulfing a small bullish candlestick (green), giving a sign of a reversal of the downward trend. Since the bullish harami indicates the bearish trend may be reversing, it may be a good time to enter into a long position.

image

=> So I think we should swap code between "BearishHarami and BearishHaramiCross" and "BullishHaramiCross and BearishHaramiCross". Because we don't change any business of these patterns so you can help me do that.

Reference document: 1) Bullish Harami: https://www.investopedia.com/terms/b/bullishharami.asp 2) Harami Cross: https://www.investopedia.com/terms/h/haramicross.asp

anandanand84 commented 6 years ago

@JMoli can you add the cross as well in the pull request, I'll merge it together