Skip to content

Commit

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

const isBullishHammerPattern = async (input) => {
try {
const last = input.open.length - 1
const last = input.open.length - 2 // confirmed candle : last - 2
if (last < 4) {
console.error(`Require OHLCV of last 5 candles`)
return false
Expand All @@ -26,7 +26,7 @@ const isBullishHammerPattern = async (input) => {

const isBearishHammerPattern = async (input) => {
try {
const last = input.open.length - 1
const last = input.open.length - 2 // confirmed candle : last - 2
if (last < 4) {
console.error(`Require OHLCV of last 5 candles`)
return false
Expand All @@ -50,7 +50,7 @@ const isBearishHammerPattern = async (input) => {

const isBullishInvertedHammerPattern = async (input) => {
try {
const last = input.open.length - 1
const last = input.open.length - 2 // confirmed candle : last - 2
if (last < 4) {
console.error(`Require OHLCV of last 5 candles`)
return false
Expand All @@ -74,7 +74,7 @@ const isBullishInvertedHammerPattern = async (input) => {

const isBearishInvertedHammerPattern = async (input) => {
try {
const last = input.open.length - 1
const last = input.open.length - 2 // confirmed candle : last - 2
if (last < 4) {
console.error(`Require OHLCV of last 5 candles`)
return false
Expand Down

0 comments on commit 1cb17fa

Please sign in to comment.