Code Monkey home page Code Monkey logo

cs's Introduction

Hi there ๐Ÿ‘‹

cs's People

Contributors

dependabot[bot] avatar pre-commit-ci[bot] avatar tschm avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

cs's Issues

data leakage in oscillator?

Hello, the oscillator is as follows.
here, s = diff.std(), this std uses full data series, isn't it a leakage of future data in early days?

compute the oscillator

def osc(prices, fast=32, slow=96, scaling=True):
"""
oscillator

Args:
    prices: a dataframe of prices
    fast: fast moving average factor, e.g. 32
    slow: slow moving average factor, e.g. 96
    scaling: true/false. If true scales with the standard deviation of the signal
    Strictly speacking this step is forward looking.

Returns:
    oscillator
"""
diff = prices.ewm(com=fast - 1).mean() - prices.ewm(com=slow - 1).mean()
if scaling:
    s = diff.std()
else:
    s = 1

return diff / s

Please register to enable the Korbit AI Mentor

Thank you for installing the Korbit AI Mentor!

To get started, please register an account on our website by authenticating with GitHub authentication. If you already have an account with us, please make sure it is linked to your GitHub account.

Once registered, we'll start reviewing your pull requests and you can kick of a scan manually from our website.

what's the difference between p_hashed.csv and p_ob.csv?

Hello, I ran experitment5 against p_hashed.csv and p_ob.csv and get very different results. the result of p_hashed is very bad and the result of p_ob is very good. Just wonder what the difference between p_hashed.csv and p_ob.csv is?

Experiment 3

Hi Dr. Schmelzer,
First of all thanks for sharing this work, and I am following the code line by line where I found a potential issue(which might be my lack of understanding),
so we have this right now:

portfolio = Portfolio(prices=prices, position=prices.apply(f, slow=slow.value, fast=fast.value, vola=vola.value, clip=winsor.value))

where the position passed to Portfolio Class varies quite violently, I'd rather have it like this:

position=prices.apply(f, slow=slow.value, fast=fast.value, vola=vola.value, clip=winsor.value)

image

My Suggestion Rescale the position as:

plus if would want to avoid leverage

position = position.apply(lambda x: x/x.abs().sum(), axis=1)
and then pass this to
portfolio = Portfolio(prices=prices, position=position)

Basically not just experiment 3 but in all the schemes. Do let me know, I might be terribly wrong.

Experiment5

Hi Dr. Schmelzer,
I have learned so much from your work, thank you very much.
I have a question in Experiment5, you say in conclusions
"Possible to reflect trading costs in objective with regularization terms (Ridge, Lars, Elastic Nets, ...).

Could you give a small example of this regularization term?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.