Jump to content
Main menu
Main menu
move to sidebar
hide
Navigation
Main page
Recent changes
Random page
freem
Search
Search
Appearance
Create account
Log in
Personal tools
Create account
Log in
Pages for logged out editors
learn more
Contributions
Talk
Editing
Openai/6936126b-3ed0-8003-aa64-374e59b4ad27
(section)
Add languages
Page
Discussion
English
Read
Edit
Edit source
View history
Tools
Tools
move to sidebar
hide
Actions
Read
Edit
Edit source
View history
General
What links here
Related changes
Special pages
Page information
Appearance
move to sidebar
hide
Warning:
You are not logged in. Your IP address will be publicly visible if you make any edits. If you
log in
or
create an account
, your edits will be attributed to your username, along with other benefits.
Anti-spam check. Do
not
fill this in!
=== Important notes / caveats about the script === * Market-cap snapshot method: the script computes a company’s market cap on a date as close price on that date × sharesOutstanding (from yfinance.info). sharesOutstanding is often current and may not reflect historical share counts exactly. For most large caps the difference is usually small, but it is a possible source of small inaccuracies vs. an official historical market-cap snapshot provider. If you prefer absolute accuracy, we can substitute a service that stores historical market-cap snapshots (CompaniesMarketCap or paid data vendors) — the script can be adapted to read those snapshots if you provide them or we can fetch them if allowed. * Dividends: the script reinvests dividends on the dividend payment date into the same stock and by default does not charge transaction costs on dividend reinvestment (common simplifying assumption). If you want to charge the 0.1% tx cost on reinvested dividends, I can change that. * FX: the script uses Yahoo Finance 'GBPUSD=X' series (which returns GBP per USD close). We convert USD amounts to GBP by multiplying USD × fx (GBP per USD). Double-check this mapping after running — if you want USD as base currency instead, change BASE_CURRENCY. * Trade execution price: trades execute at the market close price on the trade date (common backtest assumption). * Data quality: yfinance is free and convenient but occasionally misses data for a few tickers/dates. The script attempts to skip tickers missing data. For a production-grade backtest we’d want a premium historical prices & market-cap feed.
Summary:
Please note that all contributions to freem are considered to be released under the Creative Commons Attribution-ShareAlike 4.0 (see
Freem:Copyrights
for details). If you do not want your writing to be edited mercilessly and redistributed at will, then do not submit it here.
You are also promising us that you wrote this yourself, or copied it from a public domain or similar free resource.
Do not submit copyrighted work without permission!
Cancel
Editing help
(opens in new window)