{"id":22938204,"url":"https://github.com/hootnot/oandapyv20-examples","last_synced_at":"2025-07-20T21:32:52.915Z","repository":{"id":61855898,"uuid":"74979313","full_name":"hootnot/oandapyV20-examples","owner":"hootnot","description":"Examples demonstrating the use of oandapyV20 (oanda-api-v20)","archived":false,"fork":false,"pushed_at":"2021-01-24T17:25:01.000Z","size":257,"stargazers_count":147,"open_issues_count":0,"forks_count":66,"subscribers_count":20,"default_branch":"master","last_synced_at":"2025-04-01T09:36:49.405Z","etag":null,"topics":["finance","forex","oandapyv20","trading","trading-bot","v20"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/hootnot.png","metadata":{"files":{"readme":"README.rst","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2016-11-28T14:11:39.000Z","updated_at":"2024-08-15T11:26:00.000Z","dependencies_parsed_at":"2022-10-22T12:00:15.799Z","dependency_job_id":null,"html_url":"https://github.com/hootnot/oandapyV20-examples","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/hootnot/oandapyV20-examples","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hootnot%2FoandapyV20-examples","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hootnot%2FoandapyV20-examples/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hootnot%2FoandapyV20-examples/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hootnot%2FoandapyV20-examples/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/hootnot","download_url":"https://codeload.github.com/hootnot/oandapyV20-examples/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hootnot%2FoandapyV20-examples/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":266204514,"owners_count":23892362,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["finance","forex","oandapyv20","trading","trading-bot","v20"],"created_at":"2024-12-14T12:16:27.659Z","updated_at":"2025-07-20T21:32:52.870Z","avatar_url":"https://github.com/hootnot.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"oandapyV20 - examples\n=====================\n\nThis repo contains a number of examples to demonstrate how to\nuse OANDA's REST-V20 API with the oandapyV20_ Python API-wrapper.\n\n.. _oandapyV20: https://github.com/hootnot/oanda-api-v20\n.. _pydantic: https://github.com/samuelcolvin/pydantic\n\nSetup\n-----\n\nInstall\n~~~~~~~\n\nClone the repository:\n\n.. code-block:: bash\n\n   $ git clone https://github.com/hootnot/oandapyV20-examples\n\n\nInstall *oandapyV20* and other pypi-packages the examples depend on. Maybe\nyou want to do this from a *virtual environment*.\n\n.. code-block:: bash\n\n   $ pip install -r requirements.txt\n\n\n\nToken\n~~~~~\n\nAccess to the OANDA V20 REST-API requires a token. If you do not have a token\nyou can obtain one. Check developer.oanda.com_ for details.\nEdit the file *token.txt*  and put the token in it.\n\n.. _developer.oanda.com: http://developer.oanda.com\n\nAccountID\n~~~~~~~~~\n\nIf you have a token, you have an account. Edit the file *account.txt* and\nput the **accountID** in it. Verify that it is your **V20** accountID!\n\n**Warning**\n~~~~~~~~~~~\n\n   Make sure you have made the setup based on a **practice** account !\n   Leveraged trading is high risk. Losses can exceed investment!\n\n\n\nExamples\n--------\n\nAll examples can be run from the cloned repo directory as:\n\n.. code-block:: bash\n\n   $ python src/\u003cexample.py\u003e\n\n.. |CONSOLE_APP| image:: oanda_console.gif\n   :width: 500px\n\n\n=============================  =============\nSource                         Description\n=============================  =============\n**Account**\n`src/instruments_list.py`      Get list of tradable instruments for account\n**Streams**\n`src/streaming_prices.py`      Simple streaming prices using pydantic_ to process records\n`src/streaming_trans.py`       Simple streaming transactions\n`src/concurrent_streaming.py`  Demonstrate concurrent streaming of prices and events along with the polling of account changes based on gevent greenlets\n**Data**\n`src/candle-data.py`           Retrieve candle data\n**Orders**\n`src/market_order.py`          Placing market orders / logging\n`src/market_order_request.py`  Placing market orders using contrib.requests / logging\n`src/contrib_mo_tp_sl.py`      Placing market order with takeprofit on-fill and stoploss on-fill\n**Console**\n`src/oanda_console.py`         Console application showing realtime tickdata (Linux/Unix only / python 3 only)\n                               |CONSOLE_APP|\n**Auto Trading**\n`src/simplebot.py`             Simple trading bot based on a moving-average crossover. The bot gets initialized by retrieving the longest MA period of candles. After that new records are fabricated from the stream. When there is a state change an order is placed with a takeprofit and a stoploss order with it. \n                               The positions can be traced with the `src/oanda_console` application.\n=============================  =============\n\nAbout this software\n-------------------\nThe *oanda-api-v20* / *oandapyV20* software is a personal project.\nI have no prior or existing relationship with OANDA.\n\nIf you have any questions regarding this software, please take a look at\nthe documentation first:\n\n * oandapyV20 : http://oanda-api-v20.readthedocs.io/en/latest/?badge=latest\n * OANDA developer docs : http://developer.oanda.com\n * examples : https://github.com/hootnot/oandapyV20-examples\n * Github: https://github.com/hootnot/oanda-api-v20 check the open and closed issues\n\nIf you still have questions/issues you can open an *issue* on Gitub: https://github.com/hootnot/oanda-api-v20\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhootnot%2Foandapyv20-examples","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fhootnot%2Foandapyv20-examples","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhootnot%2Foandapyv20-examples/lists"}