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

Question about data and TCO algorithm #109

Open
Yccc0903 opened this issue Feb 29, 2024 · 0 comments
Open

Question about data and TCO algorithm #109

Yccc0903 opened this issue Feb 29, 2024 · 0 comments

Comments

@Yccc0903
Copy link

Sorry, I'm poor in coding, and have some question.

  1. What is the type of data (nyse_o, sp500, and so on.)? It dosen't looks like "raw stock price" or "price relatives".
  2. About TCO1 algorithm, I want to know what are "p" and "history"?
  3. And why it is "history.iloc[-2] / p" in reversal type?
    I study the paper, they use "1/xt" to predict next price relatives in TCO1.

Thanks for your help!

[TCO.py]

class TCO1(TCO):
def init(self, type="reversal", **kwargs):
self.type = type
super().init(min_history=1, **kwargs)

def predict(self, p, history):
    if self.type == "reversal":
        return history.iloc[-2] / p
    elif self.type == "trend":
        return p / history.iloc[-2]
    else:
        raise NotImplementedError()
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

1 participant