Heptet
Pair Trading - Reinforcement Learning - with Oanda Trading API
Install / Use
npx skills add 5ymph0en1x/HeptetInstalls into whichever agent you are using.
README
Pair Trading - Reinforcement Learning - with Oanda Trading API
<p align="center"> <img width="600" src="Structure.PNG"> </p> <p align="justify">A TensorFlow implemention in Reinforcement Learning and Pairs Trading. The current status of the project covers implementation of RL in cointegration pair trading based on 1-minute forex market data. For the Reinforcement Learning here we use the N-armed bandit approach. The code is expandable so you can plug any strategies, data API or machine learning algorithms into the tool if you follow the style.
Guidance
- Medium - The corresponding article for this project.
Data Source
- HistData - Run 'python formater_piphist.py' (EXAMPLE/Symphoenix) after modifying 'symbol = USDCAD' to match the one you want to retrieve data from (covers 2019).
Examples
See the folder EXAMPLE for more details. Please initiate your own virtual environment and move the scripts you want to the root folder before running them.
Idea of Usage
Start by retrieving data for EURJPY and GBPJPY by running 'formater_piphist.py' with the correct 'symbol' setting. Train a model with 'Training_Model.py' after editing the first two lines of the 'Read prices' section (lines 23-24) to match the data you have just downloaded. Edit 'CONFIG/config_trading.yml' with your personal ids and tokens. Start trading the 2 pairs by running 'Trading_Model.py'. That's all !
Going Deeper...
- You can download multiple pairs historical data and run 'Analysis.py' (EXAMPLE/Symphoenix) to explore correlation and cointegration values and graphs.
- By running 'Training_Model.py', you get a backtest result at the end which allows tuning strategies.
Disclaimer
The article and the relevant codes and content are purely informative and none of the information provided constitutes any recommendation regarding any security, transaction or investment strategy for any specific person. The implementation described in the article could be risky and the market condition could be volatile and differ from the period covered above. All trading strategies and tools are implemented at the users’ own risk.
Related Skills
mcp
Use the `mcp_perplexity-ask_perplexity_search` tools to answer questions. You should use this instead of the `web_search` tool because it is a lot more accurate.
practical-power-systems-synthesis
This skill enables synthesis in the domain of power-systems (engineering). It represents research-level-level expertise and is designed for production use in research, industry, and educational contexts. Use this skill when you need to perform synthesis operations related to power-systems.
semi-supervised-optogenetics-testing
This skill enables testing in the domain of optogenetics (neuroscience). It represents intermediate-level expertise and is designed for production use in research, industry, and educational contexts. Use this skill when you need to perform testing operations related to optogenetics.
data-mining-interpretation-fundamental
This skill enables interpretation in the domain of data-mining (data-science). It represents fundamental-level expertise and is designed for production use in research, industry, and educational contexts. Use this skill when you need to perform interpretation operations related to data-mining.
