Skip to content

Commit

Permalink
Update doji.js
Browse files Browse the repository at this point in the history
  • Loading branch information
thanhnguyennguyen authored Jun 28, 2023
1 parent c94ba88 commit 9813efa
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion candlestick-pattern/doji.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,8 @@ const THRESHOLD = parseFloat(2 / 10_000)

const isDojiPattern = async (input) => {
try {
const body = Math.abs(input.close.slice(-1) - input.open.slice(-1))
const last = input.close.length - 1
const body = Math.abs(input.close[last -1] - input.open[last - 1])
if (parseFloat(body / input.close.slice(-1)) < THRESHOLD) {
return true
}
Expand Down

0 comments on commit 9813efa

Please sign in to comment.