Giter Club home page Giter Club logo

Comments (5)

ViktorMalesevic avatar ViktorMalesevic commented on August 24, 2024 1

Hi,

I believe this might be due to the fact that .dropna() is not being done on monthly resampled data. @JordanPlatts what are your thoughts on that?

from ffn.

Stuj79 avatar Stuj79 commented on August 24, 2024 1

Thanks for your time in looking into this, and apologies for the late reply.

I guess it all come down to this question, as you put it:

"The question is do you think the price in the beginning of May was 118 and should the ffn library assume that."

I use this package almost exclusively to analyse results of systematic trading strategies, and missing data for a month implies nothing more than the fact that there were just no trades that month, and hence the "price" of my series didn't change (as it is just the index of performance), therefore the ending "price" of the last month with a non zero return can indeed be seen as the starting "price" for the next month with a non zero return.

Whether "missing data" should be treated as truly "missing" rather than just "non existent" is a subjective call I guess - partly depends on what you are actually analysing.

I would have thought (perhaps naively) that a decent proportion of users would be using the ffn package to analyse "user created" price series such as results of trading strategies/portfolios, along with those who use it to analyse pure stock exchange price data.

Once again, I do appreciate you taking the time to look into my request - much appreciated!

from ffn.

JordanPlatts avatar JordanPlatts commented on August 24, 2024

Bug 1

The .pct_change() method uses fill forward to replace missing prices where ffn currently uses shift as you can see below.

image

This is apparent when you run .pct_change() on monthly_prices.
image

I don't view this as a bug because I don't like the library making the assumption that prices should filled forward. With that said, if everyone feels different I can change it.

image

The question is do you think the price in the beginning of May was 118 and should the ffn library assume that.

Onto bug 2

from ffn.

JordanPlatts avatar JordanPlatts commented on August 24, 2024

It was the same issue for bug 2.

image

The price 4416.56 was used as the beginning of September.

image

from ffn.

JoeOD avatar JoeOD commented on August 24, 2024

I'm having the same issue. Is there a suggestion for dealing with series of returns which contain 0s or missing values, due to the fact that the trading algo was "out of the market" for that period (position size was 0)?

from ffn.

Related Issues (20)

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.