├── docs ├── .nojekyll ├── objects.inv ├── _static │ ├── file.png │ ├── plus.png │ ├── minus.png │ ├── css │ │ ├── fonts │ │ │ ├── lato-bold.woff │ │ │ ├── lato-bold.woff2 │ │ │ ├── lato-normal.woff │ │ │ ├── lato-normal.woff2 │ │ │ ├── Roboto-Slab-Bold.woff │ │ │ ├── Roboto-Slab-Bold.woff2 │ │ │ ├── fontawesome-webfont.eot │ │ │ ├── fontawesome-webfont.ttf │ │ │ ├── lato-bold-italic.woff │ │ │ ├── lato-bold-italic.woff2 │ │ │ ├── lato-normal-italic.woff │ │ │ ├── Roboto-Slab-Regular.woff │ │ │ ├── Roboto-Slab-Regular.woff2 │ │ │ ├── fontawesome-webfont.woff │ │ │ ├── fontawesome-webfont.woff2 │ │ │ └── lato-normal-italic.woff2 │ │ └── badge_only.css │ ├── documentation_options.js │ ├── js │ │ ├── badge_only.js │ │ ├── html5shiv.min.js │ │ ├── html5shiv-printshiv.min.js │ │ └── theme.js │ ├── sphinx_press_theme.css │ └── pygments.css ├── source │ ├── rates.rst │ ├── tick.rst │ ├── trade.rst │ ├── timeframe.rst │ ├── initialization.rst │ ├── easyT.rst │ ├── easyT.manager.Manager.get_tick.rst │ ├── easyT.manager.Manager.get_rates.rst │ ├── easyT.manager.Manager.supervise.rst │ ├── manager │ │ ├── easyT.manager.Manager.get_tick.rst │ │ ├── easyT.manager.Manager.supervise.rst │ │ ├── easyT.manager.Manager.get_rates.rst │ │ ├── easyT.manager.Manager.set_platform.rst │ │ ├── easyT.manager.Manager.get_timeframe.rst │ │ ├── easyT.manager.Manager.get_initialize.rst │ │ └── easyT.manager.Manager.allowed_to_trade.rst │ ├── easyT.manager.Manager.set_platform.rst │ ├── easyT.manager.Manager.get_timeframe.rst │ ├── easyT.manager.Manager.get_initialize.rst │ ├── easyT.manager.Manager.allowed_to_trade.rst │ ├── manager.rst │ ├── conf.py │ └── index.rst ├── _sources │ ├── rates.rst.txt │ ├── trade.rst.txt │ ├── tick.rst.txt │ ├── timeframe.rst.txt │ ├── initialization.rst.txt │ ├── easyT.rst.txt │ ├── easyT.manager.Manager.get_tick.rst.txt │ ├── easyT.manager.Manager.get_rates.rst.txt │ ├── easyT.manager.Manager.supervise.rst.txt │ ├── manager │ │ ├── easyT.manager.Manager.get_tick.rst.txt │ │ ├── easyT.manager.Manager.supervise.rst.txt │ │ ├── easyT.manager.Manager.get_rates.rst.txt │ │ ├── easyT.manager.Manager.set_platform.rst.txt │ │ ├── easyT.manager.Manager.get_timeframe.rst.txt │ │ ├── easyT.manager.Manager.get_initialize.rst.txt │ │ └── easyT.manager.Manager.allowed_to_trade.rst.txt │ ├── easyT.manager.Manager.get_timeframe.rst.txt │ ├── easyT.manager.Manager.set_platform.rst.txt │ ├── easyT.manager.Manager.get_initialize.rst.txt │ ├── easyT.manager.Manager.allowed_to_trade.rst.txt │ ├── manager.rst.txt │ └── index.rst.txt ├── .doctrees │ ├── easyT.doctree │ ├── index.doctree │ ├── rates.doctree │ ├── tick.doctree │ ├── trade.doctree │ ├── manager.doctree │ ├── environment.pickle │ ├── timeframe.doctree │ ├── initialization.doctree │ ├── easyT.manager.Manager.get_tick.doctree │ ├── easyT.manager.Manager.get_rates.doctree │ ├── easyT.manager.Manager.supervise.doctree │ ├── easyT.manager.Manager.get_timeframe.doctree │ ├── easyT.manager.Manager.set_platform.doctree │ ├── easyT.manager.Manager.allowed_to_trade.doctree │ ├── easyT.manager.Manager.get_initialize.doctree │ └── manager │ │ ├── easyT.manager.Manager.get_tick.doctree │ │ ├── easyT.manager.Manager.get_rates.doctree │ │ ├── easyT.manager.Manager.supervise.doctree │ │ ├── easyT.manager.Manager.get_timeframe.doctree │ │ ├── easyT.manager.Manager.set_platform.doctree │ │ ├── easyT.manager.Manager.get_initialize.doctree │ │ └── easyT.manager.Manager.allowed_to_trade.doctree ├── .buildinfo ├── Makefile ├── make.bat ├── _modules │ └── index.html ├── conf.html ├── modules.html ├── search.html ├── py-modindex.html ├── easyT.manager.Manager.get_initialize.html ├── easyT.manager.Manager.get_timeframe.html ├── easyT.manager.Manager.set_platform.html ├── easyT.manager.Manager.get_tick.html ├── easyT.html ├── easyT.manager.Manager.get_rates.html ├── tick.html ├── timeframe.html ├── initialization.html ├── easyT.manager.Manager.allowed_to_trade.html ├── easyT.manager.Manager.supervise.html ├── rates.html └── manager │ └── easyT.manager.Manager.get_initialize.html ├── easyT ├── __init__.py ├── __version__.py ├── platforms.py ├── tick.py ├── initialization.py ├── timeframe.py ├── file_generator.py ├── rates.py └── trade.py ├── tests ├── __init__.py ├── conftest.py ├── test_tick.py ├── test_timeframe.py ├── test_initialization.py ├── test_rates.py ├── test_trade.py └── test_manager.py ├── .github ├── FUNDING.yml ├── dependabot.yaml └── workflows │ └── publish_pypi.yml ├── .pdtj.yaml ├── .cz.yaml ├── requirements.txt ├── .env.example ├── Pipfile ├── LICENSE ├── .pre-commit-config.yaml ├── setup.py └── README.md /docs/.nojekyll: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /easyT/__init__.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /tests/__init__.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /easyT/__version__.py: -------------------------------------------------------------------------------- 1 | version = "0.0.4" 2 | -------------------------------------------------------------------------------- /.github/FUNDING.yml: -------------------------------------------------------------------------------- 1 | github: Joaopeuko 2 | patreon: joaopeuko 3 | -------------------------------------------------------------------------------- /.pdtj.yaml: -------------------------------------------------------------------------------- 1 | name: easyT 2 | shelve: finance 3 | sub-project: easyT 4 | -------------------------------------------------------------------------------- /docs/objects.inv: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Joaopeuko/easyT/HEAD/docs/objects.inv -------------------------------------------------------------------------------- /docs/_static/file.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Joaopeuko/easyT/HEAD/docs/_static/file.png -------------------------------------------------------------------------------- /docs/_static/plus.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Joaopeuko/easyT/HEAD/docs/_static/plus.png -------------------------------------------------------------------------------- /docs/source/rates.rst: -------------------------------------------------------------------------------- 1 | Rates 2 | ===== 3 | 4 | .. automodule:: easyT.rates 5 | :members: -------------------------------------------------------------------------------- /docs/source/tick.rst: -------------------------------------------------------------------------------- 1 | Tick 2 | ===== 3 | 4 | .. automodule:: easyT.tick 5 | :members: 6 | -------------------------------------------------------------------------------- /docs/source/trade.rst: -------------------------------------------------------------------------------- 1 | Trade 2 | ===== 3 | 4 | .. automodule:: easyT.trade 5 | :members: -------------------------------------------------------------------------------- /docs/_sources/rates.rst.txt: -------------------------------------------------------------------------------- 1 | Rates 2 | ===== 3 | 4 | .. automodule:: easyT.rates 5 | :members: -------------------------------------------------------------------------------- /docs/_sources/trade.rst.txt: -------------------------------------------------------------------------------- 1 | Trade 2 | ===== 3 | 4 | .. automodule:: easyT.trade 5 | :members: -------------------------------------------------------------------------------- /docs/_static/minus.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Joaopeuko/easyT/HEAD/docs/_static/minus.png -------------------------------------------------------------------------------- /docs/_sources/tick.rst.txt: -------------------------------------------------------------------------------- 1 | Tick 2 | ===== 3 | 4 | .. automodule:: easyT.tick 5 | :members: 6 | -------------------------------------------------------------------------------- /docs/.doctrees/easyT.doctree: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Joaopeuko/easyT/HEAD/docs/.doctrees/easyT.doctree -------------------------------------------------------------------------------- /docs/.doctrees/index.doctree: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Joaopeuko/easyT/HEAD/docs/.doctrees/index.doctree -------------------------------------------------------------------------------- /docs/.doctrees/rates.doctree: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Joaopeuko/easyT/HEAD/docs/.doctrees/rates.doctree -------------------------------------------------------------------------------- /docs/.doctrees/tick.doctree: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Joaopeuko/easyT/HEAD/docs/.doctrees/tick.doctree -------------------------------------------------------------------------------- /docs/.doctrees/trade.doctree: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Joaopeuko/easyT/HEAD/docs/.doctrees/trade.doctree -------------------------------------------------------------------------------- /docs/source/timeframe.rst: -------------------------------------------------------------------------------- 1 | Timeframe 2 | ========= 3 | 4 | .. automodule:: easyT.timeframe 5 | :members: -------------------------------------------------------------------------------- /docs/.doctrees/manager.doctree: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Joaopeuko/easyT/HEAD/docs/.doctrees/manager.doctree -------------------------------------------------------------------------------- /docs/_sources/timeframe.rst.txt: -------------------------------------------------------------------------------- 1 | Timeframe 2 | ========= 3 | 4 | .. automodule:: easyT.timeframe 5 | :members: -------------------------------------------------------------------------------- /docs/.doctrees/environment.pickle: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Joaopeuko/easyT/HEAD/docs/.doctrees/environment.pickle -------------------------------------------------------------------------------- /docs/.doctrees/timeframe.doctree: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Joaopeuko/easyT/HEAD/docs/.doctrees/timeframe.doctree -------------------------------------------------------------------------------- /docs/.doctrees/initialization.doctree: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Joaopeuko/easyT/HEAD/docs/.doctrees/initialization.doctree -------------------------------------------------------------------------------- /docs/_static/css/fonts/lato-bold.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Joaopeuko/easyT/HEAD/docs/_static/css/fonts/lato-bold.woff -------------------------------------------------------------------------------- /docs/_static/css/fonts/lato-bold.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Joaopeuko/easyT/HEAD/docs/_static/css/fonts/lato-bold.woff2 -------------------------------------------------------------------------------- /docs/_static/css/fonts/lato-normal.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Joaopeuko/easyT/HEAD/docs/_static/css/fonts/lato-normal.woff -------------------------------------------------------------------------------- /docs/_static/css/fonts/lato-normal.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Joaopeuko/easyT/HEAD/docs/_static/css/fonts/lato-normal.woff2 -------------------------------------------------------------------------------- /docs/source/initialization.rst: -------------------------------------------------------------------------------- 1 | Initialization 2 | ============== 3 | 4 | .. automodule:: easyT.initialization 5 | :members: 6 | 7 | -------------------------------------------------------------------------------- /docs/_sources/initialization.rst.txt: -------------------------------------------------------------------------------- 1 | Initialization 2 | ============== 3 | 4 | .. automodule:: easyT.initialization 5 | :members: 6 | 7 | -------------------------------------------------------------------------------- /docs/_static/css/fonts/Roboto-Slab-Bold.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Joaopeuko/easyT/HEAD/docs/_static/css/fonts/Roboto-Slab-Bold.woff -------------------------------------------------------------------------------- /docs/_static/css/fonts/Roboto-Slab-Bold.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Joaopeuko/easyT/HEAD/docs/_static/css/fonts/Roboto-Slab-Bold.woff2 -------------------------------------------------------------------------------- /docs/_static/css/fonts/fontawesome-webfont.eot: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Joaopeuko/easyT/HEAD/docs/_static/css/fonts/fontawesome-webfont.eot -------------------------------------------------------------------------------- /docs/_static/css/fonts/fontawesome-webfont.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Joaopeuko/easyT/HEAD/docs/_static/css/fonts/fontawesome-webfont.ttf -------------------------------------------------------------------------------- /docs/_static/css/fonts/lato-bold-italic.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Joaopeuko/easyT/HEAD/docs/_static/css/fonts/lato-bold-italic.woff -------------------------------------------------------------------------------- /docs/_static/css/fonts/lato-bold-italic.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Joaopeuko/easyT/HEAD/docs/_static/css/fonts/lato-bold-italic.woff2 -------------------------------------------------------------------------------- /docs/_static/css/fonts/lato-normal-italic.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Joaopeuko/easyT/HEAD/docs/_static/css/fonts/lato-normal-italic.woff -------------------------------------------------------------------------------- /docs/_static/css/fonts/Roboto-Slab-Regular.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Joaopeuko/easyT/HEAD/docs/_static/css/fonts/Roboto-Slab-Regular.woff -------------------------------------------------------------------------------- /docs/_static/css/fonts/Roboto-Slab-Regular.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Joaopeuko/easyT/HEAD/docs/_static/css/fonts/Roboto-Slab-Regular.woff2 -------------------------------------------------------------------------------- /docs/_static/css/fonts/fontawesome-webfont.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Joaopeuko/easyT/HEAD/docs/_static/css/fonts/fontawesome-webfont.woff -------------------------------------------------------------------------------- /docs/_static/css/fonts/fontawesome-webfont.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Joaopeuko/easyT/HEAD/docs/_static/css/fonts/fontawesome-webfont.woff2 -------------------------------------------------------------------------------- /docs/_static/css/fonts/lato-normal-italic.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Joaopeuko/easyT/HEAD/docs/_static/css/fonts/lato-normal-italic.woff2 -------------------------------------------------------------------------------- /docs/.doctrees/easyT.manager.Manager.get_tick.doctree: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Joaopeuko/easyT/HEAD/docs/.doctrees/easyT.manager.Manager.get_tick.doctree -------------------------------------------------------------------------------- /docs/.doctrees/easyT.manager.Manager.get_rates.doctree: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Joaopeuko/easyT/HEAD/docs/.doctrees/easyT.manager.Manager.get_rates.doctree -------------------------------------------------------------------------------- /docs/.doctrees/easyT.manager.Manager.supervise.doctree: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Joaopeuko/easyT/HEAD/docs/.doctrees/easyT.manager.Manager.supervise.doctree -------------------------------------------------------------------------------- /docs/.doctrees/easyT.manager.Manager.get_timeframe.doctree: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Joaopeuko/easyT/HEAD/docs/.doctrees/easyT.manager.Manager.get_timeframe.doctree -------------------------------------------------------------------------------- /docs/.doctrees/easyT.manager.Manager.set_platform.doctree: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Joaopeuko/easyT/HEAD/docs/.doctrees/easyT.manager.Manager.set_platform.doctree -------------------------------------------------------------------------------- /docs/.doctrees/easyT.manager.Manager.allowed_to_trade.doctree: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Joaopeuko/easyT/HEAD/docs/.doctrees/easyT.manager.Manager.allowed_to_trade.doctree -------------------------------------------------------------------------------- /docs/.doctrees/easyT.manager.Manager.get_initialize.doctree: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Joaopeuko/easyT/HEAD/docs/.doctrees/easyT.manager.Manager.get_initialize.doctree -------------------------------------------------------------------------------- /docs/.doctrees/manager/easyT.manager.Manager.get_tick.doctree: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Joaopeuko/easyT/HEAD/docs/.doctrees/manager/easyT.manager.Manager.get_tick.doctree -------------------------------------------------------------------------------- /docs/.doctrees/manager/easyT.manager.Manager.get_rates.doctree: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Joaopeuko/easyT/HEAD/docs/.doctrees/manager/easyT.manager.Manager.get_rates.doctree -------------------------------------------------------------------------------- /docs/.doctrees/manager/easyT.manager.Manager.supervise.doctree: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Joaopeuko/easyT/HEAD/docs/.doctrees/manager/easyT.manager.Manager.supervise.doctree -------------------------------------------------------------------------------- /docs/source/easyT.rst: -------------------------------------------------------------------------------- 1 | Summary 2 | ======== 3 | 4 | .. toctree:: 5 | 6 | initialization 7 | manager 8 | rates 9 | tick 10 | timeframe 11 | trade 12 | -------------------------------------------------------------------------------- /docs/.doctrees/manager/easyT.manager.Manager.get_timeframe.doctree: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Joaopeuko/easyT/HEAD/docs/.doctrees/manager/easyT.manager.Manager.get_timeframe.doctree -------------------------------------------------------------------------------- /docs/.doctrees/manager/easyT.manager.Manager.set_platform.doctree: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Joaopeuko/easyT/HEAD/docs/.doctrees/manager/easyT.manager.Manager.set_platform.doctree -------------------------------------------------------------------------------- /docs/_sources/easyT.rst.txt: -------------------------------------------------------------------------------- 1 | Summary 2 | ======== 3 | 4 | .. toctree:: 5 | 6 | initialization 7 | manager 8 | rates 9 | tick 10 | timeframe 11 | trade 12 | -------------------------------------------------------------------------------- /docs/.doctrees/manager/easyT.manager.Manager.get_initialize.doctree: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Joaopeuko/easyT/HEAD/docs/.doctrees/manager/easyT.manager.Manager.get_initialize.doctree -------------------------------------------------------------------------------- /docs/.doctrees/manager/easyT.manager.Manager.allowed_to_trade.doctree: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Joaopeuko/easyT/HEAD/docs/.doctrees/manager/easyT.manager.Manager.allowed_to_trade.doctree -------------------------------------------------------------------------------- /docs/source/easyT.manager.Manager.get_tick.rst: -------------------------------------------------------------------------------- 1 | easyT.manager.Manager.get\_tick 2 | =============================== 3 | 4 | .. currentmodule:: easyT.manager 5 | 6 | .. automethod:: Manager.get_tick -------------------------------------------------------------------------------- /docs/_sources/easyT.manager.Manager.get_tick.rst.txt: -------------------------------------------------------------------------------- 1 | easyT.manager.Manager.get\_tick 2 | =============================== 3 | 4 | .. currentmodule:: easyT.manager 5 | 6 | .. automethod:: Manager.get_tick -------------------------------------------------------------------------------- /docs/source/easyT.manager.Manager.get_rates.rst: -------------------------------------------------------------------------------- 1 | easyT.manager.Manager.get\_rates 2 | ================================ 3 | 4 | .. currentmodule:: easyT.manager 5 | 6 | .. automethod:: Manager.get_rates -------------------------------------------------------------------------------- /docs/source/easyT.manager.Manager.supervise.rst: -------------------------------------------------------------------------------- 1 | easyT.manager.Manager.supervise 2 | =============================== 3 | 4 | .. currentmodule:: easyT.manager 5 | 6 | .. automethod:: Manager.supervise -------------------------------------------------------------------------------- /.cz.yaml: -------------------------------------------------------------------------------- 1 | --- 2 | commitizen: 3 | name: cz_conventional_commits 4 | tag_format: v$major.$minor.$patch$prerelease 5 | version: 0.0.4 6 | version_files: 7 | - pdtj/__version__.py 8 | - setup.py 9 | -------------------------------------------------------------------------------- /docs/_sources/easyT.manager.Manager.get_rates.rst.txt: -------------------------------------------------------------------------------- 1 | easyT.manager.Manager.get\_rates 2 | ================================ 3 | 4 | .. currentmodule:: easyT.manager 5 | 6 | .. automethod:: Manager.get_rates -------------------------------------------------------------------------------- /docs/_sources/easyT.manager.Manager.supervise.rst.txt: -------------------------------------------------------------------------------- 1 | easyT.manager.Manager.supervise 2 | =============================== 3 | 4 | .. currentmodule:: easyT.manager 5 | 6 | .. automethod:: Manager.supervise -------------------------------------------------------------------------------- /docs/source/manager/easyT.manager.Manager.get_tick.rst: -------------------------------------------------------------------------------- 1 | easyT.manager.Manager.get\_tick 2 | =============================== 3 | 4 | .. currentmodule:: easyT.manager 5 | 6 | .. automethod:: Manager.get_tick -------------------------------------------------------------------------------- /docs/source/manager/easyT.manager.Manager.supervise.rst: -------------------------------------------------------------------------------- 1 | easyT.manager.Manager.supervise 2 | =============================== 3 | 4 | .. currentmodule:: easyT.manager 5 | 6 | .. automethod:: Manager.supervise -------------------------------------------------------------------------------- /requirements.txt: -------------------------------------------------------------------------------- 1 | pandas 2 | pytest 3 | coverage 4 | setuptools 5 | pytest-cov 6 | python-dotenv 7 | python-dateutil 8 | supportLibEasyT 9 | binancespoteasyt 10 | metatrader5easyt 11 | 12 | 13 | -------------------------------------------------------------------------------- /docs/_sources/manager/easyT.manager.Manager.get_tick.rst.txt: -------------------------------------------------------------------------------- 1 | easyT.manager.Manager.get\_tick 2 | =============================== 3 | 4 | .. currentmodule:: easyT.manager 5 | 6 | .. automethod:: Manager.get_tick -------------------------------------------------------------------------------- /docs/_sources/manager/easyT.manager.Manager.supervise.rst.txt: -------------------------------------------------------------------------------- 1 | easyT.manager.Manager.supervise 2 | =============================== 3 | 4 | .. currentmodule:: easyT.manager 5 | 6 | .. automethod:: Manager.supervise -------------------------------------------------------------------------------- /docs/source/easyT.manager.Manager.set_platform.rst: -------------------------------------------------------------------------------- 1 | easyT.manager.Manager.set\_platform 2 | =================================== 3 | 4 | .. currentmodule:: easyT.manager 5 | 6 | .. automethod:: Manager.set_platform -------------------------------------------------------------------------------- /docs/source/manager/easyT.manager.Manager.get_rates.rst: -------------------------------------------------------------------------------- 1 | easyT.manager.Manager.get\_rates 2 | ================================ 3 | 4 | .. currentmodule:: easyT.manager 5 | 6 | .. automethod:: Manager.get_rates -------------------------------------------------------------------------------- /.env.example: -------------------------------------------------------------------------------- 1 | # ----- 2 | # Binance Spot 3 | 4 | BINANCE_API_KEY = 5 | BINANCE_SECRET_KEY = 6 | 7 | BINANCE_BASE_URL=https://api.binance.com 8 | 9 | # ----- -------------------------------------------------------------------------------- /docs/_sources/manager/easyT.manager.Manager.get_rates.rst.txt: -------------------------------------------------------------------------------- 1 | easyT.manager.Manager.get\_rates 2 | ================================ 3 | 4 | .. currentmodule:: easyT.manager 5 | 6 | .. automethod:: Manager.get_rates -------------------------------------------------------------------------------- /docs/source/easyT.manager.Manager.get_timeframe.rst: -------------------------------------------------------------------------------- 1 | easyT.manager.Manager.get\_timeframe 2 | ==================================== 3 | 4 | .. currentmodule:: easyT.manager 5 | 6 | .. automethod:: Manager.get_timeframe -------------------------------------------------------------------------------- /docs/_sources/easyT.manager.Manager.get_timeframe.rst.txt: -------------------------------------------------------------------------------- 1 | easyT.manager.Manager.get\_timeframe 2 | ==================================== 3 | 4 | .. currentmodule:: easyT.manager 5 | 6 | .. automethod:: Manager.get_timeframe -------------------------------------------------------------------------------- /docs/_sources/easyT.manager.Manager.set_platform.rst.txt: -------------------------------------------------------------------------------- 1 | easyT.manager.Manager.set\_platform 2 | =================================== 3 | 4 | .. currentmodule:: easyT.manager 5 | 6 | .. automethod:: Manager.set_platform -------------------------------------------------------------------------------- /docs/source/easyT.manager.Manager.get_initialize.rst: -------------------------------------------------------------------------------- 1 | easyT.manager.Manager.get\_initialize 2 | ===================================== 3 | 4 | .. currentmodule:: easyT.manager 5 | 6 | .. automethod:: Manager.get_initialize -------------------------------------------------------------------------------- /docs/source/manager/easyT.manager.Manager.set_platform.rst: -------------------------------------------------------------------------------- 1 | easyT.manager.Manager.set\_platform 2 | =================================== 3 | 4 | .. currentmodule:: easyT.manager 5 | 6 | .. automethod:: Manager.set_platform -------------------------------------------------------------------------------- /docs/_sources/easyT.manager.Manager.get_initialize.rst.txt: -------------------------------------------------------------------------------- 1 | easyT.manager.Manager.get\_initialize 2 | ===================================== 3 | 4 | .. currentmodule:: easyT.manager 5 | 6 | .. automethod:: Manager.get_initialize -------------------------------------------------------------------------------- /docs/_sources/manager/easyT.manager.Manager.set_platform.rst.txt: -------------------------------------------------------------------------------- 1 | easyT.manager.Manager.set\_platform 2 | =================================== 3 | 4 | .. currentmodule:: easyT.manager 5 | 6 | .. automethod:: Manager.set_platform -------------------------------------------------------------------------------- /docs/source/manager/easyT.manager.Manager.get_timeframe.rst: -------------------------------------------------------------------------------- 1 | easyT.manager.Manager.get\_timeframe 2 | ==================================== 3 | 4 | .. currentmodule:: easyT.manager 5 | 6 | .. automethod:: Manager.get_timeframe -------------------------------------------------------------------------------- /docs/_sources/manager/easyT.manager.Manager.get_timeframe.rst.txt: -------------------------------------------------------------------------------- 1 | easyT.manager.Manager.get\_timeframe 2 | ==================================== 3 | 4 | .. currentmodule:: easyT.manager 5 | 6 | .. automethod:: Manager.get_timeframe -------------------------------------------------------------------------------- /docs/source/easyT.manager.Manager.allowed_to_trade.rst: -------------------------------------------------------------------------------- 1 | easyT.manager.Manager.allowed\_to\_trade 2 | ======================================== 3 | 4 | .. currentmodule:: easyT.manager 5 | 6 | .. automethod:: Manager.allowed_to_trade -------------------------------------------------------------------------------- /docs/source/manager/easyT.manager.Manager.get_initialize.rst: -------------------------------------------------------------------------------- 1 | easyT.manager.Manager.get\_initialize 2 | ===================================== 3 | 4 | .. currentmodule:: easyT.manager 5 | 6 | .. automethod:: Manager.get_initialize -------------------------------------------------------------------------------- /docs/_sources/easyT.manager.Manager.allowed_to_trade.rst.txt: -------------------------------------------------------------------------------- 1 | easyT.manager.Manager.allowed\_to\_trade 2 | ======================================== 3 | 4 | .. currentmodule:: easyT.manager 5 | 6 | .. automethod:: Manager.allowed_to_trade -------------------------------------------------------------------------------- /docs/_sources/manager/easyT.manager.Manager.get_initialize.rst.txt: -------------------------------------------------------------------------------- 1 | easyT.manager.Manager.get\_initialize 2 | ===================================== 3 | 4 | .. currentmodule:: easyT.manager 5 | 6 | .. automethod:: Manager.get_initialize -------------------------------------------------------------------------------- /docs/source/manager/easyT.manager.Manager.allowed_to_trade.rst: -------------------------------------------------------------------------------- 1 | easyT.manager.Manager.allowed\_to\_trade 2 | ======================================== 3 | 4 | .. currentmodule:: easyT.manager 5 | 6 | .. automethod:: Manager.allowed_to_trade -------------------------------------------------------------------------------- /docs/_sources/manager/easyT.manager.Manager.allowed_to_trade.rst.txt: -------------------------------------------------------------------------------- 1 | easyT.manager.Manager.allowed\_to\_trade 2 | ======================================== 3 | 4 | .. currentmodule:: easyT.manager 5 | 6 | .. automethod:: Manager.allowed_to_trade -------------------------------------------------------------------------------- /docs/.buildinfo: -------------------------------------------------------------------------------- 1 | # Sphinx build info version 1 2 | # This file hashes the configuration used when building these files. When it is not found, a full rebuild will be done. 3 | config: 691d6011efe13b764c1c2684c2cf0a5b 4 | tags: 645f666f9bcd5a90fca523b33c5a78b7 5 | -------------------------------------------------------------------------------- /tests/conftest.py: -------------------------------------------------------------------------------- 1 | import pytest 2 | 3 | 4 | def pytest_addoption(parser): 5 | parser.addoption("--environment", action="store", choices=("local", "actions"), default="actions") 6 | 7 | 8 | @pytest.fixture(scope="session") 9 | def get_environment(pytestconfig): 10 | return pytestconfig.getoption("environment") 11 | -------------------------------------------------------------------------------- /.github/dependabot.yaml: -------------------------------------------------------------------------------- 1 | version: 2 2 | updates: 3 | - package-ecosystem: 'pip' 4 | directory: '/' 5 | schedule: 6 | interval: 'daily' 7 | 8 | - package-ecosystem: 'github-actions' 9 | directory: '/' 10 | schedule: 11 | interval: 'daily' 12 | 13 | - package-ecosystem: 'docker' 14 | directory: '/' 15 | schedule: 16 | interval: 'daily' 17 | -------------------------------------------------------------------------------- /easyT/platforms.py: -------------------------------------------------------------------------------- 1 | from supportLibEasyT import log_manager 2 | 3 | 4 | class NoPlatformFound(BaseException): 5 | """No platform was found, ensure that there is no mistype and that the platform is right.""" 6 | 7 | 8 | class Platforms: 9 | """ 10 | This class contains all the platforms allowed in this project! 11 | 12 | """ 13 | 14 | def __init__(self): 15 | self.BINANCE_SPOT = "binance-spot" 16 | self.METATRADER5 = "metatrader5" 17 | -------------------------------------------------------------------------------- /Pipfile: -------------------------------------------------------------------------------- 1 | [[source]] 2 | url = "https://pypi.org/simple" 3 | verify_ssl = true 4 | name = "pypi" 5 | 6 | [packages] 7 | binanceSpotEasyT = "*" 8 | metatrader5EasyT = "*" 9 | 10 | [dev-packages] 11 | pytest-cov = "*" 12 | sphinx-press-theme = "*" 13 | sphinx = "*" 14 | sphinx-rtd-theme = "*" 15 | tqdm = "*" 16 | pdtj = "*" 17 | black = "*" 18 | pre-commit = "*" 19 | commitizen = "*" 20 | 21 | [requires] 22 | python_version = "3.8" 23 | 24 | 25 | [scripts] 26 | format_black = "black ." 27 | -------------------------------------------------------------------------------- /docs/_static/documentation_options.js: -------------------------------------------------------------------------------- 1 | var DOCUMENTATION_OPTIONS = { 2 | URL_ROOT: document.getElementById("documentation_options").getAttribute('data-url_root'), 3 | VERSION: '0.0.2', 4 | LANGUAGE: 'None', 5 | COLLAPSE_INDEX: false, 6 | BUILDER: 'html', 7 | FILE_SUFFIX: '.html', 8 | LINK_SUFFIX: '.html', 9 | HAS_SOURCE: true, 10 | SOURCELINK_SUFFIX: '.txt', 11 | NAVIGATION_WITH_KEYS: false, 12 | SHOW_SEARCH_SUMMARY: true, 13 | ENABLE_SEARCH_SHORTCUTS: true, 14 | }; -------------------------------------------------------------------------------- /docs/source/manager.rst: -------------------------------------------------------------------------------- 1 | Manager 2 | ======== 3 | 4 | 5 | 6 | .. currentmodule:: easyT.manager 7 | 8 | .. autosummary:: 9 | :recursive: 10 | :nosignatures: 11 | :toctree: manager 12 | 13 | Manager.allowed_to_trade 14 | Manager.get_initialize 15 | Manager.get_rates 16 | Manager.get_tick 17 | Manager.get_timeframe 18 | Manager.set_platform 19 | Manager.supervise 20 | 21 | 22 | .. autoclass:: Manager 23 | :members: 24 | 25 | .. autoclass:: ClassNotInvoked 26 | :members: 27 | 28 | -------------------------------------------------------------------------------- /docs/_sources/manager.rst.txt: -------------------------------------------------------------------------------- 1 | Manager 2 | ======== 3 | 4 | 5 | 6 | .. currentmodule:: easyT.manager 7 | 8 | .. autosummary:: 9 | :recursive: 10 | :nosignatures: 11 | :toctree: manager 12 | 13 | Manager.allowed_to_trade 14 | Manager.get_initialize 15 | Manager.get_rates 16 | Manager.get_tick 17 | Manager.get_timeframe 18 | Manager.set_platform 19 | Manager.supervise 20 | 21 | 22 | .. autoclass:: Manager 23 | :members: 24 | 25 | .. autoclass:: ClassNotInvoked 26 | :members: 27 | 28 | -------------------------------------------------------------------------------- /docs/Makefile: -------------------------------------------------------------------------------- 1 | # Minimal makefile for Sphinx documentation 2 | # 3 | 4 | # You can set these variables from the command line, and also 5 | # from the environment for the first two. 6 | SPHINXOPTS ?= 7 | SPHINXBUILD ?= sphinx-build 8 | SOURCEDIR = . 9 | BUILDDIR = _build 10 | 11 | # Put it first so that "make" without argument is like "make help". 12 | help: 13 | @$(SPHINXBUILD) -M help "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O) 14 | 15 | .PHONY: help Makefile 16 | 17 | # Catch-all target: route all unknown targets to Sphinx using the new 18 | # "make mode" option. $(O) is meant as a shortcut for $(SPHINXOPTS). 19 | %: Makefile 20 | @$(SPHINXBUILD) -M $@ "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O) 21 | -------------------------------------------------------------------------------- /tests/test_tick.py: -------------------------------------------------------------------------------- 1 | from unittest.mock import patch 2 | 3 | import pytest 4 | 5 | from easyT.platforms import NoPlatformFound 6 | from easyT.tick import get_tick 7 | 8 | 9 | class TestTick: 10 | @patch("supportLibEasyT.log_manager.LogManager") 11 | def test_get_tick(self, mock_logger): 12 | result = get_tick(log=mock_logger, platform="binance-spot", symbol="btcusdt") 13 | from binanceSpotEasyT.tick import Tick as Binance 14 | 15 | assert isinstance(result, Binance) 16 | 17 | result = get_tick(log=mock_logger, platform="metatrader5", symbol="eurusd") 18 | from metatrader5EasyT.tick import Tick as Metatrader 19 | 20 | assert isinstance(result, Metatrader) 21 | 22 | with pytest.raises(NoPlatformFound): 23 | get_tick(log=mock_logger, platform="wrong platform", symbol="eurusd") 24 | -------------------------------------------------------------------------------- /tests/test_timeframe.py: -------------------------------------------------------------------------------- 1 | from unittest.mock import patch 2 | 3 | import pytest 4 | 5 | from easyT.platforms import NoPlatformFound 6 | from easyT.timeframe import get_timeframe 7 | 8 | 9 | class TestTimeFrame: 10 | @patch("supportLibEasyT.log_manager.LogManager") 11 | def test_get_timeframe(self, mock_logger): 12 | result = get_timeframe(log=mock_logger, platform="binance-spot") 13 | from binanceSpotEasyT.timeframe import TimeFrame as Binance 14 | 15 | assert isinstance(result, Binance) 16 | 17 | result = get_timeframe(log=mock_logger, platform="metatrader5") 18 | from metatrader5EasyT.timeframe import TimeFrame as Metatrader 19 | 20 | assert isinstance(result, Metatrader) 21 | 22 | with pytest.raises(NoPlatformFound): 23 | get_timeframe(log=mock_logger, platform="wrong platform") 24 | -------------------------------------------------------------------------------- /tests/test_initialization.py: -------------------------------------------------------------------------------- 1 | from unittest.mock import patch 2 | 3 | import pytest 4 | 5 | from easyT.initialization import get_initialize 6 | from easyT.platforms import NoPlatformFound 7 | 8 | 9 | class TestInitialization: 10 | @patch("supportLibEasyT.log_manager.LogManager") 11 | def test_get_initialize(self, mock_logger): 12 | result = get_initialize(mock_logger, platform="binance-spot") 13 | from binanceSpotEasyT.initialization import Initialize as Binance 14 | 15 | assert isinstance(result, Binance) 16 | 17 | result = get_initialize(mock_logger, platform="metatrader5") 18 | from metatrader5EasyT.initialization import Initialize as Metatrader 19 | 20 | assert isinstance(result, Metatrader) 21 | 22 | with pytest.raises(NoPlatformFound): 23 | get_initialize(mock_logger, platform="wrong platform") 24 | -------------------------------------------------------------------------------- /docs/make.bat: -------------------------------------------------------------------------------- 1 | @ECHO OFF 2 | 3 | pushd %~dp0 4 | 5 | REM Command file for Sphinx documentation 6 | 7 | if "%SPHINXBUILD%" == "" ( 8 | set SPHINXBUILD=sphinx-build 9 | ) 10 | set SOURCEDIR=. 11 | set BUILDDIR=_build 12 | 13 | %SPHINXBUILD% >NUL 2>NUL 14 | if errorlevel 9009 ( 15 | echo. 16 | echo.The 'sphinx-build' command was not found. Make sure you have Sphinx 17 | echo.installed, then set the SPHINXBUILD environment variable to point 18 | echo.to the full path of the 'sphinx-build' executable. Alternatively you 19 | echo.may add the Sphinx directory to PATH. 20 | echo. 21 | echo.If you don't have Sphinx installed, grab it from 22 | echo.https://www.sphinx-doc.org/ 23 | exit /b 1 24 | ) 25 | 26 | if "%1" == "" goto help 27 | 28 | %SPHINXBUILD% -M %1 %SOURCEDIR% %BUILDDIR% %SPHINXOPTS% %O% 29 | goto end 30 | 31 | :help 32 | %SPHINXBUILD% -M help %SOURCEDIR% %BUILDDIR% %SPHINXOPTS% %O% 33 | 34 | :end 35 | popd 36 | -------------------------------------------------------------------------------- /docs/_static/js/badge_only.js: -------------------------------------------------------------------------------- 1 | !function(e){var t={};function r(n){if(t[n])return t[n].exports;var o=t[n]={i:n,l:!1,exports:{}};return e[n].call(o.exports,o,o.exports,r),o.l=!0,o.exports}r.m=e,r.c=t,r.d=function(e,t,n){r.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:n})},r.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},r.t=function(e,t){if(1&t&&(e=r(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var n=Object.create(null);if(r.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var o in e)r.d(n,o,function(t){return e[t]}.bind(null,o));return n},r.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return r.d(t,"a",t),t},r.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},r.p="",r(r.s=4)}({4:function(e,t,r){}}); -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2022 Joao Paulo Euko 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /tests/test_rates.py: -------------------------------------------------------------------------------- 1 | from unittest.mock import patch 2 | 3 | import pytest 4 | 5 | from easyT.platforms import NoPlatformFound 6 | from easyT.rates import get_rates 7 | 8 | 9 | class TestRates: 10 | @patch("supportLibEasyT.log_manager.LogManager") 11 | def test_get_rates(self, mock_logger): 12 | result = get_rates( 13 | log=mock_logger, 14 | platform="binance-spot", 15 | count=20, 16 | symbol="btcusdt", 17 | timeframe="1m", 18 | ) 19 | from binanceSpotEasyT.rates import Rates as Binance 20 | 21 | assert isinstance(result, Binance) 22 | 23 | result = get_rates( 24 | log=mock_logger, 25 | platform="metatrader5", 26 | count=20, 27 | symbol="eurusd", 28 | timeframe=1, 29 | ) 30 | from metatrader5EasyT.rates import Rates as Metatrader 31 | 32 | assert isinstance(result, Metatrader) 33 | 34 | with pytest.raises(NoPlatformFound): 35 | get_rates( 36 | log=mock_logger, 37 | platform="wrong platform", 38 | count=20, 39 | symbol="eurusd", 40 | timeframe=1, 41 | ) 42 | -------------------------------------------------------------------------------- /.pre-commit-config.yaml: -------------------------------------------------------------------------------- 1 | repos: 2 | - repo: https://github.com/pre-commit/pre-commit-hooks 3 | rev: v4.4.0 4 | hooks: 5 | - id: check-json 6 | - id: check-yaml 7 | - id: trailing-whitespace 8 | - id: end-of-file-fixer 9 | - id: check-added-large-files 10 | - id: debug-statements 11 | language_version: python3 12 | 13 | - repo: https://github.com/asottile/reorder_python_imports 14 | rev: v3.9.0 15 | hooks: 16 | - id: reorder-python-imports 17 | args: [--application-directories=., --py38-plus] 18 | 19 | - repo: https://github.com/asottile/pyupgrade 20 | rev: v3.3.1 21 | hooks: 22 | - id: pyupgrade 23 | args: [--py38-plus] 24 | 25 | - repo: https://github.com/pre-commit/mirrors-mypy 26 | rev: v1.1.1 27 | hooks: 28 | - id: mypy 29 | files: ^src/ 30 | args: [] 31 | 32 | - repo: https://github.com/Joaopeuko/pdtj 33 | rev: v0.2.1 34 | hooks: 35 | - id: pdtj 36 | args: [] 37 | stages: [commit-msg] 38 | 39 | - repo: https://github.com/psf/black 40 | rev: 23.1.0 41 | hooks: 42 | - id: black 43 | args: [--safe, --line-length=120] 44 | 45 | - repo: https://github.com/commitizen-tools/commitizen 46 | rev: v2.42.1 47 | hooks: 48 | - id: commitizen 49 | stages: [commit-msg] 50 | -------------------------------------------------------------------------------- /tests/test_trade.py: -------------------------------------------------------------------------------- 1 | from unittest.mock import patch 2 | 3 | import MetaTrader5 4 | import pytest 5 | 6 | from easyT.platforms import NoPlatformFound 7 | from easyT.trade import get_trade 8 | 9 | 10 | class TestTrade: 11 | @patch.object(MetaTrader5, "positions_get") 12 | @patch.object(MetaTrader5, "symbol_info") 13 | @patch("supportLibEasyT.log_manager.LogManager") 14 | def test_get_trade(self, mock_logger, mock_symbol_info, mock_position_get): 15 | mock_symbol_info.return_value.trade_tick_size = 1e-05 16 | 17 | result = get_trade( 18 | log=mock_logger, 19 | platform="binance-spot", 20 | symbol="btcusdt", 21 | lot=0.01, 22 | stop_loss=0.00, 23 | take_profit=0.00, 24 | ) 25 | from binanceSpotEasyT.trade import Trade as Binance 26 | 27 | assert isinstance(result, Binance) 28 | 29 | result = get_trade( 30 | log=mock_logger, 31 | platform="metatrader5", 32 | symbol="eurusd", 33 | lot=0.01, 34 | stop_loss=0.00, 35 | take_profit=0.00, 36 | ) 37 | from metatrader5EasyT.trade import Trade as Metatrader 38 | 39 | assert isinstance(result, Metatrader) 40 | 41 | with pytest.raises(NoPlatformFound): 42 | get_trade( 43 | log=mock_logger, 44 | platform="wrong platform", 45 | symbol="eurusd", 46 | lot=0.01, 47 | stop_loss=0.00, 48 | take_profit=0.00, 49 | ) 50 | -------------------------------------------------------------------------------- /easyT/tick.py: -------------------------------------------------------------------------------- 1 | from supportLibEasyT.log_manager import LogManager 2 | 3 | from easyT.platforms import NoPlatformFound 4 | from easyT.platforms import Platforms 5 | 6 | 7 | def get_tick(log: LogManager, platform, symbol: str): 8 | """ 9 | This function return the class that responsible to retrieve every tick information. 10 | 11 | Tick class is the responsible to retrieve every tick information. 12 | 13 | Args: 14 | log: 15 | The log receives a log handler to be able to log the information 16 | 17 | platform: 18 | It is the platform that the information will be returned. 19 | 20 | symbol: 21 | It is the symbol you want information about. You can have information about time, bid, ask, last, volume. 22 | 23 | Returns: 24 | The class or Error message: 25 | It returns the right class that will be used or an error message in case it was not found 26 | 27 | """ 28 | log.logger.info("get_tick called") 29 | platforms = Platforms() 30 | 31 | if platform == platforms.BINANCE_SPOT: 32 | log.logger.info(f"It is returning the platform {platforms.BINANCE_SPOT}.") 33 | 34 | from binanceSpotEasyT.tick import Tick 35 | 36 | return Tick(symbol) 37 | 38 | elif platform == platforms.METATRADER5: 39 | log.logger.info(f"It is returning the platform {platforms.METATRADER5}.") 40 | 41 | from metatrader5EasyT.tick import Tick 42 | 43 | return Tick(symbol) 44 | 45 | else: 46 | log.logger.error( 47 | f"The {platform} was not found, you can only use these options {platforms.__dict__.keys()}" 48 | f"of type Platform or the values {platforms.__dict__.values()} of type string, " 49 | f"both are acceptable." 50 | ) 51 | 52 | raise NoPlatformFound 53 | -------------------------------------------------------------------------------- /setup.py: -------------------------------------------------------------------------------- 1 | import json 2 | import os 3 | import pathlib 4 | 5 | import setuptools 6 | 7 | long_description = (pathlib.Path(__file__).parent / "README.md").read_text() 8 | 9 | 10 | def get_requirements_from_pipfile_lock(pipfile_lock=None): 11 | if pipfile_lock is None: 12 | pipfile_lock = os.path.join(os.path.dirname(os.path.realpath(__file__)), "Pipfile.lock") 13 | lock_data = json.load(open(pipfile_lock)) 14 | retval = [] 15 | for package_name, package_data in lock_data.get("default", {}).items(): 16 | if package_data.get("file"): 17 | package_ref = f'{package_name} @ {package_data["file"]}' 18 | else: 19 | package_ref = f'{package_name}{package_data["version"]}' 20 | retval.append(package_ref) 21 | return retval 22 | 23 | 24 | def generate_requirements_txt(pipfile_lock_requirements): 25 | for requirement in pipfile_lock_requirements: 26 | with open(os.path.join("requirements.txt"), "w") as file: 27 | file.writelines(requirement) 28 | 29 | 30 | requirements = get_requirements_from_pipfile_lock() 31 | generate_requirements_txt(requirements) 32 | 33 | setuptools.setup( 34 | name="easyT", 35 | version="0.0.4", 36 | license="MIT", 37 | author="Joao Paulo Euko", 38 | url="https://github.com/Joaopeuko/easyT", 39 | keywords=[ 40 | "binance", 41 | "spot", 42 | "algotrading", 43 | "cryptocurrency", 44 | "automatic trade", 45 | "automated trade", 46 | ], 47 | long_description=long_description, 48 | long_description_content_type="text/markdown", 49 | packages=setuptools.find_packages(), 50 | install_requires=requirements, 51 | entry_points={ 52 | "console_scripts": [ 53 | "easyt = easyT.file_generator:main", 54 | ], 55 | }, 56 | ) 57 | -------------------------------------------------------------------------------- /easyT/initialization.py: -------------------------------------------------------------------------------- 1 | from dotenv import load_dotenv 2 | from supportLibEasyT.log_manager import LogManager 3 | 4 | from easyT.platforms import NoPlatformFound 5 | from easyT.platforms import Platforms 6 | 7 | 8 | def get_initialize(log: LogManager, platform: str or Platforms): 9 | """ 10 | This function return the class that ensure the platform are working properly. 11 | 12 | If it is connected on the internet, and if the symbol that you are trying to use exists or was not mistyped. 13 | 14 | Args: 15 | log: 16 | The log receives a log handler to be able to log the information 17 | 18 | platform: 19 | It is the platform that the information will be returned. 20 | 21 | Returns: 22 | The class or Error message: 23 | It returns the right class that will be used or an error message in case it was not found 24 | 25 | """ 26 | log.logger.info("get_initialize called") 27 | platforms = Platforms() 28 | 29 | if platform == platforms.BINANCE_SPOT: 30 | log.logger.info(f"It is returning the platform {platforms.BINANCE_SPOT}.") 31 | 32 | load_dotenv() 33 | from binanceSpotEasyT.initialization import Initialize 34 | 35 | return Initialize() 36 | 37 | elif platform == platforms.METATRADER5: 38 | log.logger.info(f"It is returning the platform {platforms.METATRADER5}.") 39 | 40 | from metatrader5EasyT.initialization import Initialize 41 | 42 | return Initialize() 43 | 44 | else: 45 | log.logger.error( 46 | f"The {platform} was not found, you can only use these options {platforms.__dict__.keys()}" 47 | f"of type Platform or the values {platforms.__dict__.values()} of type string, " 48 | f"both are acceptable." 49 | ) 50 | 51 | raise NoPlatformFound 52 | -------------------------------------------------------------------------------- /easyT/timeframe.py: -------------------------------------------------------------------------------- 1 | from supportLibEasyT.log_manager import LogManager 2 | 3 | from easyT.platforms import NoPlatformFound 4 | from easyT.platforms import Platforms 5 | 6 | 7 | def get_timeframe(log: LogManager, platform): 8 | """ 9 | This function return the class that responsible to hold the timeframe from different platform in a same structure. 10 | 11 | There are incompatibilities and different patterns in writing the timeframe between platforms. 12 | This class attend to reduce the chance of errors providing the same timeframe structure between platforms. 13 | 14 | Args: 15 | log: 16 | The log receives a log handler to be able to log the information 17 | 18 | platform: 19 | It is the platform that the information will be returned. 20 | 21 | Returns: 22 | The class or Error message: 23 | It returns the right class that will be used or an error message in case it was not found 24 | 25 | Examples: 26 | You can find an example of the TimeFrame usage in update_rates() function in Rates documentation 27 | 28 | """ 29 | log.logger.info("get_timeframe called") 30 | platforms = Platforms() 31 | 32 | if platform == platforms.BINANCE_SPOT: 33 | log.logger.info(f"It is returning the platform {platforms.BINANCE_SPOT}.") 34 | 35 | from binanceSpotEasyT.timeframe import TimeFrame 36 | 37 | return TimeFrame() 38 | 39 | elif platform == platforms.METATRADER5: 40 | log.logger.info(f"It is returning the platform {platforms.METATRADER5}.") 41 | 42 | from metatrader5EasyT.timeframe import TimeFrame 43 | 44 | return TimeFrame() 45 | 46 | else: 47 | log.logger.error( 48 | f"The {platform} was not found, you can only use these options {platforms.__dict__.keys()}" 49 | f"of type Platform or the values {platforms.__dict__.values()} of type string, " 50 | f"both are acceptable." 51 | ) 52 | 53 | raise NoPlatformFound 54 | -------------------------------------------------------------------------------- /easyT/file_generator.py: -------------------------------------------------------------------------------- 1 | import argparse 2 | 3 | 4 | def get_arguments(): 5 | parser = argparse.ArgumentParser() 6 | 7 | parser.add_argument("--file_name", type=str, action="store", default="demo") 8 | 9 | return vars(parser.parse_args()) 10 | 11 | 12 | def main(): 13 | file_name = get_arguments()["file_name"] 14 | 15 | with open(f"{file_name}.py", "w") as file: 16 | file.write( 17 | """from easyT.manager import Manager 18 | from easyT.platforms import Platforms 19 | 20 | symbol = 'EURUSD' 21 | platform = Platforms().METATRADER5 22 | 23 | manager = Manager() 24 | manager.set_platform(platform=platform) 25 | 26 | initialize = manager.get_initialize() 27 | 28 | initialize.initialize_platform() 29 | initialize.initialize_symbol() 30 | 31 | timeframe = manager.get_timeframe() 32 | 33 | tick = manager.get_tick(symbol=symbol) 34 | rates = manager.get_rates(count=20, symbol=symbol, timeframe=timeframe.ONE_MINUTE) 35 | trade = manager.get_trade(symbol=symbol, lot=0.01, stop_loss=0.00003, take_profit=0.00003) 36 | 37 | manager.set_trading_time(time_trade_start='00:05', 38 | time_trade_stop='23:40', 39 | time_position_close='23:55') 40 | while True: 41 | manager.supervise() 42 | 43 | buy = ( 44 | 45 | # Write the buy logic here! 46 | # Example: 47 | # It buys if the price is higher than the 20 candles average 48 | # You can set the timeframe here in the code above: 49 | # rates = manager.get_rates(count=20, symbol=symbol, timeframe=timeframe.ONE_MINUTE) 50 | tick.ask > rates.open.mean() 51 | 52 | ) 53 | 54 | sell = ( 55 | 56 | # Write sell the buy logic here! 57 | # Example: 58 | # It sells if the price is higher than the 20 candles average 59 | # You can set the timeframe here in the code above: 60 | # rates = manager.get_rates(count=20, symbol=symbol, timeframe=timeframe.ONE_MINUTE) 61 | tick.bid < rates.open.mean() 62 | 63 | ) 64 | 65 | trade.position_open(buy, sell) 66 | """ 67 | ) 68 | -------------------------------------------------------------------------------- /easyT/rates.py: -------------------------------------------------------------------------------- 1 | from supportLibEasyT.log_manager import LogManager 2 | 3 | from easyT.platforms import NoPlatformFound 4 | from easyT.platforms import Platforms 5 | 6 | 7 | def get_rates(log: LogManager, platform: str, count: int, symbol: str, timeframe): 8 | """ 9 | The function get_rates is used to select which rates will be used taking in consideration the platform. 10 | 11 | The Rates class is responsible to retrieve a certain amount of previous data. 12 | 13 | Args: 14 | log: 15 | The log receives a log handler to be able to log the information 16 | 17 | platform: 18 | It is the platform that the information will be returned. 19 | 20 | symbol: 21 | The symbol you want to retrieve previous data. 22 | 23 | timeframe (TimeFrame): 24 | The timeframe you want information, like 1 minute, 5 minute, 1 week. 25 | 26 | count: 27 | It is the amount of information in the past you want. If your time frame is 5 minutes and your count is 4, 28 | it will return 4 values containing time, open, high, low, close, tick_volume information of this past 4 29 | candlesticks. 30 | 31 | Returns: 32 | The class or Error message: 33 | It returns the right class that will be used or an error message in case it was not found 34 | 35 | 36 | """ 37 | log.logger.info("get_rates called") 38 | platforms = Platforms() 39 | 40 | if platform == platforms.BINANCE_SPOT: 41 | log.logger.info(f"It is returning the platform {platforms.BINANCE_SPOT}.") 42 | 43 | from binanceSpotEasyT.rates import Rates 44 | 45 | return Rates(count=count, symbol=symbol, timeframe=timeframe) 46 | 47 | elif platform == platforms.METATRADER5: 48 | log.logger.info(f"It is returning the platform {platforms.METATRADER5}.") 49 | 50 | from metatrader5EasyT.rates import Rates 51 | 52 | return Rates(count=count, symbol=symbol, timeframe=timeframe) 53 | 54 | else: 55 | log.logger.error( 56 | f"The {platform} was not found, you can only use these options {platforms.__dict__.keys()}" 57 | f"of type Platform or the values {platforms.__dict__.values()} of type string, " 58 | f"both are acceptable." 59 | ) 60 | 61 | raise NoPlatformFound 62 | -------------------------------------------------------------------------------- /.github/workflows/publish_pypi.yml: -------------------------------------------------------------------------------- 1 | name: Publish distributions 2 | 3 | # Controls when the workflow will run 4 | on: 5 | # Triggers the workflow on push request events but only for the master branch 6 | push: 7 | branches: [ master ] 8 | tags: 9 | - v* 10 | 11 | # A workflow run is made up of one or more jobs that can run sequentially or in parallel 12 | jobs: 13 | # This workflow contains a single job called "build-and-publish" 14 | build-and-publish: 15 | # The type of runner that the job will run on 16 | runs-on: windows-latest 17 | 18 | # Steps represent a sequence of tasks that will be executed as part of the job 19 | steps: 20 | # Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it 21 | - uses: actions/checkout@v4 22 | - name: Set up Python 23 | uses: actions/setup-python@v5 24 | with: 25 | python-version: 3.8 26 | 27 | #Install dependencies 28 | - name: Install dependencies 29 | run: | 30 | python3 -m pip install --upgrade pip 31 | python3 -m pip install --upgrade setuptools 32 | python3 -m pip install install wheel twine 33 | python3 -m pip install -r requirements.txt 34 | 35 | - name: Run coverage file 36 | env: 37 | BINANCE_BASE_URL: ${{secrets.BINANCE_BASE_URL}} 38 | BINANCE_API_KEY: ${{secrets.BINANCE_API_KEY}} 39 | BINANCE_SECRET_KEY: ${{secrets.BINANCE_SECRET_KEY}} 40 | run: | 41 | coverage run -m pytest --cache-clear --cov-report term-missing --cov=easyT 42 | 43 | # Try to publish to Test Pypi 44 | - name: Publish distribution to Test PyPI 45 | env: 46 | TWINE_USERNAME: ${{ secrets.PYPI_API_USERNAME }} 47 | TWINE_PASSWORD: ${{ secrets.TEST_PYPI_API_TOKEN }} 48 | run: | 49 | python3 setup.py sdist bdist_wheel 50 | twine upload --skip-existing --repository-url https://test.pypi.org/legacy/ dist/* 51 | 52 | # When there is a new tag, publish to PyPi 53 | - name: Publish distribution to PyPI 54 | if: startsWith(github.ref, 'refs/tags/v') 55 | env: 56 | TWINE_USERNAME: ${{ secrets.PYPI_API_USERNAME }} 57 | TWINE_PASSWORD: ${{ secrets.PYPI_API_TOKEN }} 58 | run: | 59 | python3 setup.py sdist bdist_wheel 60 | twine upload dist/* 61 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | ![PyPI - Downloads](https://img.shields.io/pypi/dm/easyT) 2 | ![PyPI](https://img.shields.io/pypi/v/easyT) 3 | ![PyPI - Wheel](https://img.shields.io/pypi/wheel/easyT) 4 | ![PyPI - License](https://img.shields.io/pypi/l/easyT) 5 | 6 | # easyT 7 | 8 | - easyT, 9 | - easyTo trade, 10 | - easyTo use! 11 | 12 | # Summary 13 | 14 | - [Requirements](#requirements) 15 | - [Libraries Documentation](#libraries-documentation) 16 | 17 | # Requirements 18 | 19 | The first thing tou will need is **Python** installed in your computer. 20 | Right now, it is required the version 3.8. 21 | 22 | - _Yeah, ok, but I do not know how to install Python on my computer, or I do not want to install it._ 23 | - _Can I still use it?_ 24 | 25 | In parts, you can use Notebooks that allows you to use Python direct from the web, test the code and, understand how 26 | things works before try it in your computer. 27 | Two famous Notebooks are **Google Colaboratory** and **Jupyter Notebook**. 28 | 29 | I will provide examples! 30 | 31 | Remember that the use of an IDE can make your live easier, I use **PYCHARM**! 32 | 33 | On your favorite IDE, you can use some project that you already have or create a new one, and then you install it: 34 | 35 | ```python 36 | pip install easyT 37 | ``` 38 | 39 | That is it! The first steps are completed! 40 | 41 | - #### Q: What do I do now? How to use it? 42 | 43 | Simple, type ```easyt``` on your terminal, and it will generate a ```demo.py``` file! 44 | If you prefer, you can give to it a different name, just typing: 45 | 46 | ```easyt --file_name example``` generates: 47 | ```example.py``` 48 | 49 | ```easyt --file_name test_file``` generates: 50 | ```test_file.py``` 51 | 52 | # Libraries Documentation 53 | 54 | All the Libraries Documentation and useful links are linked below: 55 | 56 | 57 | - easyT - [Documentation](https://www.mydocumentations.com/easyt/index.html) - [GitHub](https://github.com/Joaopeuko/easyT) - [Pypi](https://pypi.org/project/easyT/) 58 | - binanceSpotEasyT - [Documentation](https://www.mydocumentations.com/binance-spot/index.html) - [GitHub](https://github.com/Joaopeuko/binanceSpotEasyT) - [Pypi](https://pypi.org/project/binanceSpotEasyT/) 59 | - metatrader5EasyT - [Documentation](https://www.mydocumentations.com/mt5/index.html) - [GitHub](https://github.com/Joaopeuko/metatrader5EasyT) - [Pypi](https://pypi.org/project/metatrader5EasyT/) 60 | 61 | The documentation for this specific project is this one [binanceSpotEasyT](https://www.mydocumentations.com/binance-spot/index.html). 62 | 63 | See my page ([Joao Paulo Euko](https://joaopeuko.com/)) to see all my projects or for more information. 64 | -------------------------------------------------------------------------------- /docs/_static/js/html5shiv.min.js: -------------------------------------------------------------------------------- 1 | /** 2 | * @preserve HTML5 Shiv 3.7.3 | @afarkas @jdalton @jon_neal @rem | MIT/GPL2 Licensed 3 | */ 4 | !function(a,b){function c(a,b){var c=a.createElement("p"),d=a.getElementsByTagName("head")[0]||a.documentElement;return c.innerHTML="x",d.insertBefore(c.lastChild,d.firstChild)}function d(){var a=t.elements;return"string"==typeof a?a.split(" "):a}function e(a,b){var c=t.elements;"string"!=typeof c&&(c=c.join(" ")),"string"!=typeof a&&(a=a.join(" ")),t.elements=c+" "+a,j(b)}function f(a){var b=s[a[q]];return b||(b={},r++,a[q]=r,s[r]=b),b}function g(a,c,d){if(c||(c=b),l)return c.createElement(a);d||(d=f(c));var e;return e=d.cache[a]?d.cache[a].cloneNode():p.test(a)?(d.cache[a]=d.createElem(a)).cloneNode():d.createElem(a),!e.canHaveChildren||o.test(a)||e.tagUrn?e:d.frag.appendChild(e)}function h(a,c){if(a||(a=b),l)return a.createDocumentFragment();c=c||f(a);for(var e=c.frag.cloneNode(),g=0,h=d(),i=h.length;i>g;g++)e.createElement(h[g]);return e}function i(a,b){b.cache||(b.cache={},b.createElem=a.createElement,b.createFrag=a.createDocumentFragment,b.frag=b.createFrag()),a.createElement=function(c){return t.shivMethods?g(c,a,b):b.createElem(c)},a.createDocumentFragment=Function("h,f","return function(){var n=f.cloneNode(),c=n.createElement;h.shivMethods&&("+d().join().replace(/[\w\-:]+/g,function(a){return b.createElem(a),b.frag.createElement(a),'c("'+a+'")'})+");return n}")(t,b.frag)}function j(a){a||(a=b);var d=f(a);return!t.shivCSS||k||d.hasCSS||(d.hasCSS=!!c(a,"article,aside,dialog,figcaption,figure,footer,header,hgroup,main,nav,section{display:block}mark{background:#FF0;color:#000}template{display:none}")),l||i(a,d),a}var k,l,m="3.7.3-pre",n=a.html5||{},o=/^<|^(?:button|map|select|textarea|object|iframe|option|optgroup)$/i,p=/^(?:a|b|code|div|fieldset|h1|h2|h3|h4|h5|h6|i|label|li|ol|p|q|span|strong|style|table|tbody|td|th|tr|ul)$/i,q="_html5shiv",r=0,s={};!function(){try{var a=b.createElement("a");a.innerHTML="",k="hidden"in a,l=1==a.childNodes.length||function(){b.createElement("a");var a=b.createDocumentFragment();return"undefined"==typeof a.cloneNode||"undefined"==typeof a.createDocumentFragment||"undefined"==typeof a.createElement}()}catch(c){k=!0,l=!0}}();var t={elements:n.elements||"abbr article aside audio bdi canvas data datalist details dialog figcaption figure footer header hgroup main mark meter nav output picture progress section summary template time video",version:m,shivCSS:n.shivCSS!==!1,supportsUnknownElements:l,shivMethods:n.shivMethods!==!1,type:"default",shivDocument:j,createElement:g,createDocumentFragment:h,addElements:e};a.html5=t,j(b),"object"==typeof module&&module.exports&&(module.exports=t)}("undefined"!=typeof window?window:this,document); -------------------------------------------------------------------------------- /docs/_static/sphinx_press_theme.css: -------------------------------------------------------------------------------- 1 | /* 2 | * 3 | * Defines default styles specific to Sphinx Press, 4 | * on top of VuePress styles 5 | * 6 | */ 7 | 8 | /* FONTS FOR THE CODE - will fall back to monospace if unavailable */ 9 | 10 | @import url('https://fontlibrary.org/face/roboto-mono'); 11 | @import url('https://fontlibrary.org/face/inconsolata'); 12 | 13 | /* MAKES MAIN TEXT SECTION LARGER */ 14 | .content:not(.custom) { 15 | max-width: 840px; 16 | } 17 | 18 | /* THE SECTION BELOW DEFINES THE APPEARANCE OF AUTODOC-GENERATED DOCS */ 19 | 20 | .sig-name.descname { 21 | font-size: 1.2em; 22 | font-weight: bold; 23 | padding: 0 0 3px; /* creates a perfect grey rectangle*/ 24 | } 25 | 26 | .sig-param { 27 | font-family: 'RobotoMonoRegular', 'Roboto Mono', 'Inconsolata', monospace; 28 | margin-left: 0.3em; 29 | } 30 | 31 | .sig-paren { 32 | margin-left: 0.3em; 33 | } 34 | 35 | dt { 36 | line-height: 1.5em; 37 | margin-bottom: 1em; 38 | } 39 | 40 | dt.field-odd, dt.field-even, p.rubric { 41 | font-size: 1.2em; 42 | font-weight: bold; 43 | color: #4d6a86 44 | } 45 | 46 | dd { 47 | margin-inline-start: 10px; 48 | } 49 | 50 | dd.field-odd p strong { 51 | margin-left: 1em; 52 | } 53 | 54 | dl.method, dl.function { 55 | margin-top: 2em; 56 | margin-bottom: 3em; 57 | } 58 | 59 | .viewcode-link { 60 | margin-left: 1em; 61 | color: #9ad8bc; 62 | } 63 | 64 | /* THE SECTION BELOW DEFINES THE APPEARANCE OF TABLE-OF-CONTENTS */ 65 | 66 | /* color fixes for table of contents */ 67 | .toc-backref { 68 | /* TOCS cause all your section titles to go green. Pouah! */ 69 | color: inherit; 70 | } 71 | 72 | .contents.topic p.topic-title { 73 | /* Hide all TOC titles */ 74 | display: none; 75 | } 76 | 77 | .contents.topic { 78 | margin-bottom: 3em; 79 | } 80 | 81 | 82 | /* THE SECTION BELOW CHANGES CODE FONTS FOR BETTER 80-CHARS READABILITY */ 83 | /* Code will be displayed as Roboto, or Inconsolata if screen is small */ 84 | code, pre { 85 | font-family: 'RobotoMonoRegular', 'Roboto Mono', 'Inconsolata', monospace; 86 | } 87 | 88 | @media (max-width: 1200px) { 89 | code, pre { 90 | font-family: 'InconsolataRegular', 'Inconsolata', 'RobotoMonoRegular', 'Roboto Mono', monospace; 91 | } 92 | pre { 93 | font-size: 0.95em; 94 | } 95 | } 96 | 97 | blockquote { 98 | font-size: inherit; 99 | } 100 | 101 | blockquote h2 { 102 | margin-left: 1em; 103 | } 104 | 105 | /* THE SECTION BELOW FIXES A SPHINX-MERMAID OPACITY PROBLEM */ 106 | .content .section { 107 | opacity: 1.0 !important; 108 | } 109 | .section { 110 | opacity: 1.0 !important; 111 | } 112 | 113 | /* MAKES SPHINX SYNTAX figure:: :align:center WORK AGAIN */ 114 | .figure.align-center { 115 | text-align: center 116 | } -------------------------------------------------------------------------------- /docs/source/conf.py: -------------------------------------------------------------------------------- 1 | # Configuration file for the Sphinx documentation builder. 2 | # 3 | # This file only contains a selection of the most common options. For a full 4 | # list see the documentation: 5 | # https://www.sphinx-doc.org/en/master/usage/configuration.html 6 | # -- Path setup -------------------------------------------------------------- 7 | # If extensions (or modules to document with autodoc) are in another directory, 8 | # add these directories to sys.path here. If the directory is relative to the 9 | # documentation root, use os.path.abspath to make it absolute, like shown here. 10 | import os 11 | import sys 12 | 13 | sys.path.insert(0, os.path.abspath("../..")) 14 | 15 | autodoc_default_flags = ["members"] 16 | 17 | # -- Project information ----------------------------------------------------- 18 | 19 | project = "easyT" 20 | copyright = "2022, Joao Paulo Euko" 21 | author = "Joao Paulo Euko" 22 | 23 | # The full version, including alpha/beta/rc tags 24 | release = "0.0.2" 25 | 26 | # -- General configuration --------------------------------------------------- 27 | 28 | # Add any Sphinx extension module names here, as strings. They can be 29 | # extensions coming with Sphinx (named 'sphinx.ext.*') or your custom 30 | # ones. 31 | extensions = [ 32 | "sphinx.ext.autodoc", 33 | "sphinx.ext.doctest", 34 | "sphinx.ext.intersphinx", 35 | "sphinx.ext.todo", 36 | "sphinx.ext.coverage", 37 | "sphinx.ext.mathjax", 38 | "sphinx.ext.ifconfig", 39 | "sphinx.ext.viewcode", 40 | "sphinx.ext.githubpages", 41 | "sphinx.ext.napoleon", 42 | "sphinx.ext.autosummary", 43 | "sphinx_rtd_theme", 44 | ] 45 | 46 | # Add any paths that contain templates here, relative to this directory. 47 | templates_path = ["_templates"] 48 | 49 | # List of patterns, relative to source directory, that match files and 50 | # directories to ignore when looking for source files. 51 | # This pattern also affects html_static_path and html_extra_path. 52 | exclude_patterns = [] 53 | 54 | # -- Options for HTML output ------------------------------------------------- 55 | 56 | # The theme to use for HTML and HTML Help pages. See the documentation for 57 | # a list of builtin themes. 58 | # 59 | html_theme = "sphinx_rtd_theme" 60 | 61 | # Add any paths that contain custom static files (such as style sheets) here, 62 | # relative to this directory. They are copied after the builtin static files, 63 | # so a file named "default.css" will overwrite the builtin "default.css". 64 | html_static_path = [] 65 | 66 | # Napoleon settings 67 | napoleon_google_docstring = True 68 | napoleon_numpy_docstring = False 69 | napoleon_include_init_with_doc = True 70 | napoleon_include_private_with_doc = True 71 | napoleon_include_special_with_doc = True 72 | napoleon_use_admonition_for_examples = False 73 | napoleon_use_admonition_for_notes = False 74 | napoleon_use_admonition_for_references = False 75 | napoleon_use_ivar = False 76 | napoleon_use_param = True 77 | napoleon_use_rtype = True 78 | -------------------------------------------------------------------------------- /docs/source/index.rst: -------------------------------------------------------------------------------- 1 | EasyT 2 | ===== 3 | 4 | Just as a reminder, I would like you to reflect about the fact that **$1.00 Dollar** might be **not** 5 | that **much** to you, but **you, an incredible person**, combined to other's **amazing Sponsors**, can **finance** this 6 | project, and it will **allows me** to constantly **improve and maintain** it, **and, I am not asking that much**. 7 | 8 | Here is my Patreon (https://www.patreon.com/joaopeuko) link. 9 | 10 | - Yeah, I would like to do that, but I do not have that kind of money. 11 | 12 | That is Ok, and, there are many ways you can help me, here is a list: 13 | 14 | - **Star** this project on GitHub. 15 | - **Share** this project. 16 | - **Open an account with Binance referral link**: 17 | - When you open an account on Binance you help me when you trade! 18 | Some of your tax paid returns for you and part goes for me. 19 | Below you can see the percentage cash back for me and for you, and you trade: 20 | You can find more information about the **Binance** referral link (https://www.binance.com/en/support/faq/88659d2ea54c40cf82a22400207ffe30) 21 | - .. list-table:: 22 | :widths: 15 15 70 23 | :header-rows: 1 24 | 25 | * - For me 26 | - For you 27 | - Link 28 | * - 10% 29 | - 10% 30 | - https://accounts.binance.com/en/register?ref=IBNF8RAW 31 | * - 15% 32 | - 15% 33 | - https://accounts.binance.com/en/register?ref=D11OJ6NP 34 | * - 20% 35 | - 0% 36 | - https://accounts.binance.com/en/register?ref=SAUNZ26X 37 | 38 | - And, there are **Ads** in all the documentations, that hopefully, will help me finance this project. 39 | 40 | Summary: 41 | ======== 42 | 43 | - How to install:: 44 | 45 | pip install easyT 46 | 47 | - .env file:: 48 | 49 | In order to be able to use this Binance Spot module you will need a Binance API Key. 50 | 51 | To create a Binance API you can follow the steps in Binance page: 52 | https://www.binance.com/en/support/faq/360002502072 53 | 54 | .. code-block:: python 55 | 56 | # ----- 57 | # Binance Spot 58 | 59 | BINANCE_API_KEY = 60 | BINANCE_SECRET_KEY = 61 | 62 | BINANCE_BASE_URL=https://api.binance.com/api 63 | 64 | # ----- 65 | 66 | After that, inside your project you will need a file .env. Click to create a new file, and when the name for the file is 67 | asked type ".env" without "". 68 | 69 | Copy and paste the code block above inside your .env file and change "" with your 70 | credentials that you have created in the Binance page. 71 | 72 | Please, remember, DO NOT SHARE with any one your credentials. 73 | 74 | .. toctree:: 75 | :maxdepth: 4 76 | :caption: Contents: 77 | 78 | easyT 79 | 80 | 81 | Indices and tables 82 | ================== 83 | 84 | * :ref:`genindex` 85 | * :ref:`modindex` 86 | * :ref:`search` 87 | -------------------------------------------------------------------------------- /docs/_sources/index.rst.txt: -------------------------------------------------------------------------------- 1 | EasyT 2 | ===== 3 | 4 | Just as a reminder, I would like you to reflect about the fact that **$1.00 Dollar** might be **not** 5 | that **much** to you, but **you, an incredible person**, combined to other's **amazing Sponsors**, can **finance** this 6 | project, and it will **allows me** to constantly **improve and maintain** it, **and, I am not asking that much**. 7 | 8 | Here is my Patreon (https://www.patreon.com/joaopeuko) link. 9 | 10 | - Yeah, I would like to do that, but I do not have that kind of money. 11 | 12 | That is Ok, and, there are many ways you can help me, here is a list: 13 | 14 | - **Star** this project on GitHub. 15 | - **Share** this project. 16 | - **Open an account with Binance referral link**: 17 | - When you open an account on Binance you help me when you trade! 18 | Some of your tax paid returns for you and part goes for me. 19 | Below you can see the percentage cash back for me and for you, and you trade: 20 | You can find more information about the **Binance** referral link (https://www.binance.com/en/support/faq/88659d2ea54c40cf82a22400207ffe30) 21 | - .. list-table:: 22 | :widths: 15 15 70 23 | :header-rows: 1 24 | 25 | * - For me 26 | - For you 27 | - Link 28 | * - 10% 29 | - 10% 30 | - https://accounts.binance.com/en/register?ref=IBNF8RAW 31 | * - 15% 32 | - 15% 33 | - https://accounts.binance.com/en/register?ref=D11OJ6NP 34 | * - 20% 35 | - 0% 36 | - https://accounts.binance.com/en/register?ref=SAUNZ26X 37 | 38 | - And, there are **Ads** in all the documentations, that hopefully, will help me finance this project. 39 | 40 | Summary: 41 | ======== 42 | 43 | - How to install:: 44 | 45 | pip install easyT 46 | 47 | - .env file:: 48 | 49 | In order to be able to use this Binance Spot module you will need a Binance API Key. 50 | 51 | To create a Binance API you can follow the steps in Binance page: 52 | https://www.binance.com/en/support/faq/360002502072 53 | 54 | .. code-block:: python 55 | 56 | # ----- 57 | # Binance Spot 58 | 59 | BINANCE_API_KEY = 60 | BINANCE_SECRET_KEY = 61 | 62 | BINANCE_BASE_URL=https://api.binance.com/api 63 | 64 | # ----- 65 | 66 | After that, inside your project you will need a file .env. Click to create a new file, and when the name for the file is 67 | asked type ".env" without "". 68 | 69 | Copy and paste the code block above inside your .env file and change "" with your 70 | credentials that you have created in the Binance page. 71 | 72 | Please, remember, DO NOT SHARE with any one your credentials. 73 | 74 | .. toctree:: 75 | :maxdepth: 4 76 | :caption: Contents: 77 | 78 | easyT 79 | 80 | 81 | Indices and tables 82 | ================== 83 | 84 | * :ref:`genindex` 85 | * :ref:`modindex` 86 | * :ref:`search` 87 | -------------------------------------------------------------------------------- /docs/_static/css/badge_only.css: -------------------------------------------------------------------------------- 1 | .fa:before{-webkit-font-smoothing:antialiased}.clearfix{*zoom:1}.clearfix:after,.clearfix:before{display:table;content:""}.clearfix:after{clear:both}@font-face{font-family:FontAwesome;font-style:normal;font-weight:400;src:url(fonts/fontawesome-webfont.eot?674f50d287a8c48dc19ba404d20fe713?#iefix) format("embedded-opentype"),url(fonts/fontawesome-webfont.woff2?af7ae505a9eed503f8b8e6982036873e) format("woff2"),url(fonts/fontawesome-webfont.woff?fee66e712a8a08eef5805a46892932ad) format("woff"),url(fonts/fontawesome-webfont.ttf?b06871f281fee6b241d60582ae9369b9) format("truetype"),url(fonts/fontawesome-webfont.svg?912ec66d7572ff821749319396470bde#FontAwesome) format("svg")}.fa:before{font-family:FontAwesome;font-style:normal;font-weight:400;line-height:1}.fa:before,a .fa{text-decoration:inherit}.fa:before,a .fa,li .fa{display:inline-block}li .fa-large:before{width:1.875em}ul.fas{list-style-type:none;margin-left:2em;text-indent:-.8em}ul.fas li .fa{width:.8em}ul.fas li .fa-large:before{vertical-align:baseline}.fa-book:before,.icon-book:before{content:"\f02d"}.fa-caret-down:before,.icon-caret-down:before{content:"\f0d7"}.fa-caret-up:before,.icon-caret-up:before{content:"\f0d8"}.fa-caret-left:before,.icon-caret-left:before{content:"\f0d9"}.fa-caret-right:before,.icon-caret-right:before{content:"\f0da"}.rst-versions{position:fixed;bottom:0;left:0;width:300px;color:#fcfcfc;background:#1f1d1d;font-family:Lato,proxima-nova,Helvetica Neue,Arial,sans-serif;z-index:400}.rst-versions a{color:#2980b9;text-decoration:none}.rst-versions .rst-badge-small{display:none}.rst-versions .rst-current-version{padding:12px;background-color:#272525;display:block;text-align:right;font-size:90%;cursor:pointer;color:#27ae60}.rst-versions .rst-current-version:after{clear:both;content:"";display:block}.rst-versions .rst-current-version .fa{color:#fcfcfc}.rst-versions .rst-current-version .fa-book,.rst-versions .rst-current-version .icon-book{float:left}.rst-versions .rst-current-version.rst-out-of-date{background-color:#e74c3c;color:#fff}.rst-versions .rst-current-version.rst-active-old-version{background-color:#f1c40f;color:#000}.rst-versions.shift-up{height:auto;max-height:100%;overflow-y:scroll}.rst-versions.shift-up .rst-other-versions{display:block}.rst-versions .rst-other-versions{font-size:90%;padding:12px;color:grey;display:none}.rst-versions .rst-other-versions hr{display:block;height:1px;border:0;margin:20px 0;padding:0;border-top:1px solid #413d3d}.rst-versions .rst-other-versions dd{display:inline-block;margin:0}.rst-versions .rst-other-versions dd a{display:inline-block;padding:6px;color:#fcfcfc}.rst-versions.rst-badge{width:auto;bottom:20px;right:20px;left:auto;border:none;max-width:300px;max-height:90%}.rst-versions.rst-badge .fa-book,.rst-versions.rst-badge .icon-book{float:none;line-height:30px}.rst-versions.rst-badge.shift-up .rst-current-version{text-align:right}.rst-versions.rst-badge.shift-up .rst-current-version .fa-book,.rst-versions.rst-badge.shift-up .rst-current-version .icon-book{float:left}.rst-versions.rst-badge>.rst-current-version{width:auto;height:30px;line-height:30px;padding:0 6px;display:block;text-align:center}@media screen and (max-width:768px){.rst-versions{width:85%;display:none}.rst-versions.shift{display:block}} -------------------------------------------------------------------------------- /easyT/trade.py: -------------------------------------------------------------------------------- 1 | from dotenv import load_dotenv 2 | from supportLibEasyT.log_manager import LogManager 3 | 4 | from easyT.platforms import NoPlatformFound 5 | from easyT.platforms import Platforms 6 | 7 | 8 | def get_trade( 9 | log: LogManager, 10 | platform, 11 | symbol: str, 12 | lot: float, 13 | stop_loss: float, 14 | take_profit: float, 15 | ): 16 | """ 17 | This function return the class that responsible is responsible to handle all the trade requests 18 | 19 | It is allowed to have only one position at time per symbol, right now it is not possible to open a position and 20 | increase the size of it or to open opposite position. Open an open position will close the other direction one. 21 | 22 | Args: 23 | log: 24 | The log receives a log handler to be able to log the information 25 | 26 | platform: 27 | It is the platform that the information will be returned. 28 | 29 | symbol: 30 | It is the symbol you want to open or close or check if already have an operation opened. 31 | 32 | lot: 33 | It is how many shares you want to trade, many symbols allow fractions and others requires a 34 | certain amount. It can be 0.01, 100.0, 1000.0, 10000.0. 35 | 36 | stop_loss: 37 | It is how much you accept to lose. Example: If you buy a share for US$10.00, and you accept to lose US$1.00 38 | you set this variable at 1.00, you will be out of the operation at US$9.00 (sometimes more, somtime less, 39 | the US$9.00 is the trigger). Keep in mind that some symbols has different points metrics, US$1.00 sometimes 40 | can be 1000 points. 41 | 42 | take_profit: 43 | It is how much you accept to win. Example: If you buy a share for US$10.00, and you accept to win US$1.00 44 | you set this variable at 1.00, you will be out of the operation at US$11.00 (sometimes more, somtime less, 45 | the US$11.00 is the trigger). Keep in mind that some symbols has different points metrics, US$1.00 sometimes 46 | can be 1000 points. 47 | 48 | Returns: 49 | The class or Error message: 50 | It returns the right class that will be used or an error message in case it was not found 51 | 52 | """ 53 | log.logger.info("get_trade called") 54 | platforms = Platforms() 55 | 56 | if platform == platforms.BINANCE_SPOT: 57 | log.logger.info(f"It is returning the platform {platforms.BINANCE_SPOT}.") 58 | 59 | load_dotenv() 60 | from binanceSpotEasyT.trade import Trade 61 | 62 | return Trade(symbol, lot, stop_loss, take_profit) 63 | 64 | elif platform == platforms.METATRADER5: 65 | log.logger.info(f"It is returning the platform {platforms.METATRADER5}.") 66 | 67 | from metatrader5EasyT.trade import Trade 68 | 69 | return Trade(symbol, lot, stop_loss, take_profit) 70 | 71 | else: 72 | log.logger.error( 73 | f"The {platform} was not found, you can only use these options {platforms.__dict__.keys()}" 74 | f"of type Platform or the values {platforms.__dict__.values()} of type string, " 75 | f"both are acceptable." 76 | ) 77 | 78 | raise NoPlatformFound 79 | -------------------------------------------------------------------------------- /tests/test_manager.py: -------------------------------------------------------------------------------- 1 | import pytest 2 | from binanceSpotEasyT.initialization import Initialize 3 | from binanceSpotEasyT.rates import Rates 4 | from binanceSpotEasyT.tick import Tick 5 | from binanceSpotEasyT.timeframe import TimeFrame 6 | from binanceSpotEasyT.trade import Trade 7 | from dateutil.parser import parse 8 | 9 | from easyT.manager import ClassNotInvoked 10 | from easyT.manager import Manager 11 | 12 | 13 | class TestTrade: 14 | def test_set_platform(self): 15 | manager = Manager() 16 | manager.set_platform("binance-spot") 17 | 18 | assert manager.platform == "binance-spot" 19 | 20 | manager = Manager() 21 | manager.set_platform("metatrader5") 22 | 23 | assert manager.platform == "metatrader5" 24 | 25 | def test_allowed_to_trade(self): 26 | manager = Manager() 27 | manager.set_platform("binance-spot") 28 | 29 | with pytest.raises(ClassNotInvoked): 30 | manager.allowed_to_trade() 31 | 32 | manager.get_trade("btcusdt", 0.01, 0.00, 0.00) 33 | assert manager.allowed_to_trade() is False 34 | 35 | manager.trade._trade_allowed = True 36 | 37 | assert manager.allowed_to_trade() is True 38 | 39 | def test_trading_time(self): 40 | manager = Manager() 41 | manager.set_platform("binance-spot") 42 | 43 | assert manager.time_trade_start is None 44 | assert manager.time_trade_stop is None 45 | assert manager.time_position_close is None 46 | 47 | time_start = "09:00" 48 | time_stop = "17:23" 49 | time_close = "17:45" 50 | 51 | manager.set_trading_time(time_start, time_stop, time_close) 52 | 53 | assert manager.time_trade_start == time_start 54 | assert manager.time_trade_stop == time_stop 55 | assert manager.time_position_close == time_close 56 | 57 | def test_get_initialize(self): 58 | manager = Manager() 59 | manager.set_platform("binance-spot") 60 | initialize = manager.get_initialize() 61 | 62 | assert isinstance(initialize, Initialize) 63 | 64 | def test_get_rates(self): 65 | manager = Manager() 66 | manager.set_platform("binance-spot") 67 | rates = manager.get_rates(20, "btcusdt", "1m") 68 | 69 | assert isinstance(rates, Rates) 70 | 71 | def test_get_tick(self): 72 | manager = Manager() 73 | manager.set_platform("binance-spot") 74 | tick = manager.get_tick("btcusdt") 75 | 76 | assert isinstance(tick, Tick) 77 | 78 | def test_get_timeframe(self): 79 | manager = Manager() 80 | manager.set_platform("binance-spot") 81 | timeframe = manager.get_timeframe() 82 | 83 | assert isinstance(timeframe, TimeFrame) 84 | 85 | def test_get_trade(self): 86 | manager = Manager() 87 | manager.set_platform("binance-spot") 88 | trade = manager.get_trade("btcusdt", 0.01, 0.00, 0.00) 89 | 90 | assert isinstance(trade, Trade) 91 | 92 | def test_supervise(self): 93 | manager = Manager() 94 | manager.set_platform("binance-spot") 95 | manager.get_tick("btcusdt") 96 | 97 | assert manager.time is None 98 | manager.supervise() 99 | assert manager.time is not None 100 | 101 | manager.get_rates(20, "btcusdt", "1m") 102 | assert manager.rates.time is not None 103 | 104 | def test_time(self): 105 | manager = Manager() 106 | manager.set_platform("binance-spot") 107 | manager.get_trade("btcusdt", 0.01, 0.00, 0.00) 108 | manager.get_tick("btcusdt") 109 | 110 | result = manager.allowed_to_trade() 111 | manager.set_trading_time("10:00", "12:00", "13:00") 112 | assert result is False 113 | manager.time = parse("11:00") 114 | manager._supervise_trading_time() 115 | result = manager.allowed_to_trade() 116 | assert result is True 117 | -------------------------------------------------------------------------------- /docs/_modules/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | Overview: module code — easyT 0.0.2 documentation 7 | 8 | 9 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 |
24 | 45 | 46 |
50 | 51 |
52 |
53 |
54 |
    55 |
  • »
  • 56 |
  • Overview: module code
  • 57 |
  • 58 |
  • 59 |
60 |
61 |
62 |
63 |
64 | 65 |

All modules for which code is available

66 | 73 | 74 |
75 |
76 |
77 | 78 |
79 | 80 |
81 |

© Copyright 2022, Joao Paulo Euko.

82 |
83 | 84 | Built with Sphinx using a 85 | theme 86 | provided by Read the Docs. 87 | 88 | 89 |
90 |
91 |
92 |
93 |
94 | 99 | 100 | 101 | -------------------------------------------------------------------------------- /docs/_static/js/html5shiv-printshiv.min.js: -------------------------------------------------------------------------------- 1 | /** 2 | * @preserve HTML5 Shiv 3.7.3-pre | @afarkas @jdalton @jon_neal @rem | MIT/GPL2 Licensed 3 | */ 4 | !function(a,b){function c(a,b){var c=a.createElement("p"),d=a.getElementsByTagName("head")[0]||a.documentElement;return c.innerHTML="x",d.insertBefore(c.lastChild,d.firstChild)}function d(){var a=y.elements;return"string"==typeof a?a.split(" "):a}function e(a,b){var c=y.elements;"string"!=typeof c&&(c=c.join(" ")),"string"!=typeof a&&(a=a.join(" ")),y.elements=c+" "+a,j(b)}function f(a){var b=x[a[v]];return b||(b={},w++,a[v]=w,x[w]=b),b}function g(a,c,d){if(c||(c=b),q)return c.createElement(a);d||(d=f(c));var e;return e=d.cache[a]?d.cache[a].cloneNode():u.test(a)?(d.cache[a]=d.createElem(a)).cloneNode():d.createElem(a),!e.canHaveChildren||t.test(a)||e.tagUrn?e:d.frag.appendChild(e)}function h(a,c){if(a||(a=b),q)return a.createDocumentFragment();c=c||f(a);for(var e=c.frag.cloneNode(),g=0,h=d(),i=h.length;i>g;g++)e.createElement(h[g]);return e}function i(a,b){b.cache||(b.cache={},b.createElem=a.createElement,b.createFrag=a.createDocumentFragment,b.frag=b.createFrag()),a.createElement=function(c){return y.shivMethods?g(c,a,b):b.createElem(c)},a.createDocumentFragment=Function("h,f","return function(){var n=f.cloneNode(),c=n.createElement;h.shivMethods&&("+d().join().replace(/[\w\-:]+/g,function(a){return b.createElem(a),b.frag.createElement(a),'c("'+a+'")'})+");return n}")(y,b.frag)}function j(a){a||(a=b);var d=f(a);return!y.shivCSS||p||d.hasCSS||(d.hasCSS=!!c(a,"article,aside,dialog,figcaption,figure,footer,header,hgroup,main,nav,section{display:block}mark{background:#FF0;color:#000}template{display:none}")),q||i(a,d),a}function k(a){for(var b,c=a.getElementsByTagName("*"),e=c.length,f=RegExp("^(?:"+d().join("|")+")$","i"),g=[];e--;)b=c[e],f.test(b.nodeName)&&g.push(b.applyElement(l(b)));return g}function l(a){for(var b,c=a.attributes,d=c.length,e=a.ownerDocument.createElement(A+":"+a.nodeName);d--;)b=c[d],b.specified&&e.setAttribute(b.nodeName,b.nodeValue);return e.style.cssText=a.style.cssText,e}function m(a){for(var b,c=a.split("{"),e=c.length,f=RegExp("(^|[\\s,>+~])("+d().join("|")+")(?=[[\\s,>+~#.:]|$)","gi"),g="$1"+A+"\\:$2";e--;)b=c[e]=c[e].split("}"),b[b.length-1]=b[b.length-1].replace(f,g),c[e]=b.join("}");return c.join("{")}function n(a){for(var b=a.length;b--;)a[b].removeNode()}function o(a){function b(){clearTimeout(g._removeSheetTimer),d&&d.removeNode(!0),d=null}var d,e,g=f(a),h=a.namespaces,i=a.parentWindow;return!B||a.printShived?a:("undefined"==typeof h[A]&&h.add(A),i.attachEvent("onbeforeprint",function(){b();for(var f,g,h,i=a.styleSheets,j=[],l=i.length,n=Array(l);l--;)n[l]=i[l];for(;h=n.pop();)if(!h.disabled&&z.test(h.media)){try{f=h.imports,g=f.length}catch(o){g=0}for(l=0;g>l;l++)n.push(f[l]);try{j.push(h.cssText)}catch(o){}}j=m(j.reverse().join("")),e=k(a),d=c(a,j)}),i.attachEvent("onafterprint",function(){n(e),clearTimeout(g._removeSheetTimer),g._removeSheetTimer=setTimeout(b,500)}),a.printShived=!0,a)}var p,q,r="3.7.3",s=a.html5||{},t=/^<|^(?:button|map|select|textarea|object|iframe|option|optgroup)$/i,u=/^(?:a|b|code|div|fieldset|h1|h2|h3|h4|h5|h6|i|label|li|ol|p|q|span|strong|style|table|tbody|td|th|tr|ul)$/i,v="_html5shiv",w=0,x={};!function(){try{var a=b.createElement("a");a.innerHTML="",p="hidden"in a,q=1==a.childNodes.length||function(){b.createElement("a");var a=b.createDocumentFragment();return"undefined"==typeof a.cloneNode||"undefined"==typeof a.createDocumentFragment||"undefined"==typeof a.createElement}()}catch(c){p=!0,q=!0}}();var y={elements:s.elements||"abbr article aside audio bdi canvas data datalist details dialog figcaption figure footer header hgroup main mark meter nav output picture progress section summary template time video",version:r,shivCSS:s.shivCSS!==!1,supportsUnknownElements:q,shivMethods:s.shivMethods!==!1,type:"default",shivDocument:j,createElement:g,createDocumentFragment:h,addElements:e};a.html5=y,j(b);var z=/^$|\b(?:all|print)\b/,A="html5shiv",B=!q&&function(){var c=b.documentElement;return!("undefined"==typeof b.namespaces||"undefined"==typeof b.parentWindow||"undefined"==typeof c.applyElement||"undefined"==typeof c.removeNode||"undefined"==typeof a.attachEvent)}();y.type+=" print",y.shivPrint=o,o(b),"object"==typeof module&&module.exports&&(module.exports=y)}("undefined"!=typeof window?window:this,document); -------------------------------------------------------------------------------- /docs/conf.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 9 | 10 | 11 | 12 | 18 | conf module 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 |
40 |
41 | 42 | 43 | easyT 44 | 45 | 46 | 47 | 54 | 55 | 56 | 57 | 59 | 60 | 61 | 62 | 63 | 64 | 65 | 66 | 67 | 99 | 100 | 101 | 102 | 115 |
116 |
117 | 118 |
119 |

conf module

120 |
121 | 122 | 123 |
124 | 133 |
134 |
135 | 136 | 137 | 138 | -------------------------------------------------------------------------------- /docs/modules.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 10 | 11 | 12 | 13 | 19 | 20 | 21 | docs 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 |
43 |
44 | 45 | 46 | easyT 47 | 48 | 49 | 50 | 57 | 58 | 59 | 60 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | 70 | 102 | 103 | 104 | 105 | 118 |
119 |
120 | 121 |
122 |

docs

123 |
124 |
125 |
126 | 127 | 128 |
129 | 138 |
139 |
140 | 141 | 142 | 143 | -------------------------------------------------------------------------------- /docs/search.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 10 | 11 | 12 | 13 | 19 | 20 | Search — easyT 0.0.2 documentation 21 | 22 | 23 | 24 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 |
41 | 62 | 63 |
67 | 68 |
69 |
70 |
71 |
    72 |
  • »
  • 73 |
  • Search
  • 74 |
  • 75 |
  • 76 |
77 |
78 |
79 |
80 |
81 | 82 | 89 | 90 | 91 |
92 | 93 |
94 | 95 |
96 |
97 |
98 | 99 |
100 | 101 |
102 |

© Copyright 2022, Joao Paulo Euko.

103 |
104 | 105 | Built with Sphinx using a 106 | theme 107 | provided by Read the Docs. 108 | 109 | 110 |
111 |
112 |
113 |
114 |
115 | 120 | 123 | 124 | 125 | 126 | 127 | 128 | 129 | -------------------------------------------------------------------------------- /docs/_static/js/theme.js: -------------------------------------------------------------------------------- 1 | !function(n){var e={};function t(i){if(e[i])return e[i].exports;var o=e[i]={i:i,l:!1,exports:{}};return n[i].call(o.exports,o,o.exports,t),o.l=!0,o.exports}t.m=n,t.c=e,t.d=function(n,e,i){t.o(n,e)||Object.defineProperty(n,e,{enumerable:!0,get:i})},t.r=function(n){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(n,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(n,"__esModule",{value:!0})},t.t=function(n,e){if(1&e&&(n=t(n)),8&e)return n;if(4&e&&"object"==typeof n&&n&&n.__esModule)return n;var i=Object.create(null);if(t.r(i),Object.defineProperty(i,"default",{enumerable:!0,value:n}),2&e&&"string"!=typeof n)for(var o in n)t.d(i,o,function(e){return n[e]}.bind(null,o));return i},t.n=function(n){var e=n&&n.__esModule?function(){return n.default}:function(){return n};return t.d(e,"a",e),e},t.o=function(n,e){return Object.prototype.hasOwnProperty.call(n,e)},t.p="",t(t.s=0)}([function(n,e,t){t(1),n.exports=t(3)},function(n,e,t){(function(){var e="undefined"!=typeof window?window.jQuery:t(2);n.exports.ThemeNav={navBar:null,win:null,winScroll:!1,winResize:!1,linkScroll:!1,winPosition:0,winHeight:null,docHeight:null,isRunning:!1,enable:function(n){var t=this;void 0===n&&(n=!0),t.isRunning||(t.isRunning=!0,e((function(e){t.init(e),t.reset(),t.win.on("hashchange",t.reset),n&&t.win.on("scroll",(function(){t.linkScroll||t.winScroll||(t.winScroll=!0,requestAnimationFrame((function(){t.onScroll()})))})),t.win.on("resize",(function(){t.winResize||(t.winResize=!0,requestAnimationFrame((function(){t.onResize()})))})),t.onResize()})))},enableSticky:function(){this.enable(!0)},init:function(n){n(document);var e=this;this.navBar=n("div.wy-side-scroll:first"),this.win=n(window),n(document).on("click","[data-toggle='wy-nav-top']",(function(){n("[data-toggle='wy-nav-shift']").toggleClass("shift"),n("[data-toggle='rst-versions']").toggleClass("shift")})).on("click",".wy-menu-vertical .current ul li a",(function(){var t=n(this);n("[data-toggle='wy-nav-shift']").removeClass("shift"),n("[data-toggle='rst-versions']").toggleClass("shift"),e.toggleCurrent(t),e.hashChange()})).on("click","[data-toggle='rst-current-version']",(function(){n("[data-toggle='rst-versions']").toggleClass("shift-up")})),n("table.docutils:not(.field-list,.footnote,.citation)").wrap("
"),n("table.docutils.footnote").wrap("
"),n("table.docutils.citation").wrap("
"),n(".wy-menu-vertical ul").not(".simple").siblings("a").each((function(){var t=n(this);expand=n(''),expand.on("click",(function(n){return e.toggleCurrent(t),n.stopPropagation(),!1})),t.prepend(expand)}))},reset:function(){var n=encodeURI(window.location.hash)||"#";try{var e=$(".wy-menu-vertical"),t=e.find('[href="'+n+'"]');if(0===t.length){var i=$('.document [id="'+n.substring(1)+'"]').closest("div.section");0===(t=e.find('[href="#'+i.attr("id")+'"]')).length&&(t=e.find('[href="#"]'))}if(t.length>0){$(".wy-menu-vertical .current").removeClass("current").attr("aria-expanded","false"),t.addClass("current").attr("aria-expanded","true"),t.closest("li.toctree-l1").parent().addClass("current").attr("aria-expanded","true");for(let n=1;n<=10;n++)t.closest("li.toctree-l"+n).addClass("current").attr("aria-expanded","true");t[0].scrollIntoView()}}catch(n){console.log("Error expanding nav for anchor",n)}},onScroll:function(){this.winScroll=!1;var n=this.win.scrollTop(),e=n+this.winHeight,t=this.navBar.scrollTop()+(n-this.winPosition);n<0||e>this.docHeight||(this.navBar.scrollTop(t),this.winPosition=n)},onResize:function(){this.winResize=!1,this.winHeight=this.win.height(),this.docHeight=$(document).height()},hashChange:function(){this.linkScroll=!0,this.win.one("hashchange",(function(){this.linkScroll=!1}))},toggleCurrent:function(n){var e=n.closest("li");e.siblings("li.current").removeClass("current").attr("aria-expanded","false"),e.siblings().find("li.current").removeClass("current").attr("aria-expanded","false");var t=e.find("> ul li");t.length&&(t.removeClass("current").attr("aria-expanded","false"),e.toggleClass("current").attr("aria-expanded",(function(n,e){return"true"==e?"false":"true"})))}},"undefined"!=typeof window&&(window.SphinxRtdTheme={Navigation:n.exports.ThemeNav,StickyNav:n.exports.ThemeNav}),function(){for(var n=0,e=["ms","moz","webkit","o"],t=0;t 2 | 3 | 4 | 5 | 6 | 7 | 10 | 11 | 12 | 13 | 19 | 20 | Python Module Index — easyT 0.0.2 documentation 21 | 22 | 23 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 |
41 | 62 | 63 |
67 | 68 |
69 |
70 |
71 |
    72 |
  • »
  • 73 |
  • Python Module Index
  • 74 |
  • 75 |
  • 76 |
77 |
78 |
79 |
80 |
81 | 82 | 83 |

Python Module Index

84 | 85 |
86 | e 87 |
88 | 89 | 90 | 91 | 93 | 94 | 96 | 99 | 100 | 101 | 104 | 105 | 106 | 109 | 110 | 111 | 114 | 115 | 116 | 119 | 120 | 121 | 124 |
 
92 | e
97 | easyT 98 |
    102 | easyT.initialization 103 |
    107 | easyT.rates 108 |
    112 | easyT.tick 113 |
    117 | easyT.timeframe 118 |
    122 | easyT.trade 123 |
125 | 126 | 127 |
128 |
129 |
130 | 131 |
132 | 133 |
134 |

© Copyright 2022, Joao Paulo Euko.

135 |
136 | 137 | Built with Sphinx using a 138 | theme 139 | provided by Read the Docs. 140 | 141 | 142 |
143 |
144 |
145 |
146 |
147 | 152 | 153 | 154 | -------------------------------------------------------------------------------- /docs/easyT.manager.Manager.get_initialize.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | easyT.manager.Manager.get_initialize — easyT 0.0.2 documentation 8 | 9 | 10 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 |
25 | 46 | 47 |
51 | 52 |
53 |
54 |
55 |
    56 |
  • »
  • 57 |
  • easyT.manager.Manager.get_initialize
  • 58 |
  • 59 | View page source 60 |
  • 61 |
62 |
63 |
64 |
65 |
66 | 67 |
68 |

easyT.manager.Manager.get_initialize

69 |
70 |
71 | Manager.get_initialize()[source]
72 |

This function will use the platform attribute to return the correct class between the options in the Class 73 | Platforms.

74 |
75 |
Returns
76 |

It returns the class already invoked.

77 |
78 |
79 |

Examples

80 |
>>> from easyT.manager import Manager
 81 | >>> symbol = 'BTCUSDT'
 82 | >>> manager = Manager()
 83 | >>> manager.set_platform('binance-spot')
 84 | 'binance-spot'
 85 | >>> manager.get_initialize()
 86 | <binanceSpotEasyT.initialization.Initialize object>
 87 | 
88 |
89 |
90 | 91 |
92 | 93 | 94 |
95 |
96 |
97 | 98 |
99 | 100 |
101 |

© Copyright 2022, Joao Paulo Euko.

102 |
103 | 104 | Built with Sphinx using a 105 | theme 106 | provided by Read the Docs. 107 | 108 | 109 |
110 |
111 |
112 |
113 |
114 | 119 | 120 | 121 | -------------------------------------------------------------------------------- /docs/easyT.manager.Manager.get_timeframe.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 11 | 12 | 13 | 14 | 20 | 21 | easyT.manager.Manager.get_timeframe — easyT 0.0.2 documentation 22 | 23 | 24 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 |
39 | 60 | 61 |
65 | 66 |
67 |
68 |
69 |
    70 |
  • »
  • 71 |
  • easyT.manager.Manager.get_timeframe
  • 72 |
  • 73 | View page source 74 |
  • 75 |
76 |
77 |
78 |
79 |
80 | 81 |
82 |

easyT.manager.Manager.get_timeframe

83 |
84 |
85 | Manager.get_timeframe()[source]
86 |

This function will use the platform attribute to return the correct class between the options in the Class 87 | Platforms.

88 |
89 |
Returns
90 |

It returns the class already invoked.

91 |
92 |
93 |

Examples

94 |
>>> from easyT.manager import Manager
 95 | >>> symbol = 'BTCUSDT'
 96 | >>> manager = Manager()
 97 | >>> manager.set_platform('binance-spot')
 98 | 'binance-spot'
 99 | >>> manager.get_initialize()
100 | <binanceSpotEasyT.initialization.Initialize object>
101 | >>> manager.get_timeframe()
102 | <binanceSpotEasyT.timeframe.TimeFrame object>
103 | 
104 |
105 |
106 | 107 |
108 | 109 | 110 |
111 |
112 |
113 | 114 |
115 | 116 |
117 |

© Copyright 2022, Joao Paulo Euko.

118 |
119 | 120 | Built with Sphinx using a 121 | theme 122 | provided by Read the Docs. 123 | 124 | 125 |
126 |
127 |
128 |
129 |
130 | 135 | 136 | 137 | -------------------------------------------------------------------------------- /docs/easyT.manager.Manager.set_platform.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 11 | 12 | 13 | 14 | 20 | 21 | easyT.manager.Manager.set_platform — easyT 0.0.2 documentation 22 | 23 | 24 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 |
39 | 60 | 61 |
65 | 66 |
67 |
68 |
69 |
    70 |
  • »
  • 71 |
  • easyT.manager.Manager.set_platform
  • 72 |
  • 73 | View page source 74 |
  • 75 |
76 |
77 |
78 |
79 |
80 | 81 |
82 |

easyT.manager.Manager.set_platform

83 |
84 |
85 | Manager.set_platform(platform: str) None[source]
86 |

This function is used to set the platform to the manager, the platform will be used for many functions 87 | to know witch class to return and more.

88 |
89 |
Parameters
90 |

platform – It can be of type Platforms, or it can be a string. It is up to you to decide. The class Platform was 91 | created to reduce the errors possibilities when writing the correct name of the platform.

92 |
93 |
Returns
94 |

It returns None, but it saves the platform in an attribute.

95 |
96 |
97 |

Examples

98 |
>>> from easyT.manager import Manager
 99 | >>> symbol = 'BTCUSDT'
100 | >>> manager = Manager()
101 | >>> manager.set_platform('binance-spot')
102 | 'binance-spot'
103 | 
104 |
105 |
106 | 107 |
108 | 109 | 110 |
111 |
112 |
113 | 114 |
115 | 116 |
117 |

© Copyright 2022, Joao Paulo Euko.

118 |
119 | 120 | Built with Sphinx using a 121 | theme 122 | provided by Read the Docs. 123 | 124 | 125 |
126 |
127 |
128 |
129 |
130 | 135 | 136 | 137 | -------------------------------------------------------------------------------- /docs/easyT.manager.Manager.get_tick.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 11 | 12 | 13 | 14 | 20 | 21 | easyT.manager.Manager.get_tick — easyT 0.0.2 documentation 22 | 23 | 24 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 |
39 | 60 | 61 |
65 | 66 |
67 |
68 |
69 | 76 |
77 |
78 |
79 |
80 | 81 |
82 |

easyT.manager.Manager.get_tick

83 |
84 |
85 | Manager.get_tick(symbol: str)[source]
86 |

This function will use the platform attribute to return the correct class between the options in the Class 87 | Platforms.

88 |
89 |
Parameters
90 |

symbol – It is the symbol you want information about. You can have information about time, bid, ask, last, volume.

91 |
92 |
Returns
93 |

It returns the class already invoked.

94 |
95 |
96 |

Examples

97 |
>>> from easyT.manager import Manager
 98 | >>> symbol = 'BTCUSDT'
 99 | >>> manager = Manager()
100 | >>> manager.set_platform('binance-spot')
101 | 'binance-spot'
102 | >>> manager.get_initialize()
103 | <binanceSpotEasyT.initialization.Initialize object>
104 | >>> manager.get_tick(symbol=symbol)
105 | <binanceSpotEasyT.tick.Tick object>
106 | 
107 |
108 |
109 | 110 |
111 | 112 | 113 |
114 |
115 |
116 | 117 |
118 | 119 |
120 |

© Copyright 2022, Joao Paulo Euko.

121 |
122 | 123 | Built with Sphinx using a 124 | theme 125 | provided by Read the Docs. 126 | 127 | 128 |
129 |
130 |
131 |
132 |
133 | 138 | 139 | 140 | -------------------------------------------------------------------------------- /docs/easyT.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 11 | 12 | 13 | 14 | 20 | Summary — easyT 0.0.2 documentation 21 | 22 | 23 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 |
40 | 69 | 70 |
74 | 75 |
76 |
77 |
78 | 85 |
86 |
87 | 116 |
120 | 121 |
122 | 123 |
124 |

© Copyright 2022, Joao Paulo Euko.

125 |
126 | 127 | Built with Sphinx using a 128 | theme 129 | provided by Read the Docs. 130 | 131 | 132 |
133 |
134 |
135 |
136 |
137 | 142 | 143 | 144 | -------------------------------------------------------------------------------- /docs/easyT.manager.Manager.get_rates.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | easyT.manager.Manager.get_rates — easyT 0.0.2 documentation 8 | 9 | 10 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 |
25 | 46 | 47 |
51 | 52 |
53 |
54 |
55 | 62 |
63 |
64 |
65 |
66 | 67 |
68 |

easyT.manager.Manager.get_rates

69 |
70 |
71 | Manager.get_rates(count: int, symbol: str, timeframe: str)[source]
72 |

This function will use the platform attribute to return the correct class between the options in the Class 73 | Platforms.

74 |
75 |
Parameters
76 |
    77 |
  • symbol – The symbol you want to retrieve previous data.

  • 78 |
  • timeframe (TimeFrame) – The timeframe you want information, like 1 minute, 5 minute, 1 week.

  • 79 |
  • count – It is the amount of information in the past you want. If your time frame is 5 minutes and your count is 4, 80 | it will return 4 values containing time, open, high, low, close, tick_volume information of this past 4 81 | candlesticks.

  • 82 |
83 |
84 |
Returns
85 |

It returns the class already invoked.

86 |
87 |
88 |

Examples

89 |
>>> from easyT.manager import Manager
 90 | >>> symbol = 'BTCUSDT'
 91 | >>> manager = Manager()
 92 | >>> manager.set_platform('binance-spot')
 93 | 'binance-spot'
 94 | >>> manager.get_initialize()
 95 | <binanceSpotEasyT.initialization.Initialize object>
 96 | >>> manager.get_rates(symbol=symbol, count=20, timeframe='1m')
 97 | <binanceSpotEasyT.rates.Rates object>
 98 | 
99 |
100 |
101 | 102 |
103 | 104 | 105 |
106 |
107 |
108 | 109 |
110 | 111 |
112 |

© Copyright 2022, Joao Paulo Euko.

113 |
114 | 115 | Built with Sphinx using a 116 | theme 117 | provided by Read the Docs. 118 | 119 | 120 |
121 |
122 |
123 |
124 |
125 | 130 | 131 | 132 | -------------------------------------------------------------------------------- /docs/tick.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 11 | 12 | 13 | 14 | 20 | 21 | Tick — easyT 0.0.2 documentation 22 | 23 | 24 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 |
41 | 70 | 71 |
75 | 76 |
77 |
78 |
79 | 87 |
88 |
89 |
90 |
91 | 92 |
93 |

Tick

94 |
95 |
96 | easyT.tick.get_tick(log: supportLibEasyT.log_manager.LogManager, platform, symbol: str)[source]
97 |

This function return the class that responsible to retrieve every tick information.

98 |

Tick class is the responsible to retrieve every tick information.

99 |
100 |
Parameters
101 |

log

The log receives a log handler to be able to log the information

102 |
103 |
platform:

It is the platform that the information will be returned.

104 |
105 |
symbol:

It is the symbol you want information about. You can have information about time, bid, ask, last, volume.

106 |
107 |
108 |

109 |
110 |
Returns
111 |

It returns the right class that will be used or an error message in case it was not found

112 |
113 |
Return type
114 |

The class or Error message

115 |
116 |
117 |
118 | 119 |
120 | 121 | 122 |
123 |
124 |
128 | 129 |
130 | 131 |
132 |

© Copyright 2022, Joao Paulo Euko.

133 |
134 | 135 | Built with Sphinx using a 136 | theme 137 | provided by Read the Docs. 138 | 139 | 140 |
141 |
142 |
143 |
144 |
145 | 150 | 151 | 152 | -------------------------------------------------------------------------------- /docs/timeframe.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 11 | 12 | 13 | 14 | 20 | 21 | Timeframe — easyT 0.0.2 documentation 22 | 23 | 24 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 |
41 | 70 | 71 |
75 | 76 |
77 |
78 |
79 | 87 |
88 |
89 |
90 |
91 | 92 |
93 |

Timeframe

94 |
95 |
96 | easyT.timeframe.get_timeframe(log: supportLibEasyT.log_manager.LogManager, platform)[source]
97 |

This function return the class that responsible to hold the timeframe from different platform in a same structure.

98 |

There are incompatibilities and different patterns in writing the timeframe between platforms. 99 | This class attend to reduce the chance of errors providing the same timeframe structure between platforms.

100 |
101 |
Parameters
102 |

log

The log receives a log handler to be able to log the information

103 |
104 |
platform:

It is the platform that the information will be returned.

105 |
106 |
107 |

108 |
109 |
Returns
110 |

It returns the right class that will be used or an error message in case it was not found

111 |
112 |
Return type
113 |

The class or Error message

114 |
115 |
116 |

Examples

117 |

You can find an example of the TimeFrame usage in update_rates() function in Rates documentation

118 |
119 | 120 |
121 | 122 | 123 |
124 |
125 |
129 | 130 |
131 | 132 |
133 |

© Copyright 2022, Joao Paulo Euko.

134 |
135 | 136 | Built with Sphinx using a 137 | theme 138 | provided by Read the Docs. 139 | 140 | 141 |
142 |
143 |
144 |
145 |
146 | 151 | 152 | 153 | -------------------------------------------------------------------------------- /docs/initialization.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 10 | 11 | 12 | 13 | v 19 | 22 | 23 | 24 | 25 | 31 | 32 | Initialization — easyT 0.0.2 documentation 33 | 34 | 35 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 |
52 | 81 | 82 |
86 | 87 |
88 |
89 |
90 | 98 |
99 |
100 |
101 |
102 | 103 |
104 |

Initialization

105 |
106 |
107 | easyT.initialization.get_initialize(log: supportLibEasyT.log_manager.LogManager, platform: str)[source]
108 |

This function return the class that ensure the platform are working properly.

109 |

If it is connected on the internet, and if the symbol that you are trying to use exists or was not mistyped.

110 |
111 |
Parameters
112 |
    113 |
  • log – The log receives a log handler to be able to log the information

  • 114 |
  • platform – It is the platform that the information will be returned.

  • 115 |
116 |
117 |
Returns
118 |

It returns the right class that will be used or an error message in case it was not found

119 |
120 |
Return type
121 |

The class or Error message

122 |
123 |
124 |
125 | 126 |
127 | 128 | 129 |
130 |
131 |
135 | 136 |
137 | 138 |
139 |

© Copyright 2022, Joao Paulo Euko.

140 |
141 | 142 | Built with Sphinx using a 143 | theme 144 | provided by Read the Docs. 145 | 146 | 147 |
148 |
149 |
150 |
151 |
152 | 157 | 158 | 159 | -------------------------------------------------------------------------------- /docs/easyT.manager.Manager.allowed_to_trade.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 11 | 12 | 13 | 14 | 20 | 21 | easyT.manager.Manager.allowed_to_trade — easyT 0.0.2 documentation 22 | 23 | 24 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 |
39 | 60 | 61 |
65 | 66 |
67 |
68 |
69 |
    70 |
  • »
  • 71 |
  • easyT.manager.Manager.allowed_to_trade
  • 72 |
  • 73 | View page source 74 |
  • 75 |
76 |
77 |
78 |
79 |
80 | 81 |
82 |

easyT.manager.Manager.allowed_to_trade

83 |
84 |
85 | Manager.allowed_to_trade() bool[source]
86 |

This function return the information if your algotrading is allowed to trade or not, it is controled by the 87 | manager class.

88 |
89 |
Returns
90 |

It returns True or False, True if your algotrading is allowed to trade or False if not.

91 |
92 |
Raises
93 |

ClassNotInvoked() – The error occur when it tries tro return the trade._trade_allowed information before the trade 94 | be invoked, call the get_trade() first.

95 |
96 |
97 |

Examples

98 |
>>> from easyT.manager import Manager
 99 | >>> symbol = 'BTCUSDT'
100 | >>> manager = Manager()
101 | >>> manager.set_platform('binance-spot')
102 | 'binance-spot'
103 | >>> # The Trade class need to be invoked to test the allowed_to_trade(), if it was not done, an error will
104 | >>> # occur
105 | >>> manager.allowed_to_trade()
106 | easyT.manager.ClassNotInvoked
107 | >>> manager.get_trade(symbol=symbol, lot=0.01, stop_loss=0.00, take_profit=0.00)
108 | <binanceSpotEasyT.trade.Trade object>
109 | >>> manager.allowed_to_trade()
110 | False
111 | 
112 |
113 |
114 | 115 |
116 | 117 | 118 |
119 |
120 |
121 | 122 |
123 | 124 |
125 |

© Copyright 2022, Joao Paulo Euko.

126 |
127 | 128 | Built with Sphinx using a 129 | theme 130 | provided by Read the Docs. 131 | 132 | 133 |
134 |
135 |
136 |
137 |
138 | 143 | 144 | 145 | -------------------------------------------------------------------------------- /docs/easyT.manager.Manager.supervise.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 11 | 12 | 13 | 14 | 20 | 21 | easyT.manager.Manager.supervise — easyT 0.0.2 documentation 22 | 23 | 24 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 |
39 | 60 | 61 |
65 | 66 |
67 |
68 |
69 | 76 |
77 |
78 |
79 |
80 | 81 |
82 |

easyT.manager.Manager.supervise

83 |
84 |
85 | Manager.supervise()[source]
86 |
87 |

These functions should be calling inside the while True looping, it is responsible to updates information like 88 | if the AlgoTrading is allowed to trade, if it needs to close the position, and to update the tick 89 | and the rates’ information.

90 |
91 |
Returns:

It updates attribute values.

92 |
93 |
94 |
95 |

Examples

96 |
>>> from easyT.manager import Manager
 97 | >>> symbol = 'BTCUSDT'
 98 | >>> manager = Manager()
 99 | >>> manager.set_platform('binance-spot')
100 | 'binance-spot'
101 | >>> manager.get_initialize()
102 | <binanceSpotEasyT.initialization.Initialize object>
103 | >>> # It is important to know that the supervise needs the time set.
104 | >>> manager.supervise()
105 | TypeError: '<=' not supported between instances of 'datetime.datetime' and 'NoneType'
106 | >>> manager.set_trading_time(time_trade_start='09:00', time_trade_stop='17:30', time_position_close='17:45')
107 | >>> # It is important to know that it do not only need the trading time, but also, it needs the Tick() class
108 | >>> # to retrieve the time!
109 | >>> manager.get_tick(symbol=symbol)
110 | <binanceSpotEasyT.tick.Tick object>
111 | >>> manager.supervise()
112 | 
113 |
114 |
115 | 116 |
117 | 118 | 119 |
120 |
121 |
122 | 123 |
124 | 125 |
126 |

© Copyright 2022, Joao Paulo Euko.

127 |
128 | 129 | Built with Sphinx using a 130 | theme 131 | provided by Read the Docs. 132 | 133 | 134 |
135 |
136 |
137 |
138 |
139 | 144 | 145 | 146 | -------------------------------------------------------------------------------- /docs/rates.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 11 | 12 | 13 | 14 | 20 | 21 | Rates — easyT 0.0.2 documentation 22 | 23 | 24 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 |
41 | 70 | 71 |
75 | 76 |
77 |
78 |
79 | 87 |
88 |
89 |
90 |
91 | 92 |
93 |

Rates

94 |
95 |
96 | easyT.rates.get_rates(log: supportLibEasyT.log_manager.LogManager, platform: str, count: int, symbol: str, timeframe)[source]
97 |

The function get_rates is used to select which rates will be used taking in consideration the platform.

98 |

The Rates class is responsible to retrieve a certain amount of previous data.

99 |
100 |
Parameters
101 |

log

The log receives a log handler to be able to log the information

102 |
103 |
platform:

It is the platform that the information will be returned.

104 |
105 |
symbol:

The symbol you want to retrieve previous data.

106 |
107 |
timeframe (TimeFrame):

The timeframe you want information, like 1 minute, 5 minute, 1 week.

108 |
109 |
count:

It is the amount of information in the past you want. If your time frame is 5 minutes and your count is 4, 110 | it will return 4 values containing time, open, high, low, close, tick_volume information of this past 4 111 | candlesticks.

112 |
113 |
114 |

115 |
116 |
Returns
117 |

It returns the right class that will be used or an error message in case it was not found

118 |
119 |
Return type
120 |

The class or Error message

121 |
122 |
123 |
124 | 125 |
126 | 127 | 128 |
129 |
130 |
134 | 135 |
136 | 137 |
138 |

© Copyright 2022, Joao Paulo Euko.

139 |
140 | 141 | Built with Sphinx using a 142 | theme 143 | provided by Read the Docs. 144 | 145 | 146 |
147 |
148 |
149 |
150 |
151 | 156 | 157 | 158 | -------------------------------------------------------------------------------- /docs/manager/easyT.manager.Manager.get_initialize.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | easyT.manager.Manager.get_initialize — easyT 0.0.2 documentation 8 | 9 | 10 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 |
27 | 65 | 66 |
70 | 71 |
72 |
73 |
74 | 83 |
84 |
85 |
86 |
87 | 88 |
89 |

easyT.manager.Manager.get_initialize

90 |
91 |
92 | Manager.get_initialize()[source]
93 |

This function will use the platform attribute to return the correct class between the options in the Class 94 | Platforms.

95 |
96 |
Returns
97 |

It returns the class already invoked.

98 |
99 |
100 |

Examples

101 |
>>> from easyT.manager import Manager
102 | >>> symbol = 'BTCUSDT'
103 | >>> manager = Manager()
104 | >>> manager.set_platform('binance-spot')
105 | 'binance-spot'
106 | >>> manager.get_initialize()
107 | <binanceSpotEasyT.initialization.Initialize object>
108 | 
109 |
110 |
111 | 112 |
113 | 114 | 115 |
116 |
117 |
121 | 122 |
123 | 124 |
125 |

© Copyright 2022, Joao Paulo Euko.

126 |
127 | 128 | Built with Sphinx using a 129 | theme 130 | provided by Read the Docs. 131 | 132 | 133 |
134 |
135 |
136 |
137 |
138 | 143 | 144 | 145 | --------------------------------------------------------------------------------