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

Bullish / Bearish Harami always triggers with Bullish / Bearish Harami Cross #119

Open JMoli opened 6 years ago

JMoli commented 6 years ago

Something I noticed fixing #115 . If Bullish / Bearish Harami Cross is true so will Bullish / Bearish Harami .. not sure if this is desirable?

anandanand84 commented 6 years ago

@JMoli Do you mean it is a bug or by the definition both will trigger at the same time?

JMoli commented 6 years ago

@anandanand84 By definition both will trigger at the same time... but still most likely a bug.. Just need to add

let isSecondDayDoji = this.approximateEqual(seconddaysOpen, seconddaysClose); return (isBullishHaramiPattern && !isSecondDayDoji);

The key being to negate isSecondDayDoji . I think it is a bug because techinically the candle is one or the other not both a HaramiCross and a Harami, but this may be subjective thinking? Let me know what you think.

anandanand84 commented 6 years ago

@JMoli I do not use Candlestick Harami, now you are in a much better position to take that call, whatever you think should do, just add it to the existing pull request and I'll merge.

Thank you for contributing.

anandanand84 commented 6 years ago

Actually I think we have this issue for lot of candlesticks which are similar. Have to go through all the candlesticks once again.