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

Most alphas are incorrectly implemented in 101Alpha_code_2 #2

Open
quantverse opened this issue Oct 6, 2021 · 1 comment
Open

Most alphas are incorrectly implemented in 101Alpha_code_2 #2

quantverse opened this issue Oct 6, 2021 · 1 comment

Comments

@quantverse
Copy link

Please note that most of the generated code in 101Alpha_code_2 is completely incorrect. This is especially visible on the delay implementation - all wrong. But not only limited to. For instance take a look on the alpha22 implementation. It will always return zeros. The corrected and optimized alpha22 code could look like this one:

#  (-1 * (delta(correlation(high, volume, 5), 5) * rank(stddev(close, 20))))
class Alpha22:
    # inputs = [USEquityPricing.high, USEquityPricing.volume, USEquityPricing.close]
    window_length = 20
    def compute(self, today, assets, out, high, volume, close):
        ds = pd.DataFrame(high[-10:]).rolling(window=5).corr(pd.DataFrame(volume[-10:])).values
        v10 = ds[-1] - ds[-6]
        v110 = np.std(close[-20:], axis=0)
        v11 = stats.rankdata(v110)
        v1 = v10 * v11
        out[:] = -1. * v1
@braveryCHR
Copy link

The implementation of both files has many problems and needs to be proofread

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

No branches or pull requests

2 participants