question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Fisher Transform does not produce correct results

See original GitHub issue

Which version are you running? The lastest version is on Github. Pip is for major releases.

import pandas_ta as ta
print(ta.version)

0.3.14b0

Do you have TA Lib also installed in your environment?

$ pip list

TA-Lib   0.4.22

Did you upgrade? Did the upgrade resolve the issue?

$ pip install -U git+https://github.com/twopirllc/pandas-ta

Upgrade did not resolve.

Describe the bug Fisher Transform does not produce correct results for cryptos which have multiple zeros after the decimal point. Some of these are:

['HOTUSDT','SHIBUSDT','XECUSDT','IOTXUSDT','JSTUSDT','WINUSDT','TROYUSDT','SUNUSDT','FUNUSDT','DENTUSDT','AKROUSDT','SPELLUSDT','SCUSDT','MFTUSDT','SKLUSDT','STPTUSDT','CKBUSDT']

To Reproduce

import pandas as pd
import pandas_ta as ta
import yfinance as yf

data = yf.download(tickers='SHIB-USD', start="2022-01-01", end="2022-03-30")
data.tail(5)
Screenshot 2022-04-16 at 20 16 51
data.ta.fisher(append=True)
data.tail(5)
Screenshot 2022-04-16 at 20 17 54

Expected behavior For some cryptocoins listed in Binance, pandas-ta Fisher transform indicator does not produce correct results. The common characteristic of these coins are that they have little multiple zeros after decimal point of their prices. For example, the close price of SHIBUST as of now is : 0.00002548

Thanks.

Issue Analytics

  • State:closed
  • Created a year ago
  • Comments:5 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
twopirllccommented, Apr 17, 2022

@balioglum,

Thank you! That’s much more useful.

Sounds like a potential rounding issue.

Have you tried scaling the price, apply ta, and descale like:

import pandas as pd
import pandas_ta as ta
import yfinance as yf

scale = 1000 # Or whatever works best
_df = yf.download(tickers='SHIB-USD', start="2022-01-01", end="2022-03-30")

df = scale * _df.copy()
df.ta.fisher(append=True)
df /= scale

df.tail(5)

Unfortunately I do not have a time frame to address this, but I’ll take another look at it when I get to converting it to numpy/numba. If you have a solution and would like to contribute, that would be great! 😎

Kind Regards, KJ

0reactions
twopirllccommented, Apr 19, 2022

Hi @balioglum,

Scaling and descaling seems to be working.

Excellent!

… need to scale/descale only high, low and close values only.

True. Also you can consolidate the code a bit:

scale = 10000
ohlc = ['open', 'high', 'low', 'close']

data_df = # ohlcv et al
df = scale * data_df[ohlc].astype(float)
df.ta.fisher(append=True)
df /= scale
# then rejoin the DataFrames data_df, df

Thanks again for your help. I’ve learned the /= operator by the way as a bonus!

You’re welcome! 😎

Read more comments on GitHub >

github_iconTop Results From Across the Web

Fisher Transform Indicator: Definition and How To Use It in ...
The Fisher Transform is a technical indicator that normalizes asset prices to make turning points in price clearer.
Read more >
Why is fisher transformation necessary? - Cross Validated
I read that the correlation coefficients have to be converted by using a fisher-transformation when one wants to test their significance (like ...
Read more >
How to Trade the Fisher Transform Indicator - Warrior Trading
The Fisher Transform Indicator attempts to bring order to chaos by normalizing the distribution of stock prices over various timeframes.
Read more >
How to correctly calculate Fisher Transform indicator
I've started with an example I found on cTrader and matched it against the code found in the TradingView version. The output values...
Read more >
Correlation testing via Fisher transformation
For samples of any given size n it turns out that r is not normally distributed when ρ ≠ 0 (even when the...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found