technicalindicators
technicalindicators copied to clipboard
Pattern Detection help please
Hi,
I think I have set up pattern detection properly, I'm not getting any errors, but I am only ever receiving the result of false for isTrendingUp()
or isTrendingDown()
. There is no documentation for this anymore either, could some help me with an example, I have the following :
if (useTrend) {
isTrendingUp({
values: closeInput
}).then(function (response) {
useTrendbullResult = response
console.log('trend up: ' + response)
});
isTrendingDown({
values: closeInput
}).then(function (response) {
useTrendbearResult = response
console.log('trend down: ' + response)
});
}
closeInput
is an array of candle close values 450 long [xxxx,xxxx,xxxx, ... ]
Like I say, no errors, but also not a single trigger in hours of testing and I can't get a test array to trigger a true response either. All the candlestick pattern, and indicators are working perfectly.
Also the same for hasHeadAndShoulders()
, hasInverseHeadAndShoulders()
, hasDoubleTop()
, and hasDoubleBottom()
Many thanks,
Will
You can test it using 1, 2, 3, 5, 8, 8, 10, 12, .. or so for trending up. and the reverse for trending down.
@anandanand84 Thanks for the quick reply. I have done this already, as mentioned, my test array was [1,2,3,4,5,6,7,8,9,10,11,12,13,14,15]
This gave me the console warning of being less than 250, but continued to show "false". but no errors. Thanks!
@anandanand84
FYI:
$ node -v
v10.15.3
I don't know anything about this library, but some about javascript. You are calling async functions but not waiting for them. When you try to console.log(...) the isTrendingDown()/isTrendingUp() functions might not be done. Easiest way for you to see if that is the problem is to actually log inside of the then() function.
isTrendingDown({ values: closeInput }).then(function(response) { console.log(
Trending down -> ${response}) })
Hope it helps