Strategy · Pine Script v4 · On the chart

Advanced OutSide Forex strategy

by hasnocool· code credited to exlux99

This strategy enters long on an outside bar when the candle is bullish, the Klinger Volume Oscillator is positive, and price is above a Hull moving average.

View on GitHub

Repaints

GitHub stars106on the repository
Pine versionv4older, still runs
Lines of code23
Settings6inputs
LicenceGPL-3.0
Last update2 years ago18 Sep 2024

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

23 lines of Pine Script v4 from Advanced OutSide with HMA and Klinger Forex Swing strategy.pine, published under GPL-3.0. Keep the author's credit and licence lines when you reuse it.

Advanced OutSide with HMA and Klinger Forex Swing strategy.pine
// This source code is subject to the terms of the Mozilla Public License 2.0 at https://mozilla.org/MPL/2.0/
// © exlux99
//@version=4
strategy("Advanced OutSide Forex strategy", overlay = true, default_qty_type = strategy.percent_of_equity, default_qty_value = 100, calc_on_every_tick = true, commission_type = strategy.commission.percent, commission_value = 0.0)
sv = change(hlc3) >= 0 ? volume : -volume
kvo = ema(sv, 34) - ema(sv, 55)
sig = ema(kvo, 13)
length = input(title="Length", type=input.integer, defval=27)
src = input(close, title="Source")
lsma = hma(src, length)
if (high > high[1] and low < low[1])
    if (close > open and kvo>0 and lsma<close)
        strategy.entry("long", strategy.long, comment="long")
if (high < high[1] and low > low[1])        
    if (close < open and kvo<0 and lsma>close)
        strategy.entry("short", strategy.short, comment="short")
tplong=input(0.006, step=0.001, title="Take profit % for long")
sllong=input(0.012, step=0.001, title="Stop loss % for long")
tpshort=input(0.0075, step=0.001, title="Take profit % for short")
slshort=input(0.015, step=0.001, title="Stop loss % for short")
strategy.exit("short_tp/sl", "long", profit=close * tplong / syminfo.mintick, loss=close * sllong / syminfo.mintick, comment='LONG EXIT',  alert_message = 'closeshort')
strategy.exit("short_tp/sl", "short", profit=close * tpshort / syminfo.mintick, loss=close * slshort / syminfo.mintick, comment='SHORT EXIT',  alert_message = 'closeshort')
Expand (30 lines)

Overview

Advanced OutSide Forex strategy enters short on an inside bar when the candle is bearish, the oscillator is negative, and price is below that average. Exits use separate percentage take-profit and stop-loss levels for long and short trades, with position size set to full equity. Length, source, and those exit percentages are adjustable. It draws on the price chart and can change signals on the live bar because it calculates on every tick.

Details

Published by

hasnocool on GitHub

Code credit

exlux99, as written in the script's header

Type

Strategy, Pine Script v4

Draws

On the price chart

Category

Oscillators & momentum, Moving averages, Volume, Candlestick patterns

Markets

Forex

Timeframes

H4 and above

Risk Notes

  • Signals can change on the live bar or after it closes (repainting)

Topics

analysisbtcusdtcryptocurrencydatapandaspythonsimulationtradingtradingview

Settings

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

SettingTypeDefaultVariable
Lengthint27length
Sourcesourceclosesrc
Take profit % for longfloat0.006tplong
Stop loss % for longfloat0.012sllong
Take profit % for shortfloat0.0075tpshort
Stop loss % for shortfloat0.015slshort
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

330 stars

Improvising [Alorse] is a price-chart strategy that looks for a one-bar candle reversal filtered by a 10-period EMA, a 14-period RSI, and a rising or falling MACD. Longs require a bearish bar followed by a bullish close above the EMA, RSI below 65, and a risin

Strategy v5 Oscillators & momentumMoving averages
Updated 2 months ago · None stated GitHub repository of Improvising [Alorse]

CombinedBinHAndClucV8

by viktors1982
36 stars

This strategy trades on the price chart using multiple indicators. It enters long positions when price dips meet conditions on Bollinger Bands 40 and 20, RSI, MFI, volume and other thresholds. It exits at custom ROI profit levels based on RSI or after timeout

Strategy v4 Oscillators & momentumMoving averages Repaints
Updated 2 years ago · None stated GitHub repository of CombinedBinHAndClucV8
12 stars

This strategy enters long when a fast EMA crosses above a slow EMA and RSI, ADX, and volume all clear their thresholds. It sizes the order from a percentage of equity and an ATR stop distance, then sets a partial profit target at a multiple of that risk. After

Strategy v5 TrendMoving averages
Updated 4 months ago · None stated GitHub repository of BTC 4H Institutional Trend

Combined Strategy

by Dropio12
7 stars

This strategy plots buy and sell markers on the price chart by combining a fast and slow ALMA crossover with a simple close-to-close momentum check. A long marker appears when the fast ALMA crosses above the slow ALMA and momentum is positive. A short marker a

Strategy v5 TrendOscillators & momentum
Updated 2 years ago · None stated GitHub repository of Combined Strategy
7 stars

This strategy combines Ichimoku Kinko Hyo components, a Stochastic oscillator, and specific candlestick patterns to generate trade signals. It identifies Kumo twists and range breakouts while evaluating candle body shapes using Fibonacci threshold filters. Tra

Strategy v4 TrendOscillators & momentum
Updated 2 years ago · MIT GitHub repository of Soulevement / Ressaut Strategy

Antigravity Superstar

by eltonaguiar
4 stars

This strategy draws on the price chart and combines a triple EMA stack, a volume spike with a minimum price move, and a MACD line-signal crossover. It enters long or short only when at least the chosen number of those three signals agree, with an optional RSI

Strategy v6 TrendMoving averages
Updated today · None stated GitHub repository of Antigravity Superstar

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