Comments (8)
Hmmm, Do not use candlestick patterns yet, it is not complete, I'll add example in runkit once it is done, This is very basic there will be a lot of changes when we add more candlestick so the api may break.
from technicalindicators.
I think you are using the old version, has pattern should work in latest version, all tests are passing. It should fail only in getAllPatternIndex.
from technicalindicators.
I don't sure whether old version is used, but variable strategy
cannot be found.
Even the pattern check haven't been fully implemented, I really can't wait for this interesting feature. Please let me put some comments here:
If array cannot fulfill requiredCount
, exception should not be thrown. It is because logically it should be grouped into "pattern not found".
It is no doubt that your approach is right, just because I have written code as follow as a trial run::
var input = {
date: [..., ..., ..., ...],
open: [..., ..., ..., ...],
close: [..., ..., ..., ...],
high: [..., ..., ..., ...],
low: [..., ..., ..., ...]
}
for(i =0 ... length) {
let candlePattern;
if(TI.AbandonedBaby.hasPattern(input)) candlePattern = ", AbandonedBaby";
else if(TI.BearishEngulfingPattern.hasPattern(input)) candlePattern = ", BearishEngulfingPattern";
else if(TI.BullishEngulfingPattern.hasPattern(input)) candlePattern = ", BullishEngulfingPattern";
else if(TI.DarkCloudCover.hasPattern(input)) candlePattern = ", DarkCloudCover";
else if(TI.Doji.hasPattern(input)) candlePattern = ", Doji";
else if(TI.DownsideTasukiGap.hasPattern(input)) candlePattern = ", DownsideTasukiGap";
else if(TI.DragonFlyDoji.hasPattern(input)) candlePattern = ", DragonFlyDoji";
...
//output when pattern is found
...
input.date.shift();
input.open.shift();
input.close.shift();
input.high.shift();
input.low.shift();
}
As candle patterns have no fixed requiredCount
, it seems that the simple way to achieve what I want is to catch the exceptions.
Anyway, that is just my thought. Thanks for your great code.
from technicalindicators.
This is fixed on 0.2.9.
from technicalindicators.
Sorry may I know where is strategy
defined? I saw it be used in CandlestickFinder.js
but I am not able to find where it is declared. Thanks
from technicalindicators.
CandlestickFinder is the parent class for all candlestick patterns, every candlestick pattern has a method logic, which is the strategyFn that is used. You can see this
and
from technicalindicators.
Please try to change the input as follows in the sample to:
var twoDayBearishInput = {
open: [21.44],
high: [25.10],
close: [23.25],
low: [20.82]
}
Then you will get what I mean.
Thanks!
from technicalindicators.
Good catch!! It was due to dangerous copy paste. I have fixed it and added a test for it. Thanks. It should be available in version 0.2.10
from technicalindicators.
Related Issues (20)
- Example Playground Not Found Dep
- SMA returns NaN HOT 1
- is ADX correct (difference with TradingView) HOT 2
- Is there a better and maintained lib? HOT 2
- diffrence with tradingview and this RSI calculation HOT 5
- Looks like most of indicator calculation is wrong. HOT 8
- Bullish Hammer calculation is incorrect HOT 4
- Deno Support
- Error in mfi calculating
- Unequal ROC indicator output in compare to Binance real time data HOT 1
- Is not working with candles of 4H the SMA
- [TIP] for people getting wrong values
- Request for adding Hull Moving Average (HMA) HOT 2
- Moving Average functions but float period
- Ichimoku indicator error HOT 2
- sma always returns null HOT 1
- how to use predictPattern function
- This library is a memory leak HOT 6
- [feature] new indicator : SAR HOT 2
- Is this library still supported? HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from technicalindicators.