tickterial


Nametickterial JSON
Version 1.1.0 PyPI version JSON
download
home_pageNone
SummaryDownload tick data from Dukascopy Bank SA to local cache with custom simulated price streams!
upload_time2024-04-17 18:22:24
maintainerNone
docs_urlNone
authorNone
requires_python>=3.10
licenseMIT License Copyright (c) 2024 drui9 Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
keywords forex forex-data streaming forex
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            <p style="text-align: center;">
	<img src="https://raw.githubusercontent.com/sp3rtah/tickterial/master/tickterial.png" alt="cover" title="tickterial logo"/>
<p>

## Download and cache tick data(material) from Dukascopy Bank SA
This is a local API server that downloads tick data on request and caches results for subsequent calls. Finally, a free historical data collection for backtesting your forex trading algorithms!
All instruments on [this page](https://www.dukascopy.com/swiss/english/marketwatch/historical/) are supported! (But only `currency pairs` are tested based on my use case.).  <a href="mailto:ngaira14nelson@gmail.com">Email me</a> for special requests.

## Installation ::Python3
```pip install tickterial```

## Usage
This module can be used in two modes. As an API server using a `flask` backend, and as a module.

## `Module usage`
```python
from datetime import datetime, timedelta
from tickterial import tickloader

def download():
	period = datetime.now() - timedelta(minutes=60) # previous hour
	data = tickloader.download('GBPUSD', period)
	#
	count = 4
	for index, tick in enumerate(data):
		print(tick)
		#
		count -= 1
		if not count:
			print(f'--showing first {index + 1} ticks--')
			break

download()
print('--end--')
```

## `Sample output from GBPUSD`
`{'timestamp': 1689631196.875, 'ask': 1.30788, 'bid': 1.30778, 'ask-vol': 900000, 'bid-vol': 900000}`


## `API-mode usage`
`Coming soon...`

## TODO
- Internally convert prices to float	- DONE
- Add database caching for large offline histories - DEPRECATED
- Add API functionality for use as a local tcp streaming service - HIGHER LEVEL FEATURE
- Add console functionality, saving history files in multiple formats including json and csv.

## Notes
- Cache is store in UTC. Pass your UTC time difference as last parameter to `tickloader.download` to fix local time offset.
- Tick data can only be fetched to the previous hour. Current hour returns 404. This is handled internally
- Cache is stored in current working directory, path = `.tick-data`. Move this directory when migrating your server to save bandwidth and keep your cached data, or mount a local directory when using docker volumes.

            

Raw data

            {
    "_id": null,
    "home_page": null,
    "name": "tickterial",
    "maintainer": null,
    "docs_url": null,
    "requires_python": ">=3.10",
    "maintainer_email": null,
    "keywords": "forex, forex-data, streaming, forex",
    "author": null,
    "author_email": "drui9 <ngaira14nelson@gmail.com>",
    "download_url": "https://files.pythonhosted.org/packages/d4/93/07fd63c44163148ef737840aa62f7e7161cf0ab78c184cae4472e807d77e/tickterial-1.1.0.tar.gz",
    "platform": null,
    "description": "<p style=\"text-align: center;\">\r\n\t<img src=\"https://raw.githubusercontent.com/sp3rtah/tickterial/master/tickterial.png\" alt=\"cover\" title=\"tickterial logo\"/>\r\n<p>\r\n\r\n## Download and cache tick data(material) from Dukascopy Bank SA\r\nThis is a local API server that downloads tick data on request and caches results for subsequent calls. Finally, a free historical data collection for backtesting your forex trading algorithms!\r\nAll instruments on [this page](https://www.dukascopy.com/swiss/english/marketwatch/historical/) are supported! (But only `currency pairs` are tested based on my use case.).  <a href=\"mailto:ngaira14nelson@gmail.com\">Email me</a> for special requests.\r\n\r\n## Installation ::Python3\r\n```pip install tickterial```\r\n\r\n## Usage\r\nThis module can be used in two modes. As an API server using a `flask` backend, and as a module.\r\n\r\n## `Module usage`\r\n```python\r\nfrom datetime import datetime, timedelta\r\nfrom tickterial import tickloader\r\n\r\ndef download():\r\n\tperiod = datetime.now() - timedelta(minutes=60) # previous hour\r\n\tdata = tickloader.download('GBPUSD', period)\r\n\t#\r\n\tcount = 4\r\n\tfor index, tick in enumerate(data):\r\n\t\tprint(tick)\r\n\t\t#\r\n\t\tcount -= 1\r\n\t\tif not count:\r\n\t\t\tprint(f'--showing first {index + 1} ticks--')\r\n\t\t\tbreak\r\n\r\ndownload()\r\nprint('--end--')\r\n```\r\n\r\n## `Sample output from GBPUSD`\r\n`{'timestamp': 1689631196.875, 'ask': 1.30788, 'bid': 1.30778, 'ask-vol': 900000, 'bid-vol': 900000}`\r\n\r\n\r\n## `API-mode usage`\r\n`Coming soon...`\r\n\r\n## TODO\r\n- Internally convert prices to float\t- DONE\r\n- Add database caching for large offline histories - DEPRECATED\r\n- Add API functionality for use as a local tcp streaming service - HIGHER LEVEL FEATURE\r\n- Add console functionality, saving history files in multiple formats including json and csv.\r\n\r\n## Notes\r\n- Cache is store in UTC. Pass your UTC time difference as last parameter to `tickloader.download` to fix local time offset.\r\n- Tick data can only be fetched to the previous hour. Current hour returns 404. This is handled internally\r\n- Cache is stored in current working directory, path = `.tick-data`. Move this directory when migrating your server to save bandwidth and keep your cached data, or mount a local directory when using docker volumes.\r\n",
    "bugtrack_url": null,
    "license": "MIT License  Copyright (c) 2024 drui9  Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the \"Software\"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:  The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.  THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. ",
    "summary": "Download tick data from Dukascopy Bank SA to local cache with custom simulated price streams!",
    "version": "1.1.0",
    "project_urls": {
        "Homepage": "https://github.com/drui9/tickterial"
    },
    "split_keywords": [
        "forex",
        " forex-data",
        " streaming",
        " forex"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "59536038ccc4e1947bbf4936472e4a44d4dbe967eca1f451fd5593be895f3c34",
                "md5": "ddfc85bda120266e301089179a00f376",
                "sha256": "1679812171517a54cfe2e0e5abe4e10bd322e9cf82589169f272953288dcab85"
            },
            "downloads": -1,
            "filename": "tickterial-1.1.0-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "ddfc85bda120266e301089179a00f376",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.10",
            "size": 6950,
            "upload_time": "2024-04-17T18:22:22",
            "upload_time_iso_8601": "2024-04-17T18:22:22.772121Z",
            "url": "https://files.pythonhosted.org/packages/59/53/6038ccc4e1947bbf4936472e4a44d4dbe967eca1f451fd5593be895f3c34/tickterial-1.1.0-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "d49307fd63c44163148ef737840aa62f7e7161cf0ab78c184cae4472e807d77e",
                "md5": "eb71f362b1c1aae8423f2c97e236ff2c",
                "sha256": "fefaa5d4c8f80ca0cf789470149877d6571b18bb8a010c9ea058e0686eefcc63"
            },
            "downloads": -1,
            "filename": "tickterial-1.1.0.tar.gz",
            "has_sig": false,
            "md5_digest": "eb71f362b1c1aae8423f2c97e236ff2c",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.10",
            "size": 5819,
            "upload_time": "2024-04-17T18:22:24",
            "upload_time_iso_8601": "2024-04-17T18:22:24.533013Z",
            "url": "https://files.pythonhosted.org/packages/d4/93/07fd63c44163148ef737840aa62f7e7161cf0ab78c184cae4472e807d77e/tickterial-1.1.0.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2024-04-17 18:22:24",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "drui9",
    "github_project": "tickterial",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": false,
    "requirements": [],
    "lcname": "tickterial"
}
        
Elapsed time: 0.23590s