Skip to content

Conversation

@JeremyOrr4
Copy link

Closes #1

Added my example of the fama-fetch tutorial

@JeremyOrr4 JeremyOrr4 added the enhancement New feature or request label Mar 27, 2025
@JeremyOrr4 JeremyOrr4 self-assigned this Mar 27, 2025
@JeremyOrr4
Copy link
Author

@CameronBeneteau I am working on the OOP version of this as well. Can I make a ticket for it once this is accepted?

Copy link
Member

@CameronBeneteau CameronBeneteau left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks great so far @JeremyOrr4, just a few deprecation warnings to fix if they're quick and easy. I'm good if you keep this file and add a file for the OOP version in this PR.

The main things I want to see from OOP are:

  • Custom input ticker
  • Custom input start/end dates (yyyy-mm-dd)
  • Custom input list of factors (you can assume they will be in the CSV columns because we will be calculating/storing them separately)

OOP version should work with any combination of this set of inputs.

Also not sure if you prefer notebooks (.ipynb) or Python files (.py) for development. I'm good with either as long as it's easy to follow and we can clearly see the steps. I almost want to say notebooks might be better for the time being just so we can see intermediate steps and calculations, but up to you.

@JeremyOrr4
Copy link
Author

Yeah for your comments I agree with the shift to notebook. I'll make that change and fix the deprecations.

Also sounds good, I will keep the branch open and work on the newer version with what you mentioned. I think I will create a src folder for it as well

@JeremyOrr4
Copy link
Author

JeremyOrr4 commented Apr 6, 2025

@CameronBeneteau I have the basic OOP and functionalities requested. I still have some minor code improvements and ideas of what to add but we can chat at weekly meeting

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Revert this committed file

.venv
.venv
.vscode/
venv/
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Add __pycache__ to this (make sure it's global for any folder/directory)

start_date = "2006-01-01" # Start date for the analysis (format: YYYY-MM-DD)
end_date = "2023-12-31" # End date for the analysis (format: YYYY-MM-DD)
ff_data_path = "../data/F-F_Research_Data_Factors_Jer.CSV" # Path to the Fama-French factors CSV file
factors = ["Mkt-RF"] # List of factors to include in the regression (e.g., "Mkt-RF", "SMB", "HML")
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Show an example workflow on how to run

python3 -m .venv venv
source .venv/bin/activate
etc...
python3 main.py

Comments at the end of lines here look funny, maybe do something like:

    ticker: The stock or ETF ticker symbol (e.g., "QQQ" for the Nasdaq-100 ETF)
    etc...

Comment on lines +4 to +8
ticker = "QQQ"
start_date = "2006-01-01"
end_date = "2023-12-31"
ff_data_path = "../data/F-F_Research_Data_Factors_Jer.CSV"
factors = ["Mkt-RF"]
Copy link
Member

@CameronBeneteau CameronBeneteau Apr 6, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can these be passed as CLI arguments instead? Default values can be these, though.

Example: https://github.com/DFIC-Quant-Fund/Fund-Monitor/blob/main/Portfolio.py#L206

regression.run_fama_fetch()

if __name__ == "__main__":
main()
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Don't call main() in here, remove the function and put logic here, will make it easier to read CLI params.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Implement Fama-French Factor Model

3 participants