Strategy · Pine Script v6 · Own pane

Contra v6

by jayadevrana

This Pine Script strategy fades exhaustion moves into the Pivot Point SuperTrend band.

View on GitHub

GitHub stars1on the repository
Pine versionv6current
Lines of code278
Settings27inputs
LicenceCustom licence
Last update2 months ago7 Aug 2026

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

Contra v6 buys when price stretches down into the band and sells when price stretches up, using touch, reversal or both triggers. Entries support pyramiding with configurable steps in points, percent or ATR and a max pyramid count. Targets, stop losses and trailing stops can be set in points or percent. Filters include opening range breakout, ADX strength and optional ATR or EMA conditions. It plots the Pivot SuperTrend, entry markers and other diagnostics in a separate pane below the price chart. Notable limits are that it uses fixed position sizing without automatic stop loss and can pyramid multiple times in the same direction.

Details

Published by

jayadevrana on GitHub

Draws

Separate pane below the chart

Markets

Any symbol

Timeframes

Any timeframe

Risk Notes

  • The strategy can add several entries in the same direction

Topics

mean-reversionpine-script-v6pinescriptpivot-pointssupertrendtradingview

Settings

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

SettingTypeDefaultVariable
Enable BUY (long fade)booltrueenLong
Enable SELL (short fade)booltrueenShort
Fire signal onstringBothtrigMode
Qty per entry (first + each pyramid)float1.0baseQty
Pivot point periodint2ppPrd
ATR factorfloat3.ppFactor
ATR periodint10ppAtrLen
Use ORB filterbooltrueuseOrb
ORB length (first N candles of session)int3orbBars
DI lengthint14diLen
ADX smoothingint14adxSm
Min ADX to enterfloat20minAdx
Show all 27 settings
SettingTypeDefaultVariable
Use ATR filterboolfalseuseAtr
ATR lengthint14atrLen
ATR must be greater thanfloat10atrThr
Use EMA filterbooltrueuseEma
EMA lengthint50emaLen
Number of pyramids after first entryint2numPyr
Pyramid step typestringPointspyrType
Pyramid step (in unit above)float20pyrVal
Target typestringPointstgtMode
Target valuefloat60tgtVal
SL typestringPointsslMode
SL valuefloat40slVal
Trailing typestringOfftrlMode
Trailing distancefloat30trlVal
Plot ATR (own scale)boolfalseshowAtrP
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

Buy The Dip

by hasnocool
106 stars

Calculates a historical dip level based on the lowest low over a specified lookback period. It enters a long strategy position when the current bar close falls below the previous dip level. Positions are managed with take profit and stop loss exits placed at f

Strategy v4 Mean reversionVolatility & bands
Updated 2 years ago · GPL-3.0 GitHub repository of Buy The Dip
3 stars

This strategy combines two sets of Bollinger Bands with a Laguerre RSI oscillator plotted on the price chart. It generates buy and sell signals when price touches the upper or lower bands or zones. The strategy allows enabling or disabling entries and includes

Strategy v5 Mean reversionVolatility & bands
Updated 5 months ago · None stated GitHub repository of BB + LaRSI Strategy

DP2

by grinay
3 stars

DP2 is a price-chart strategy that looks for a short dump between the chosen from and to prices, optionally requiring a break of a multi-day low while ignoring moves larger than a dump cap. It can enter through classic, two-close, break-and-retest, ATR-stop, a

Strategy v6 Mean reversionVolatility & bands
Updated 8 months ago · MIT GitHub repository of DP2

3C QFL Mean Reversal

by wynnforthework
2 stars

This strategy implements a Quickfinger Luc mean-reversion trading model tailored for automated execution. It calculates base support levels and volume moving averages across timeframes to identify sharp price dips below established base levels. The script incl

Strategy v5 Mean reversionSupport & resistance Repaints
Updated 1 year ago · None stated GitHub repository of 3C QFL Mean Reversal

Bollinger Bands

by Studentcodee
1 stars

This strategy plots Bollinger Bands directly on the price chart. It computes the middle band as the simple moving average of the close price over the input length and the upper and lower bands by multiplying the standard deviation by the multiplier and adding

Strategy v6 Volatility & bandsMoving averages
Updated 1 year ago · None stated GitHub repository of Bollinger Bands

ES Professional Fade

by knectardev
1 stars

The ES Professional Fade strategy trades overnight price gaps during regular trading hours on intraday charts. It establishes an opening range and enters counter-trend positions when price fails near overnight extremes. Positions target the previous day's clos

Strategy v5 Mean reversionSessions & time
Updated 9 months ago · None stated GitHub repository of ES Professional Fade

More Mean reversion scripts

Related on ForexR

Trade Your Charts With a Regulated Broker

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

Compare brokers