const hangingman = require('technicalindicators').hangingman;
var hangingManData = [
{
name: 'Bearish',
data: {
open: [29.50, 33.10, 36.00, 42.80, 40.90],
high: [35.90, 37.60, 41.80, 42.80, 43.10],
close: [33.10, 36.00, 40.90, 40.90, 38.05],
low: [26.90, 27.70, 28.00, 33.10, 37.50],
},
},
{
name: 'Bullish',
data: {
open: [29.50, 33.10, 36.00, 40.90, 40.90],
high: [35.90, 37.60, 41.80, 42.80, 43.10],
close: [33.10, 36.00, 40.90, 42.80, 38.05],
low: [26.90, 27.70, 28.00, 33.10, 37.50],
},
},
];
hangingManData.forEach((patternSet) => {
const result = hangingman(patternSet.data) ? 'yes' : 'no';
console.log(`Is Hanging Man pattern: ${patternSet.name}? : ${result}`);
});