-
Notifications
You must be signed in to change notification settings - Fork 221
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
Chaikin Money Flow indicator: NaN when positive #144
Comments
CMF is a oscillator, so it is supposed to move to positive and negative. Also, as almost every indicator, it has a startup period, where values will be NAN. Testing this on a random dataframe, it does return both <0 and > 0. What precise version are you using? and what parameters are you calling cmf with? |
I'm using version 1.21 and I'm calling: cmf(dataframe, 20), so 20 periods.
Below is a dataset for ETH/BTC with 5 min candles. According to tradingview
the CMF on 23:55 should be 0.06, the function says -0.470299. At 0:00 it
should be -0.05, the function reports -0.524170.
I'm not ruling out that I'm missing something but I can't figure out what.
date open high
low close volume cmf
269 2020-12-30 19:55:00+00:00 0.026146 0.026180 0.026111 0.026178
4394.747 -0.376058
270 2020-12-30 20:00:00+00:00 0.026165 0.026197 0.026068 0.026100
2765.282 -0.411997
271 2020-12-30 20:05:00+00:00 0.026100 0.026145 0.026090 0.026138
1756.803 -0.390863
272 2020-12-30 20:10:00+00:00 0.026134 0.026144 0.026106 0.026124
756.670 -0.385205
273 2020-12-30 20:15:00+00:00 0.026116 0.026166 0.026103 0.026135
784.604 -0.383641
274 2020-12-30 20:20:00+00:00 0.026135 0.026154 0.026113 0.026140
582.773 -0.362034
275 2020-12-30 20:25:00+00:00 0.026141 0.026150 0.026083 0.026096
701.193 -0.368587
276 2020-12-30 20:30:00+00:00 0.026094 0.026113 0.026042 0.026046
624.730 -0.382809
277 2020-12-30 20:35:00+00:00 0.026047 0.026053 0.025905 0.025968
2579.020 -0.410907
278 2020-12-30 20:40:00+00:00 0.025969 0.026048 0.025964 0.026033
1114.515 -0.370010
279 2020-12-30 20:45:00+00:00 0.026030 0.026071 0.026014 0.026040
826.861 -0.387976
280 2020-12-30 20:50:00+00:00 0.026046 0.026091 0.026020 0.026076
1066.134 -0.434876
281 2020-12-30 20:55:00+00:00 0.026064 0.026139 0.026047 0.026106
1695.059 -0.427412
282 2020-12-30 21:00:00+00:00 0.026117 0.026245 0.026115 0.026219
1584.855 -0.391172
283 2020-12-30 21:05:00+00:00 0.026214 0.026225 0.026167 0.026197
741.950 -0.407562
284 2020-12-30 21:10:00+00:00 0.026198 0.026214 0.026162 0.026189
1095.265 -0.401517
285 2020-12-30 21:15:00+00:00 0.026190 0.026221 0.026164 0.026169
1136.397 -0.426442
286 2020-12-30 21:20:00+00:00 0.026169 0.026185 0.026087 0.026100
1135.345 -0.434778
287 2020-12-30 21:25:00+00:00 0.026103 0.026162 0.026088 0.026099
733.538 -0.446412
288 2020-12-30 21:30:00+00:00 0.026105 0.026108 0.026027 0.026030
774.119 -0.451525
289 2020-12-30 21:35:00+00:00 0.026029 0.026051 0.026001 0.026018
533.381 -0.537151
290 2020-12-30 21:40:00+00:00 0.026018 0.026018 0.025926 0.025926
2020.862 -0.552504
291 2020-12-30 21:45:00+00:00 0.025926 0.025966 0.025916 0.025916
688.260 -0.602331
292 2020-12-30 21:50:00+00:00 0.025920 0.026037 0.025831 0.025881
1747.952 -0.617141
293 2020-12-30 21:55:00+00:00 0.025881 0.025925 0.025865 0.025894
777.365 -0.618045
294 2020-12-30 22:00:00+00:00 0.025892 0.025914 0.025886 0.025896
244.758 -0.625711
295 2020-12-30 22:05:00+00:00 0.025896 0.025909 0.025839 0.025899
1080.082 -0.596523
296 2020-12-30 22:10:00+00:00 0.025900 0.025964 0.025883 0.025942
353.650 -0.581393
297 2020-12-30 22:15:00+00:00 0.025955 0.026008 0.025949 0.026004
437.009 -0.570979
298 2020-12-30 22:20:00+00:00 0.026004 0.026024 0.025951 0.025962
332.510 -0.598864
299 2020-12-30 22:25:00+00:00 0.025958 0.025973 0.025896 0.025896
470.276 -0.611419
300 2020-12-30 22:30:00+00:00 0.025895 0.026003 0.025881 0.025994
1269.457 -0.597840
301 2020-12-30 22:35:00+00:00 0.025994 0.025999 0.025941 0.025944
420.917 -0.629298
302 2020-12-30 22:40:00+00:00 0.025943 0.025976 0.025901 0.025961
495.324 -0.657674
303 2020-12-30 22:45:00+00:00 0.025961 0.026012 0.025957 0.025996
570.047 -0.652814
304 2020-12-30 22:50:00+00:00 0.025996 0.026025 0.025980 0.025980
396.648 -0.673699
305 2020-12-30 22:55:00+00:00 0.025980 0.026003 0.025920 0.025952
561.041 -0.653465
306 2020-12-30 23:00:00+00:00 0.025945 0.025999 0.025943 0.025949
650.017 -0.647474
307 2020-12-30 23:05:00+00:00 0.025947 0.026008 0.025947 0.025980
755.003 -0.627455
308 2020-12-30 23:10:00+00:00 0.025982 0.026048 0.025979 0.026035
764.204 -0.586594
309 2020-12-30 23:15:00+00:00 0.026040 0.026045 0.025992 0.026030
607.163 -0.571331
310 2020-12-30 23:20:00+00:00 0.026030 0.026037 0.025966 0.025991
971.223 -0.513069
311 2020-12-30 23:25:00+00:00 0.025996 0.026016 0.025984 0.025996
427.070 -0.491516
312 2020-12-30 23:30:00+00:00 0.025996 0.026028 0.025986 0.025993
691.709 -0.472941
313 2020-12-30 23:35:00+00:00 0.025989 0.026003 0.025938 0.025983
598.950 -0.461949
314 2020-12-30 23:40:00+00:00 0.025990 0.026070 0.025981 0.026058
1509.201 -0.421678
315 2020-12-30 23:45:00+00:00 0.026054 0.026147 0.026054 0.026113
1821.780 -0.435783
316 2020-12-30 23:50:00+00:00 0.026115 0.026143 0.026092 0.026127
668.995 -0.434147
317 2020-12-30 23:55:00+00:00 0.026131 0.026136 0.026030 0.026046
911.799 -0.470299
318 2020-12-31 00:00:00+00:00 0.026045 0.026093 0.025913 0.025922
2138.084 -0.524170
…On Fri, Jan 15, 2021 at 7:31 AM Matthias ***@***.***> wrote:
CMF is a oscillator, so it is supposed to move to positive and negative.
Also, as almost every indicator, it has a startup period, where values
will be NAN.
Testing this on a random dataframe, it does return both <0 and > 0.
What precise version are you using? and what parameters are you calling
cmf with?
[image: 2021-01-15-072947_799x618_scrot]
<https://user-images.githubusercontent.com/5024695/104689834-8e5e5f80-5703-11eb-96a8-10c05744ad55.png>
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
<#144 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/ADB3GJXPSNVUYVQR6CYSVSDSZ7OMXANCNFSM4WC47VUQ>
.
|
Technical is following the definition chaikin_money-flow1 money_flow_2 - investopedia as far as i can see (feel free to correct me if you think differently based on the code below). technical/technical/indicators/volume_indicators.py Lines 25 to 32 in 3323c1a
If tradingview calculates differently, then there is nothing we can do to align, really, as their code is closed-source as far as i know, so eventual mistakes in their formulas are hidden from analysis. |
You can see the logic for a Tradingview indicator by clicking on the {} button of the indicator, this is just next to the indicator settings. CMF in Tradingview:
This part |
The CMF only seems to return a negative number or NaN.
The text was updated successfully, but these errors were encountered: