hkorange2007

trading YM based on pair trading

This is inspired by some online free webinars. Didn't pay for the strategy/ course. I just figured it out myself. So there might be problem with this strategy.

Theory: It is based on something called cointegrated. Cointegration means the difference between 2 securities are stable in long term. When the difference is bigger / smaller than normal, then there is space to make profit. You can use some tests to check if they are cointegration. I don't think YM and NQ are strictly cointegrated. I used other platform to test the cointegration. They are not cointegrated. There are multiple ways to do pair trading. I use "Y = A - B * (A /B)" to do this. The back test on tradingview can only trade one security. This is not pair trading in this backtest. But only do long and short based on the theory of pair trading. The max drawdown is huge. You should be careful before doing anything with this strategy.

Welcome to give some advice on improvement.



Скрипт с открытым кодом

В истинном духе TradingView автор этого скрипта опубликовал его с открытым исходным кодом, чтобы трейдеры могли понять, как он работает, и проверить на практике. Вы можете воспользоваться им бесплатно, но повторное использование этого кода в публикации регулируется Правилами поведения. Вы можете добавить этот скрипт в избранное и использовать его на графике.

Отказ от ответственности

Все виды контента, которые вы можете увидеть на TradingView, не являются финансовыми, инвестиционными, торговыми или любыми другими рекомендациями. Мы не предоставляем советы по покупке и продаже активов. Подробнее — в Условиях использования TradingView.

Хотите использовать этот скрипт на графике?