Skip to content
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

Closed
wants to merge 2 commits into from
Closed

Ichess Strategy added #231

wants to merge 2 commits into from

Conversation

mablue
Copy link
Contributor

@mablue mablue commented Nov 5, 2021

forex-comparic-photo-392-of-564
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/

df['kumoBreakoutScore'] +
df['senkouCrossScore'] +
df['chikouCrossScore']
).cumsum()
Copy link
Member

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 ...).

Copy link
Contributor Author

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?

else:
return 0

df['tkCrossScore'] = df.apply(calcTkCross, axis=1)
Copy link
Member

@xmatthias xmatthias Nov 6, 2021

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.

Copy link
Contributor Author

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?

Copy link
Member

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.

Copy link
Member

@xmatthias xmatthias left a 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.

@mablue
Copy link
Contributor Author

mablue commented Nov 24, 2021

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 ;)

@mablue
Copy link
Contributor Author

mablue commented May 10, 2022

I reached good things about this strategy!
Now this strategy splited to two versions and I just want to keep one of them! The one that is insane! But the normal one is good and simple!-_-

@froggleston
Copy link
Contributor

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.

@xmatthias xmatthias closed this Dec 31, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants