Commit Graph

106 Commits (main)

Author SHA1 Message Date
ValueRaider c9dd582dd8
Merge branch 'main' into dev 2023-08-13 12:40:11 +01:00
Value Raider 4f9b05a546 Fix price repair: 100x & calibration
Price repair fixes and improvement

Fixes:
- fix reconstruction mis-calibration with tiny DataFrames
- fix detecting last-active-trading-interval when NaNs in DataFrame
- redesign mapping 100x signals to ranges:
  - no change for signals before last-active-trading-interval
  - but for signals after last-active-trading-interval, process in reverse order

Improvements:
- increase max reconstruction depth from 1 to 2. E.g. now 1wk can be repaired with 1h (1wk->1d->1h)
2023-08-13 10:54:57 +01:00
ValueRaider 1a97c22874
Merge pull request #1635 from ranaroussi/hotfix/prices-events-merge
Fix merging 1d-prices with out-of-range divs/splits
2023-08-03 21:20:29 +01:00
Value Raider cc87608824 Fix multithread error 'tz already in cache' 2023-08-02 19:29:06 +01:00
ValueRaider e8fdd12cb1
Merge branch 'dev' into feature/price-repair-improvements 2023-07-31 18:30:00 +01:00
ValueRaider d0b2070036 Fix merging 1d-prices with out-of-range divs/splits 2023-07-23 15:20:57 +01:00
ValueRaider 4a1e1c4447
Merge branch 'dev' into feature/price-repair-improvements 2023-07-22 20:34:56 +01:00
ValueRaider 6a613eb114 Improve price repair
Several improvements to price repair

Repair 100x and split errors:
- Handle stocks that recently suspended - use latest ACTIVE trading as baseline
- Improve error identification:
  - Restrict repair to no older than 1 year before oldest split
  - To reduce false positives when checking for multiday split errors,
    only analyse 'Open' and 'Close' and use average change instead of nearest-to-1
  - For weekly intervals reduce threshold to 3x standard deviation (5x was too high),
    and for monthly increase to 6x
  - For multiday intervas, if errors only detected in 1 column then assume false positive => ignore

Repair missing div-adjust:
- Fix repair of multiday intervals containing dividend

Price reconstruction:
- Move to after repairing 100x and split errors, so calibration works properly
- Fix maximum depth and reduce to 1
- Restrict calibration to 'Open' and 'Close', because 'Low' and 'High' can differ significantly between e.g. 1d and day-of-1h

Miscellaneous:
- Deprecate repair='silent', the logging module handles this
- Improve tests for 100x and split errors
- New test for 'repair missing div adjust'
2023-07-22 15:09:38 +01:00
Ricardo Prins 0503240973 Adjust PEP 8 + minor improvements + f-strings 2023-07-21 20:33:47 -06:00
Ricardo Prins aa9a0286a1
Add missing comment to test_dailyWithEvents 2023-07-21 14:25:46 -06:00
Ricardo Prins a2bde88c36 Adjust PEP 8 + minor improvement 2023-07-20 22:44:36 -06:00
ValueRaider 056b84d8fe
Merge branch 'main' into hotfix/proxy 2023-07-17 18:29:04 +01:00
ValueRaider 61c89660df Optimise info fetch, improve test 2023-07-14 15:29:55 +01:00
ValueRaider 1ce9ce2784 Fix financials ; Remove broken decryption & scraping 2023-06-21 14:49:16 +01:00
ValueRaider 27ea9472c1 Price repair improvements
Improve split-repair of multi-day intervals. Because split error can occur within a multi-day interval, e.g. mid-way through week, need to repair each OHLC column separately

Increase robustness of repair 'Adj Close'

Limit price-repair recursion depth to 2
2023-06-20 17:37:19 +01:00
ValueRaider 9e21b85043
Merge branch 'dev' into feature/fix-Yahoo-bad-div-split-adjustments 2023-06-17 12:49:01 +01:00
ValueRaider b44917b7f9 Improve price-repair of 1d 'Adj Close'
Main change is fixing price-repair of 1d 'Adj Close'. 1d repair uses 1h data, but 1h is never div-adjusted. For correct 1d 'Adj Close', extract div-adjustment from the good 1d data, and calculate it for any bad 1d data. A new unit test ensures correctness.

Other changes:
- bug fix in split-repair logic to handle price=0
- improve unit test coverage on price dividend
- add 1wk interval to split-repair unit test
2023-06-16 14:06:25 +01:00
ValueRaider 593dc8fcee Use new split-repair logic to also fix 100x error
Stumbled upon another type of 100x price error - Yahoo may switch a symbol from e.g. cents -> $ on some recent date, so recent prices are 100x different. The new split-repair is perfect for this - set change to 100 and ignore 'Volume'.
2023-06-12 14:46:58 +01:00
ValueRaider 4e2253a406 Fix prices-events merge
An out-of-range dividend was breaking merge with 1mo-prices, so fixed that. Also replaced the mega-loop with Numpy, much clearer now. Improved its tests.
2023-06-08 21:16:05 +01:00
ValueRaider e57647c1d7 Stock split repair: bug fixes & more testing 2023-06-03 20:49:35 +01:00
ValueRaider 9388c29207 Price repair improvement: fix stock split adjustment missing from pre-split data 2023-05-31 21:41:05 +01:00
ValueRaider 4802199ae7 Bugfix in `download` logging tracebacks & boost tests
New logging in `download` stores the tracebacks, but the logic was faulty, this fixes that.
Also improves error handling in `download`.
Unit tests should have detected this so improved them:
- add/improve `download` tests
- disable tests that require Yahoo decryption (because is broken)
- fix logging-related errors
- improve session use
2023-05-24 13:19:39 +01:00
ValueRaider 142b1f3eb4
Merge pull request #1499 from ranaroussi/main
sync main -> dev
2023-04-16 19:08:50 +01:00
ValueRaider 3eb60fbd4a Fix '_np not found', tweak 'info[] fixed' message 2023-04-16 10:37:25 +01:00
Value Raider a649b40dc9 Price repair: add 'Repaired?' column, and a bugfix
Price repair changes:
- if user requests price repair, add 'Repaired?' bool column showing what rows were repaired.
- fix price repair requesting <1d data beyond Yahoo's limit.
- fix logger messages
2023-04-03 21:27:04 +01:00
ValueRaider 478dc0a350
Merge pull request #1452 from ranaroussi/hotfix/prices-merge-events
Fix filtering events older than prices for merging
2023-03-21 18:16:29 +00:00
Matt Piccoli a58d7456fe Adding fix and test for aggregating Capital Gains 2023-03-18 12:57:26 -04:00
ValueRaider c362d54b1a Fix other metadata accesses + tests 2023-02-09 19:41:50 +00:00
ValueRaider f8aab533ba
Merge branch 'main' into hotfix/proxy 2023-02-08 13:52:34 +00:00
ValueRaider 0efda4f5af Fix filtering events older than prices for merging 2023-02-07 21:45:35 +00:00
ValueRaider 86b00091a9 Fix dumb bugs in price repair 2023-02-02 21:57:55 +00:00
ValueRaider 141ce7e471 Fix proxy + cache_get. Improve error propagation 2023-02-01 21:19:54 +00:00
ValueRaider 563a1a3448 Add Ticker test for proxy 2023-02-01 17:28:57 +00:00
ValueRaider 3e964d5319
Merge pull request #1383 from ranaroussi/fix/fast-info-prepost
Fix fast_info["previousClose"]
2023-01-31 19:51:46 +00:00
ValueRaider 84a31ae0b4
Merge pull request #1311 from ranaroussi/feature/prices-metadata-prune-prepost
Drop intraday intervals if in post-market but prepost=False
2023-01-31 19:50:00 +00:00
ValueRaider 891b533ec2 Drop intraday intervals if in prepost but prepost=False 2023-01-31 19:48:47 +00:00
ValueRaider 09342982a4 Add 'quoteType'. Improve handling tickers without trading 2023-01-30 23:53:06 +00:00
ValueRaider da8c49011e fast_info: Fix previousClose & yearChange 2023-01-30 16:06:55 +00:00
ValueRaider 5b0feb3d20 Fix tests 2023-01-29 16:53:26 +00:00
ValueRaider a4f11b0243 Fix price repair tests, remove unrelated changes 2023-01-29 13:01:54 +00:00
ValueRaider 685f2ec351
Merge branch 'dev' into fix/price-repair 2023-01-28 23:26:56 +00:00
ValueRaider a4bdaea888 fast_info: add camelCase, items() & values() 2023-01-28 22:27:51 +00:00
ValueRaider f3b5fb85c9 Remove exception raise from 'get_shares_full()' 2023-01-26 21:14:48 +00:00
ValueRaider a4faef83ac 'fast_info' fixes: unusual symbols ; improve migration message ; 'regular_market_previous_close' 2023-01-26 21:02:18 +00:00
ValueRaider a8ade72113 Rename 'basic_info' -> 'fast_info' ; Fix info tests 2023-01-26 16:36:25 +00:00
ValueRaider 2b0ae5a6c1 Remove 'repair_intervals' 2023-01-21 16:58:45 +00:00
ValueRaider 197d2968e3 Add 'repair_intervals', rename 'repair'->'repair_prices' 2023-01-19 22:19:16 +00:00
ValueRaider 6bd8fb2290 Improve test ; Add more keys to basic_info 2023-01-19 14:57:34 +00:00
ValueRaider cd1e16ad9e Add test ; Fix 1y price stats 2023-01-19 00:37:17 +00:00
ValueRaider 5d9a91da4a Improve 'get_shares_full()' error handling ; Minor fixes 2023-01-14 22:44:54 +00:00