const hammer = require('technicalindicators').hammerpatternunconfirmed;
var hammerData = [
{
name: 'Bearish',
data: {
open: [44.00, 40.90, 36.00, 33.10, 30.10],
high: [45.00, 41.80, 37.60, 35.90, 30.10],
close: [42.00, 36.00, 33.10, 29.50, 26.13],
low: [38.00, 28.00, 27.70, 26.90, 10.06],
},
},
{
name: 'Bearish Inverted',
data: {
open: [44.00, 40.90, 36.00, 33.10, 29.10],
high: [45.00, 41.80, 37.60, 35.90, 36.10],
close: [42.00, 36.00, 33.10, 29.50, 26.13],
low: [38.00, 28.00, 27.70, 26.90, 26.13],
},
},
{
name: 'Bullish',
data: {
open: [44.00, 40.90, 36.00, 33.10, 26.13],
high: [45.00, 41.80, 37.60, 35.90, 30.10],
close: [42.00, 36.00, 33.10, 29.50, 30.10],
low: [38.00, 28.00, 27.70, 26.90, 10.06],
},
},
{
name: 'Bullish Inverted',
data: {
open: [44.00, 40.90, 36.00, 33.10, 26.13],
high: [45.00, 41.80, 37.60, 35.90, 36.10],
close: [42.00, 36.00, 33.10, 29.50, 29.10],
low: [38.00, 28.00, 27.70, 26.90, 26.13],
},
},
];
hammerData.forEach((patternSet) => {
const result = hammer(patternSet.data) ? 'yes' : 'no';
console.log(`Is Hammer Pattern (Unconfirmed): ${patternSet.name}? : ${result}`);
});