{"id":18388378,"url":"https://github.com/jmcph4/quantmotion","last_synced_at":"2025-08-30T17:45:11.875Z","repository":{"id":87929109,"uuid":"131382074","full_name":"jmcph4/quantmotion","owner":"jmcph4","description":"Python 3 library providing quantitative financial analysis","archived":false,"fork":false,"pushed_at":"2018-11-02T05:38:48.000Z","size":14,"stargazers_count":0,"open_issues_count":0,"forks_count":2,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-02-16T00:44:13.396Z","etag":null,"topics":["backtesting","backtesting-trading-strategies","csv","finance","portfolio","python3","quant","quantitative-finance","time-series"],"latest_commit_sha":null,"homepage":null,"language":"Python","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/jmcph4.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,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2018-04-28T06:53:59.000Z","updated_at":"2018-11-02T05:38:50.000Z","dependencies_parsed_at":null,"dependency_job_id":"572f623b-81c0-4e1f-b834-e84984aef6bf","html_url":"https://github.com/jmcph4/quantmotion","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jmcph4%2Fquantmotion","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jmcph4%2Fquantmotion/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jmcph4%2Fquantmotion/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jmcph4%2Fquantmotion/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/jmcph4","download_url":"https://codeload.github.com/jmcph4/quantmotion/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248515050,"owners_count":21117098,"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","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":["backtesting","backtesting-trading-strategies","csv","finance","portfolio","python3","quant","quantitative-finance","time-series"],"created_at":"2024-11-06T01:34:04.146Z","updated_at":"2025-04-12T04:24:30.067Z","avatar_url":"https://github.com/jmcph4.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"[![Build Status](https://travis-ci.org/jmcph4/quantmotion.svg?branch=master)](https://travis-ci.org/jmcph4/quantmotion)\n\n# QuantMotion #\n---\n\nQuantMotion is a Python 3 library assisting quantitative analysis of financial assets.\n\n## Price Data ##\nQuantMotion supports price formats common in the financial industry, for e.g. OHLC data from candlestick charts, OHLC bar charts, etc.\n\n    from quantmotion.ohlcvdata import OHLCVData\n\n    price = OHLCVData(open=1.00, high=2.00, low=0.50, close=1.33)\n\n\n## Time Series ##\nQuantMotion provides code for manipulating time series data, for instance:\n\n\tfrom datetime import datetime\n    from quantmotion.timeseries import TimeSeries\n\n    ts = TimeSeries()\n\tts.insert(datetime(2018, 1, 1), OHLCVData(open=1.00, high=2.00, low=0.50, close=1.33))\n\tts.insert(datetime(2018, 1, 1), OHLCVData(open=1.40, high=2.03, low=1.40, close=1.23))\n\tlen(ts) # 2\n\tts.remove(datetime(2018, 1, 1))\n\tlen(ts) # 1\n\n## File Format Support ##\nQuantMotion supports common financial file formats. CSV is likely the most common:\n\n\tfrom quantmotion.timeseries import TimeSeries\n\tfrom quantmotion.convert import *\n\n\twith open(\"MSFT.csv\", \"r\") as f:\n\t\tts = convert_csv_to_time_series(f.read())\n\n\tlen(ts) # 100\n\n## Portfolio Backtesting ##\nQuantMotion also supports rich portfolio management and backtesting facilities. These allow portfolios to be backtested on entirely custom data and allow for custom trading strategies to be backtested across different asset classes.\n\n\tfrom datetime import datetime\n\tfrom quantmotion.asset import Asset\n    from quantmotion.portfolio import Portfolio\n\n\t# list of `Asset` objects\n\tassets = [MSFT, GOOG, APPL, WOW]\n\t\n\t# portfolio with initial cash balance of $50,000\n\tp = Portfolio(balance=50000)\n\n\t# trade on the portfolio\n\tp.buy(MSFT, 100, datetime(2018, 1, 1))\n\tp.buy(GOOG, 20, datetime(2017, 4, 5))\n\tp.sell(MSFT, 50, datetime(2018, 3, 5))\n\n\t# value the portfolio\n\tcurrent_value = p.value(datetime(2018, 4, 28))\n\tgrowth = p.growth()\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjmcph4%2Fquantmotion","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjmcph4%2Fquantmotion","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjmcph4%2Fquantmotion/lists"}