Open whatismyname21 opened 2 years ago
Hello @whatismyname21,
I can not help you as you have not completed the above form nor have you provided enough evidence (context, data, reproducible code, screenshots) to convince us that this is anything but a baseless claim.
Clearly not a lot of the same number printing many times:
Kind Regards, KJ
Hi Kevin
I have used below code
HILO = ta.hilo(df["High"],df["Low"],df["Close"], high_length=2, low_length=4)
Price is moving but i am getting same result many time. Please find attached screenshot.
Thanks Aj
@whatismyname21,
Again:
Thanks for providing the indicator and parameters that are not working.
KJ
Hi Kevin
Please answer in line...
@whatismyname21
Thanks, we are getting there... What ticker/symbol?
There is no such Pandas TA version: 1.3.4
import pandas_ta as ta
print(ta.version)
Sorry to bug you, but my main strategy is on Gann HiLo
Version - 0.3.14b0 Ticker name - AAPL Today's data
@whatismyname21
Your small ma lengths can cause the conditional logic to repeat values until the close price either exceeds the previous high/low sma values.
You should add the sma's and compare for yourself that the logic is working as implemented.
df = # your ohlcv data
df.ta.sma(2, append=True)
df.ta.sma(4, append=True)
df.ta.hilo(high_length=2, low_length=4, append=True)
print(df)
HILO core logic:
def hilo(high, low, close, high_length=None, low_length=None, mamode=None, offset=None, **kwargs):
"""Indicator: Gann HiLo (HiLo)"""
# Validate Arguments
# ...
high_ma = ma(mamode, high, length=high_length)
low_ma = ma(mamode, low, length=low_length)
for i in range(1, m):
if close.iloc[i] > high_ma.iloc[i - 1]:
hilo.iloc[i] = long.iloc[i] = low_ma.iloc[i]
elif close.iloc[i] < low_ma.iloc[i - 1]:
hilo.iloc[i] = short.iloc[i] = high_ma.iloc[i]
else:
hilo.iloc[i] = hilo.iloc[i - 1]
long.iloc[i] = short.iloc[i] = hilo.iloc[i - 1]
# ...
Yahoo Finance: AAPL (1min) - HILO(2,4) + SMA(2) + SMA(4) yf-aapl-1m-hilo_2_4.csv
@whatismyname21,
Lately, I have been speeding up indicators on the development branch. When I get to this one, I'll double check it.
Which version are you running? The lastest version is on Github. Pip is for major releases.
Do you have TA Lib also installed in your environment?
Did you upgrade? Did the upgrade resolve the issue?
Describe the bug A clear and concise description of what the bug is.
To Reproduce Provide sample code.
Expected behavior A clear and concise description of what you expected to happen.
Screenshots If applicable, add screenshots to help explain your problem.
Additional context Add any other context about the problem here.
Thanks for using Pandas TA!