Skip to content

is ADX correct? (difference with TradingView) #315

Answered by bennycode
enriquepiatti asked this question in Q&A
Discussion options

You must be logged in to vote

@enriquepiatti, @Fc299684 & @recidive: I have just released trading-signals v3.0.0 with a breaking change for ADX.

The getResult() method of ADX now just returns a single value which is the index itself (adx). If you want to get the +DI and -DI you will have to check the mdi and pdi members on the ADX instance. Make sure you only do this when isStable is true.

I also verified the implementation. By default ADX uses Wilder's Smoothed Moving Average to smoothen the DX values but you can change it if you like by providing another Moving Average class as second parameter to the ADX instantiation, e.g.:

import {ADX, EMA} from 'trading-signals';
const adx = new ADX(5, EMA);

My implementation is…

Replies: 14 comments 2 replies

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
1 reply
@Fc299684
Comment options

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
1 reply
@Fc299684
Comment options

Answer selected by bennycode
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
3 participants
Converted from issue

This discussion was converted from issue #306 on September 03, 2021 18:58.