tradingview / charting-library-tutorial

This tutorial explains step by step how to connect your data to the Charting Library
MIT License
405 stars 310 forks source link

Money Flow Index (MFI) indicator results are wrong than expected #23

Closed dirname closed 3 years ago

dirname commented 3 years ago

Hello,

I cloned this repository according to the tutorial and tried to run the demo, but after I can see the chart display, I tried to use the MFI indicator, but the result was not what I expected. The value of MFI is fixed at 100. When I check the preview website provided by TradingView, this issue also exists.

Screenshot 2021-04-22 220916

Please help me as much as possible to solve this problem, thanks in advance :smiley:

ezhukovskiy commented 3 years ago

This is a volume based indicator. You don't have volume.

dirname commented 3 years ago

This is a volume based indicator. You don't have volume.

Thanks, I mistakenly provided complete market data for the default chart. Now I added a volume field in getBars, and I got the expected result. In the future, can you also provide the volume in the default chart?

timocov commented 3 years ago

In the future, can you also provide the volume in the default chart?

If you open https://charting-library.tradingview.com/ (not tutorial) you can see the volume there. In the tutorial we rely on the datafeed thus if datafeed doesn't provide volume, we can't generate it ourselves.