{"id":37072779,"url":"https://github.com/gabekutner/turtle-trading","last_synced_at":"2026-01-14T08:32:44.278Z","repository":{"id":209121182,"uuid":"723210843","full_name":"gabekutner/turtle-trading","owner":"gabekutner","description":"Python Package, a collection of Turtle Trading investing tools.","archived":false,"fork":false,"pushed_at":"2024-08-09T21:24:54.000Z","size":3003,"stargazers_count":4,"open_issues_count":2,"forks_count":2,"subscribers_count":1,"default_branch":"main","last_synced_at":"2024-08-09T22:35:26.896Z","etag":null,"topics":["commodities","python3","securities","trading","turtle","turtle-trading"],"latest_commit_sha":null,"homepage":"https://pypi.org/project/turtle-trading/","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/gabekutner.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":"2023-11-25T00:24:17.000Z","updated_at":"2024-08-09T21:24:57.000Z","dependencies_parsed_at":"2023-12-13T07:23:15.061Z","dependency_job_id":"b46a39be-d89d-4908-a018-a5fc0f5c9431","html_url":"https://github.com/gabekutner/turtle-trading","commit_stats":null,"previous_names":["gabekutner/turtle-trading"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/gabekutner/turtle-trading","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gabekutner%2Fturtle-trading","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gabekutner%2Fturtle-trading/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gabekutner%2Fturtle-trading/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gabekutner%2Fturtle-trading/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/gabekutner","download_url":"https://codeload.github.com/gabekutner/turtle-trading/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gabekutner%2Fturtle-trading/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28414223,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-14T08:31:27.429Z","status":"ssl_error","status_checked_at":"2026-01-14T08:31:19.098Z","response_time":107,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"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":["commodities","python3","securities","trading","turtle","turtle-trading"],"created_at":"2026-01-14T08:32:43.647Z","updated_at":"2026-01-14T08:32:44.264Z","avatar_url":"https://github.com/gabekutner.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# turtle-trading\n\u003cbr\u003e\n\nA Python Package containing a collection of investing tools using the Turtle Traders Original Rules. All code is based on the ideas in [_The Original Turtle Trading Rules_](https://oxfordstrat.com/coasdfASD32/uploads/2016/01/turtle-rules.pdf). \n\nDownload using pip:\n\n```batch\npip install turtle-trading\n```\n\n__USAGE__: First, initialize a `DataFrameLoader` class to pass as an argument to most `turtle_trading` functions as shown below.\n```python\nfrom turtle_trading import DataFrameLoader\n\nticker = 'aapl'\ndataframe = DataFrameLoader(ticker)\n```\n\n### `position_sizing` module\n```python\n\"\"\" using the position_sizing module \"\"\"\nfrom turtle_trading.position_sizing import getn, getunits\n\nimport datetime\ndate = datetime.date(2023, 11, 10)\n\ngetn(dataframe) # \u003e\u003e\u003e 2.7421\ngetn(dataframe, date=date) # \u003e\u003e\u003e 2.9932\n\ngetunits(dataframe=dataframe, account=1000000, n=2.7421) # \u003e\u003e\u003e 20.0475\ngetunits(dataframe=dataframe, account=1000000, date=date) # \u003e\u003e\u003e 17.9233\n```\n\n### `entries` module\n```python\n\"\"\" using the entries module \"\"\"\nfrom turtle_trading.entries import getentry, addunits\n\ngetentry(dataframe=dataframe, system=1) # \u003e\u003e\u003e True\ngetentry(dataframe=dataframe, system=2) # \u003e\u003e\u003e True\n\naddunits(orig_breakout=310, orig_n=2.50) # \u003e\u003e\u003e [310, 311.25, 312.5, 313.75]\naddunits(orig_breakout=310, orig_n=2.50, number_of_units=6) # \u003e\u003e\u003e [310, 311.25, 312.5, 313.75, 315.0, 316.25]\n\n# DISCLAIMER: In the rules, no more than 4 more units are allowed for a single position.\n```\n\n### `stops` module\n```python \n\"\"\" using the stops module \"\"\"\nfrom turtle_trading.entries import addunits\nfrom turtle_trading.stops import getstops\n\nunits = addunits(orig_breakout=28.30, orig_n=1.20) # \u003e\u003e\u003e [28.3, 28.9, 29.5, 30.1]\n\ngetstops(stop_system=\"regular\", unit_list=units, orig_n=1.20) # \u003e\u003e\u003e [27.7, 27.7, 27.7, 27.7]\ngetstops(stop_system=\"whipsaw\", unit_list=units, orig_n=1.20) # \u003e\u003e\u003e [27.7, 28.3, 28.9, 29.5]\n\n\ngapped_units = [28.3, 28.9, 29.5, 30.8]\n\ngetstops(stop_system=\"regular\", unit_list=gapped_units, orig_n=1.20) # \u003e\u003e\u003e [27.7, 27.7, 27.7, 28.4]\ngetstops(stop_system=\"whipsaw\", unit_list=gapped_units, orig_n=1.20) # \u003e\u003e\u003e [27.7, 28.3, 28.9, 30.2]\n```\n\n### `exits` module\n```python\nimport datetime\nfrom turtle_trading.exits import getexit\n\ngetexit(dataframe=dataframe, system=1, pos_direction=True) # \u003e\u003e\u003e True\n\ngetexit(dataframe=dataframe, system=1, pos_direction=True, date=datetime.date(2023, 11, 10)) # \u003e\u003e\u003e False\n```\n\nOfficial documentation coming soon...\n\nFor issues, look [here](https://github.com/gabekutner/turtle-trading/blob/main/.github/ISSUE_TEMPLATE.md).","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgabekutner%2Fturtle-trading","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fgabekutner%2Fturtle-trading","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgabekutner%2Fturtle-trading/lists"}