Strategy · Pine Script v4 · Own pane

BIAS

by kat3samsin

This multi-indicator strategy combines the Relative Strength Index (RSI), Choppiness Index, Stochastic Oscillator, and an Arnaud Legoux Moving Average (ALMA).

View on GitHub

GitHub stars2on the repository
Pine versionv4older, still runs
Lines of code55
Settings8inputs
LicenceMIT
Last update5 years ago17 Mar 2021

Add It to Your TradingView Chart

  1. 1Copy the scriptPress Copy script above, or the copy button on the code below.
  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

55 lines of Pine Script v4 from scripts/bias.pine, published under MIT. Keep the author's credit and licence lines when you reuse it.

bias.pine
// This source code is subject to the terms of the Mozilla Public License 2.0 at https://mozilla.org/MPL/2.0/
// © kat3samsin
//Criteria: STOCH > RSI(14) and RSI(14) crossed above CHOP(28)
//Buy 1: if STOCH is up, RSI(14) crossover CHOP(28)
//Buy 2: if STOCH is down wait for STOCH crossover(k, d)
//Sell: close < ALMA15

//@version=4
strategy("BIAS", overlay=false, process_orders_on_close=true)

//ALMA
source = close
windowsize = input(title="ALMA", type=input.integer, defval=15)
ALMAoffset = input(title="ALMA Offset", type=input.float, defval=0.85)
sigma = input(title="Sigma", type=input.float, defval=6)
ALMA = alma(source, windowsize, ALMAoffset, sigma)

// chop28
length = input(28, minval=1)
ci = 100 * log10(sum(atr(1), length) / (highest(length) - lowest(length))) / log10(length)
//offset = input(0, "Offset", type = input.integer, minval = -500, maxval = 500)

//stochastics
periodK = input(14, title="Stoch K", minval=1)
periodD = input(3, title="Stoch D", minval=1)
smoothK = input(3, title="Stoch Smooth", minval=1)
k = sma(stoch(close, high, low, periodK), smoothK)
d = sma(k, periodD)
 
//RSI
_rsi = rsi(close, 14)

_stochIsMoreThanRSI = k > _rsi
_barsSinceRSICrossoverCI = barssince(crossover(_rsi, ci))
_barsSinceStochMorethanRSI = barssince(_stochIsMoreThanRSI)
_period = input(5, title="RSI/CI Lookback period", minval=3)

//conditions
BIAScondition1 = _stochIsMoreThanRSI and crossover(_rsi, ci)
BIAScondition2 = _stochIsMoreThanRSI and crossover(k, d) and (_barsSinceRSICrossoverCI < _period and _barsSinceRSICrossoverCI <= _barsSinceStochMorethanRSI)
BIASExit = close < ALMA

//entry/exit
strategy.entry(id="BIAS1", long = true, qty = strategy.equity/close, when = BIAScondition1)
strategy.close(id="BIAS1", when = BIASExit)
strategy.entry(id="BIAS2", long = true, qty = strategy.equity/close, when = BIAScondition2)
strategy.close(id="BIAS2", when = BIASExit)

plotchar(BIAScondition1, "BIAS1", "1️⃣", location.top)
plotchar(BIAScondition2, "BIAS2", "2️⃣", location.top)

plot(_rsi, color=color.green, linewidth=2)
plot(ci, color=color.red, linewidth=2)
plot(k, color=color.blue)
plot(d, color=color.orange)

Overview

BIAS plots RSI, Stochastic, and Choppiness lines in a separate pane. Long entries trigger when RSI crosses above the Choppiness Index while Stochastic K is higher than RSI, or when Stochastic lines cross following a recent RSI cross. Trades exit when the close falls below the ALMA. Main settings adjust moving average offsets, stochastic lookbacks, and signal windows. The strategy lacks pre-defined stop-loss or take-profit orders.

Details

Published by

kat3samsin on GitHub

Type

Strategy, Pine Script v4

Draws

Separate pane below the chart

Category

Oscillators & momentum, Moving averages, Volatility & bands

Markets

Any symbol

Timeframes

Any timeframe

Risk Notes

  • The strategy enters trades without a stop loss

Settings

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

SettingTypeDefaultVariable
ALMAint15windowsize
ALMA Offsetfloat0.85ALMAoffset
Sigmafloat6sigma
lengthint28length
Stoch Kint14periodK
Stoch Dint3periodD
Stoch Smoothint3smoothK
RSI/CI Lookback periodint5_period
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

106 stars

This strategy captures strong bullish momentum by combining a 200-period SMA baseline, a custom Bollinger Band, the True Strength Index (TSI) smoothed with WMAs, and the ADX trend strength indicator. It initiates long positions when price is above the 200 SMA,

Strategy v4 TrendOscillators & momentum
Updated 2 years ago · GPL-3.0 GitHub repository of ADX_TSI_Bol Band Trend Chaser

EMA Ribbon MACD

by iamrichardD
57 stars

This strategy combines an EMA ribbon with MACD confirmation and plots in a separate pane. It enters when ribbon alignment, optional MACD zero or signal crosses, volume, smart-money, and multi-timeframe filters agree, then exits with percentage stop loss and ta

Strategy v6 TrendMoving averages
Updated 1 year ago · Apache-2.0 GitHub repository of EMA Ribbon MACD
25 stars

This Pine Script strategy calculates Bayesian probabilities of price breaking up or down relative to Bollinger Bands and a Simple Moving Average. It plots these breakout and breakdown probability lines as oscillators in a separate pane. Long entries trigger wh

Strategy v4 Oscillators & momentumVolatility & bands
Updated 6 years ago · None stated GitHub repository of Bayesian BBSMA Oscillator Strategy

Greeffer BB Strategy

by SammyEnigma
18 stars

This strategy combines Bollinger Bands, Bollinger Band Width, and the Relative Strength Index (RSI) for mean-reversion trades. It enters long when price crosses below the lower band with oversold RSI, or when band width contracts under low volatility. Short en

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

AwesomeADX

by koradiyakaushal
12 stars

AwesomeADX is a Pine Script v4 strategy that combines an Awesome Oscillator, ADX directional movement, and Bollinger percent B with an optional four-length moving-average trend filter. It sizes each position as a percentage of equity and can limit trades to a

Strategy v4 Oscillators & momentumMoving averages
Updated 5 years ago · MIT GitHub repository of AwesomeADX

Alper

by avatar-lavventura
2 stars

Alper is a multi-indicator trading strategy combining a WaveTrend oscillator, RSI, and Squeeze Momentum logic based on Bollinger Bands and Keltner Channels. Operating within a user-defined backtest time window, it plots WaveTrend lines, overbought and oversold

Strategy v4 Oscillators & momentumVolatility & bands
Updated 7 months ago · None stated GitHub repository of Alper

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