{"id":34100233,"url":"https://github.com/hanxixuana/flowrisk","last_synced_at":"2025-12-14T16:47:20.479Z","repository":{"id":57431508,"uuid":"158662178","full_name":"hanxixuana/flowrisk","owner":"hanxixuana","description":"A Python Implementation of Measures for Order Flow Risk, e.g. VPIN","archived":false,"fork":false,"pushed_at":"2021-01-01T17:48:08.000Z","size":4149,"stargazers_count":95,"open_issues_count":1,"forks_count":33,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-09-28T00:08:20.755Z","etag":null,"topics":["flow","order","risk","toxicity","vpin"],"latest_commit_sha":null,"homepage":null,"language":"Jupyter Notebook","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/hanxixuana.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2018-11-22T07:54:47.000Z","updated_at":"2025-09-07T18:58:30.000Z","dependencies_parsed_at":"2022-09-02T11:51:36.862Z","dependency_job_id":null,"html_url":"https://github.com/hanxixuana/flowrisk","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/hanxixuana/flowrisk","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hanxixuana%2Fflowrisk","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hanxixuana%2Fflowrisk/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hanxixuana%2Fflowrisk/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hanxixuana%2Fflowrisk/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/hanxixuana","download_url":"https://codeload.github.com/hanxixuana/flowrisk/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hanxixuana%2Fflowrisk/sbom","scorecard":{"id":454896,"data":{"date":"2025-08-11","repo":{"name":"github.com/hanxixuana/flowrisk","commit":"2e0e4ed9169d85918cd88b231fa8b479307decce"},"scorecard":{"version":"v5.2.1-40-gf6ed084d","commit":"f6ed084d17c9236477efd66e5b258b9d4cc7b389"},"score":3,"checks":[{"name":"Dangerous-Workflow","score":-1,"reason":"no workflows found","details":null,"documentation":{"short":"Determines if the project's GitHub Action workflows avoid dangerous patterns.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#dangerous-workflow"}},{"name":"Maintained","score":0,"reason":"0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project is \"actively maintained\".","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#maintained"}},{"name":"Token-Permissions","score":-1,"reason":"No tokens found","details":null,"documentation":{"short":"Determines if the project's workflows follow the principle of least privilege.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#token-permissions"}},{"name":"Packaging","score":-1,"reason":"packaging workflow not detected","details":["Warn: no GitHub/GitLab publishing workflow detected."],"documentation":{"short":"Determines if the project is published as a package that others can easily download, install, easily update, and uninstall.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#packaging"}},{"name":"Code-Review","score":0,"reason":"Found 0/16 approved changesets -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project requires human code review before pull requests (aka merge requests) are merged.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#code-review"}},{"name":"Binary-Artifacts","score":10,"reason":"no binaries found in the repo","details":null,"documentation":{"short":"Determines if the project has generated executable (binary) artifacts in the source repository.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#binary-artifacts"}},{"name":"CII-Best-Practices","score":0,"reason":"no effort to earn an OpenSSF best practices badge detected","details":null,"documentation":{"short":"Determines if the project has an OpenSSF (formerly CII) Best Practices Badge.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#cii-best-practices"}},{"name":"Pinned-Dependencies","score":-1,"reason":"no dependencies found","details":null,"documentation":{"short":"Determines if the project has declared and pinned the dependencies of its build process.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#pinned-dependencies"}},{"name":"Security-Policy","score":0,"reason":"security policy file not detected","details":["Warn: no security policy file detected","Warn: no security file to analyze","Warn: no security file to analyze","Warn: no security file to analyze"],"documentation":{"short":"Determines if the project has published a security policy.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#security-policy"}},{"name":"Fuzzing","score":0,"reason":"project is not fuzzed","details":["Warn: no fuzzer integrations found"],"documentation":{"short":"Determines if the project uses fuzzing.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#fuzzing"}},{"name":"Vulnerabilities","score":10,"reason":"0 existing vulnerabilities detected","details":null,"documentation":{"short":"Determines if the project has open, known unfixed vulnerabilities.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#vulnerabilities"}},{"name":"License","score":10,"reason":"license file detected","details":["Info: project has a license file: LICENSE:0","Info: FSF or OSI recognized license: MIT License: LICENSE:0"],"documentation":{"short":"Determines if the project has defined a license.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#license"}},{"name":"Signed-Releases","score":-1,"reason":"no releases found","details":null,"documentation":{"short":"Determines if the project cryptographically signs release artifacts.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#signed-releases"}},{"name":"Branch-Protection","score":0,"reason":"branch protection not enabled on development/release branches","details":["Warn: branch protection not enabled for branch 'master'"],"documentation":{"short":"Determines if the default and release branches are protected with GitHub's branch protection settings.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#branch-protection"}},{"name":"SAST","score":0,"reason":"SAST tool is not run on all commits -- score normalized to 0","details":["Warn: 0 commits out of 2 are checked with a SAST tool"],"documentation":{"short":"Determines if the project uses static code analysis.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#sast"}}]},"last_synced_at":"2025-08-19T09:18:07.695Z","repository_id":57431508,"created_at":"2025-08-19T09:18:07.695Z","updated_at":"2025-08-19T09:18:07.695Z"},"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":27731587,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-12-14T02:00:11.348Z","response_time":56,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["flow","order","risk","toxicity","vpin"],"created_at":"2025-12-14T16:47:18.638Z","updated_at":"2025-12-14T16:47:20.473Z","avatar_url":"https://github.com/hanxixuana.png","language":"Jupyter Notebook","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Order Flow Risk Measures\n\nHas been updated to support Python 3.8. Currently, the packages only has VPIN.\n\n## Installation\nThe default way is to open a console and execute\n\n    pip install flowrisk\n\nOne may also download from here and manually install\n\n    git clone https://github.com/hanxixuana/flowrisk\n    cd flowrisk\n    python setup.py install\n\n\n## VPIN\nTo implement VPIN, we made\n\n    1.  an EWMA estimator of volatility (RecursiveEWMAVol)\n    2.  a numpy.ndarray based buckets with bulk classification of volumes in the MA style (RecursiveBulkClassMABuckets)\n    3.  a numpy.ndarray based buckets with bulk classification of volumes in the EWMA style \n        (RecursiveBulkClassEWMABuckets)\n    4.  a recursive VPIN estimator (RecursiveVPIN)\n    5.  a recursive VPIN estimator with VPIN confidence intervals (RecursiveConfVPIN)\n    6.  a recursive model using an EWMA estimator of means and RecursiveEWMAVol, for modeling and log \n        innovations of VPINs and for calculating VPINs' confidence intervals (RecursiveEWMABand)\n    7.  a one-shoot VPIN estimator for a series of prices (BulkVPIN)\n    8.  a one-shoot VPIN estimator for a series of prices with VPIN confidence intervals (BulkConfVPIN)\n    9.  various configuration classes (RecursiveVPINConfig, RecursiveConfVPINConfig, BulkVPINConfig, \n        BulkConfVPINConfig)\n    \nFor illustration, we also put the 1-min data of five small caps (CBIO, FBNC, GNC NDLS, QES) and five large caps \n(V, AAPL, NVDA, GS, INTC) from the US stock market. The data covers Nov 12 to Nov 21, 2018. The data can used by, \nfor example,\n\n    import flowrisk as fr\n\n    class Config(fr.BulkConfVPINConfig):    \n        N_TIME_BAR_FOR_INITIALIZATION = 50\n    \n    config = Config()\n    \n    example = fr.examples.USStocks(config)\n    symbols = example.list_symbols('small')\n    result = example.estimate_vpin_and_conf_interval(symbols[0])\n    \n    example.draw_price_vpins_and_conf_intervals()\n\nThe piece of the code will automatically calculate VPINs and associated confidence intervals of GNC. We also put\nprices and volumes together with them into a nice picture, which is saved to ./pics/gnc.png by default. Note that\nthe calculation of VPINs is fast, but making nice pictures is slow. One may also find out more in order_flow_risk_analysis_of_ten_us_stocks.ipynb and test.py.\n\nNote that there are several differences between this implementation and the original paper:\n\n    Easley, D., López de Prado, M. M., \u0026 O'Hara, M. (2012). Flow toxicity and liquidity in a high-frequency world. \n    The Review of Financial Studies, 25(5), 1457-1493.\n\nFor example,\n\n    1.  we use an EWMA estimator for the volatility of PnLs, instead of using all samples for estimating the PnL \n        volatility; and\n    2.  VPINs are calculated from the very beginning, instead of after a certain number of buckets have been filled.\n\nWe made the differences because the core of our package is a recursive estimator of VPIN.  \n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhanxixuana%2Fflowrisk","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fhanxixuana%2Fflowrisk","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhanxixuana%2Fflowrisk/lists"}