OPEN-SOURCE SCRIPT

Long Term Long/Short Strategy (Pair Trading)

8 628
Longing or shorting an asset ratio depending on long term trend.

Long term trend is defined by crossing of an asset or index and its SMA.

Input values:
* trend asset
* SMA configuration (periods, resolution)
* strategy: long only, long/short, short only

Disclaimer

The information and publications are not meant to be, and do not constitute, financial, investment, trading, or other types of advice or recommendations supplied or endorsed by TradingView. Read more in the Terms of Use.