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

The Money Flow Index (MFI) signs should be extracted from Typical Prices #473

Open
ebadran opened this issue May 23, 2024 · 0 comments
Open

Comments

@ebadran
Copy link

ebadran commented May 23, 2024

In the current implementation of the Money Flow Index (MFI), the extractSigns function is applied to the changes in the rawMoneyFlow array.

const rawMoneyFlow = multiply(typprice(highs, lows, closings), volumes);
const signs = extractSigns(changes(1, rawMoneyFlow));
const moneyFlow = multiply(signs, rawMoneyFlow);

As a result, the index rarely reaches the 20 or 80 thresholds typically used to signal overbought or oversold conditions.

In the more widely accepted definition of the MFI, as seen in Wikipedia, TradingView and Investopedia, the positive/negative signs are instead extracted from the Typical Prices.

const typicalPrices = typprice(highs, lows, closings);
const signs = extractSigns(changes(1, typicalPrices));
const rawMoneyFlow = multiply(typicalPrices, volumes);
const moneyFlow = multiply(signs, rawMoneyFlow);

This isn’t necessarily an error, but it might confuse some users.

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

1 participant