This is a simple project to demonstrate how does pairs trading works in daily timeframe
SET50 daily data from retrived from yahooquery
package
Pairs trading is a market neutral trading strategy enabling traders to profit from virtually any market conditions: uptrend, downtrend, or sideways movement.
This strategy is categorized as a statistical arbitrage and convergence trading strategy.
The strategy monitors performance of two historically correlated securities. When the correlation between the two securities temporarily weakens, i.e. one stock moves up while the other moves down, the pairs trade would be to short the outperforming stock and to long the underperforming one, betting that the “spread” between the two would eventually converge.
The divergence within a pair can be caused by temporary supply/demand changes, large buy/sell orders for one security, reaction for important news about one of the companies, and so on.
Note: this description is mostly generated by Github Copilot.# statarb
- Install streamlit
pip install streamlit
- Run streamlit app
streamlit run ./streamlit/pairs_trade_app.py