-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
Ichess Strategy added #231
Conversation
user_data/strategies/Ichess.py
Outdated
df['kumoBreakoutScore'] + | ||
df['senkouCrossScore'] + | ||
df['chikouCrossScore'] | ||
).cumsum() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this will not work identically during backtesting and live runs.
backtesting has all data available - so you'll calculate this on a range of potentially 100ds of days (the end value can be pretty high).
You should instead use .rolling().cumsum()
(didn't check for other such problems in this strategy ...).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
thanks but I got two errors:
TypeError: rolling() missing 1 required positional argument: 'window'
which window is best default for rolling?
after add a number .rolling(9).cumsum()
AttributeError: 'Rolling' object has no attribute 'cumsum'
Whats the best change for fix?
user_data/strategies/Ichess.py
Outdated
else: | ||
return 0 | ||
|
||
df['tkCrossScore'] = df.apply(calcTkCross, axis=1) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is a very slow way of doing things.
i don't see any reason not to do this in a vectorized manner - which will be a lot quicker.
It may seem like a more complicated approach (which it might be if you're not used to thinking that way) - but the performance you'll gain from that will be substancial - especially for backtesting/hyperopt.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
oh than what can we do?!! you said befour i can use dt.hour! can I use some thing like dt.hour instade of that, here?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
please do your own research - pandas is a wide enough topic so you can find probably 100ds of resources there - i'd suggest to properly learn pandas first.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
np.vectorize
is NOT what i meant, and will have no performance benefit over using apply()
. it's the equivalent to pd.apply
- which both execute the function n times (n = number of rows).
A vectorized approach is for example the following: dataframe['whatever'] = dataframe['low'] / dataframe['high']
- which is operating on series, not on single values.
Okay thanks👌👌👌 I think I will work more on it than ;) |
I reached good things about this strategy! |
I see no updates to this PR that address the review so would recommend this is closed and reopened if any further work has been done. |
Ichess Strategy ichimoku_score
Associate various ichimoku signals with a score.
For example, bullish signal => positive score,
and bearish signal => negative score. If the total score is above 0, it may indicate a bullish trend .
Otherwise, if it is below 0, it may indicate a bearish trend .
We used two smoothed moving averages to find the trend.
More info:
#97
https://www.tradingview.com/script/P1bybHZA-Ichimoku-Cloud-Signal-Score-v2-0-0/
Author: @mablue (Masoud Azizi)
github: https://github.com/mablue/