Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ADX Momentum Indicator logic appears to be backwards. #94

Closed
CodaCarlson opened this issue Aug 20, 2020 · 1 comment
Closed

ADX Momentum Indicator logic appears to be backwards. #94

CodaCarlson opened this issue Aug 20, 2020 · 1 comment

Comments

@CodaCarlson
Copy link

After looking at the ADXMomentum indicator, the logic appears to be slightly backwards from the quoted source. Below is what i believe it is supposed to look like but please double check.

    def populate_buy_trend(self, dataframe: DataFrame, metadata: dict) -> DataFrame:
        dataframe.loc[
            (
                    (dataframe['adx'] > 25) &
                    (dataframe['mom'] > 0) &
                    (dataframe['plus_di'] > 25) &
                    (dataframe['plus_di'] > dataframe['minus_di'])

            ),
            'buy'] = 1
        return dataframe

    def populate_sell_trend(self, dataframe: DataFrame, metadata: dict) -> DataFrame:
        dataframe.loc[
            (
                    (dataframe['adx'] > 25) &
                    (dataframe['mom'] < 0) &
                    (dataframe['minus_di'] > 25) &
                    (dataframe['plus_di'] < dataframe['minus_di'])

            ),
            'sell'] = 1
        return dataframe

Thanks for all the strategies. Keep up the good work.

@xmatthias
Copy link
Member

Yes, that seems correct to me.

I've fixed this now. Thanks for noticing!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants