anandanand84 / technicalindicators

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

Doji Precision #141

Closed marcus-n3rd closed 6 years ago

marcus-n3rd commented 6 years ago

I recently came across an issue where a dataset that had all four numbers that were close to each other and close to zero. When detections were assessed on the dataset like so:

const dayInput = {
  open: [ 0.11 ],
  close: [ 0.10 ],
  high: [ 0.11 ],
  low: [ 0.10],
}

const doji = ti.doji(dayInput)
const dfly_doji = ti.dragonflydoji(dayInput)
const grave_doji = ti.gravestonedoji(dayInput)

...all three results would return true. So, I adjusted the three doji logics to be a little more precise about each structure. Now, only the doji variable will be true and the other two will be false. I ran tests and added new ones for this issue.

anandanand84 commented 6 years ago

Hi Marcus

Thanks for contributing, the changes have to done on the src folder, any changes to lib will be overwritten from the src during the build process. I will merge it if you can make the changes in the src folder. Sorry I should have put this in the readme or remove the lib folder in the github.

Thanks

anandanand84 commented 6 years ago

Never mind I'll make the changes in the src