Strategy · Pine Script v5 · Own pane

Pair Trade: Inputs

by PythonForForex

This strategy executes trades on the current chart based on daily percentage price changes of an external ticker (GOOG).

View on GitHub

GitHub stars64on the repository
Pine versionv5runs as is
Lines of code21
Settings2inputs
LicenceNone stated
Last update4 years ago29 May 2022

Add It to Your TradingView Chart

  1. 1Copy the scriptPress Copy script above. It reads the file straight from GitHub.
  2. 2Open the Pine EditorOpen a TradingView chart and choose Pine Editor at the bottom of the screen.
  3. 3Paste over the templateCreate a new strategy, select all of the template text and paste. Press Save and give it a name.
  4. 4Add it to the chartPress Add to chart. The trades and results appear in the Strategy Tester tab; adjust the settings with the gear icon.

Source Code

The code stays on GitHub. The author has not published this script under an open licence, so ForexR does not show its code. Copy script reads the file straight from GitHub into your clipboard, so you can still try it on your own chart. Ask the author before reusing the code anywhere else.

Overview

Pair Trade: Inputs fetches the daily open and close prices of the reference symbol to compute its intraday price change ratio. When the reference asset drops below a set percentage threshold, the strategy enters a long position. When the reference asset rises above the upper threshold, it enters a short position. The price change ratio is plotted in a separate pane. The strategy does not include stop-loss or profit-target exit rules.

Details

Published by

PythonForForex on GitHub

Type

Strategy, Pine Script v5

Draws

Separate pane below the chart

Category

Mean reversion

Markets

Stocks

Timeframes

Any timeframe

Risk Notes

  • The strategy enters trades without a stop loss

Topics

pinescripttradingview

Settings

The inputs you can change from the gear icon on the chart. Defaults are the author's.

SettingTypeDefaultVariable
% Change for short entriesint5longTrigger
% Change for long entriesint5shortTrigger
Third-party code. ForexR did not write, test or endorse this script, and the summary above was generated automatically from its code and README. Indicators describe the past, and a strategy's backtest can look better than live trading, especially when a script repaints. Check it in the Strategy Tester and on a demo account before you rely on it.

Similar Pine Scripts

This strategy combines Larry Williams' Vix Fix synthetic volatility indicator with Bollinger Bands. It calculates standard and inverted Williams Vix Fix metrics, displaying them as histogram columns with standard deviation bands in a separate pane. Long entrie

Strategy v4 Volatility & bandsOscillators & momentum
Updated 2 months ago · None stated GitHub repository of Williams Vix Fix Strategy [Alorse]

Quick Flip Scalper

by TradersPost
218 stars

This strategy executes an opening-range liquidity fade based on the first candle of a session. It qualifies the opening range against the daily ATR to confirm manipulation or liquidity spikes. If qualified, it searches for reversal candlestick patterns, such a

Strategy v6 Sessions & timeCandlestick patterns
Updated 3 months ago · None stated GitHub repository of Quick Flip Scalper

10PreBuyer

by hasnocool
106 stars

10PreBuyer is a dip-buying strategy that submits limit orders below recent price action using a discounted Hull Moving Average (HMA). It calculates the highest HMA value of high prices over a selected period, multiplied by a percentage discount factor, and pla

Strategy v4 Moving averagesMean reversion
Updated 2 years ago · GPL-3.0 GitHub repository of 10PreBuyer

Greeffer BB Strategy

by SammyEnigma
18 stars

This strategy fades Bollinger Band extremes using the close. It enters short when price crosses above the upper band and the 14-period RSI is above 70, and enters long when price crosses below the lower band and RSI is below 30. It closes half of an open short

Strategy v4 Volatility & bandsOscillators & momentum
Updated 6 years ago · None stated GitHub repository of Greeffer BB Strategy

Williams %R Reversal - Eterna MCP

by EternaHybridExchange
9 stars

This strategy tracks the Williams %R oscillator to trade mean-reversion bounces from overbought and oversold extremes. It opens long or short positions when a reversal signal occurs alongside confirming price direction, while generating JSON-formatted alert pa

Strategy v5 Oscillators & momentumMean reversion
Updated 7 months ago · MIT GitHub repository of Williams %R Reversal - Eterna MCP

More strategys

Trade Your Charts With a Regulated Broker

Compare brokers that connect to TradingView, with spreads, minimum deposits and leverage side by side.

Compare brokers