Strategy · Pine Script v5 · Own pane

MACD Delta Strategy

by juliencrn

This Pine v5 strategy computes MACD and takes the difference between the MACD and signal lines.

View on GitHub

Archived by its author

GitHub stars1on the repository
Pine versionv5runs as is
Lines of code59
Settings6inputs
LicenceNone stated
Last update4 years ago14 Aug 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

MACD Delta Strategy goes long when that histogram crosses above zero and short when it crosses below, reversing the position. A percentage stop loss measured from the average entry price protects each trade, with the default set in the inputs. RSI and CCI lengths are inputs, and the CCI is plotted in a separate pane, but neither filters trades. Position size uses the strategy default.

Details

Published by

juliencrn on GitHub

Type

Strategy, Pine Script v5

Draws

Separate pane below the chart

Category

Oscillators & momentum, Trend

Markets

Any symbol

Timeframes

Any timeframe

Risk Notes

No repainting, lookahead or stacked entries were found in its code or README. That says nothing about how well it works: test it first.

Topics

data-analysisjupyter-notebookmatplotlibpandaspinescriptpythontrading-strategiestrading-bottradingbot

Settings

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

SettingTypeDefaultVariable
signal_lengthint9signal_length
fast_lengthint12fast_length
slow_lengthint26slow_length
rsi_lenghtint14rsi_lenght
cci_lenghtint20cci_lenght
Stop loss (%)float8stop_loss_perc
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

MACD + Divergences [Alorse] is a momentum strategy that calculates the MACD oscillator and identifies regular and hidden divergences using pivot high and low points. It filters trade signals with dual Exponential Moving Averages (EMA 150 and 600) to ensure tra

Strategy v4 Oscillators & momentumDivergence Repaints
Updated 2 months ago · None stated GitHub repository of MACD + Divergences [Alorse]

Q-Trend + KVO Strategy

by TradersPost
218 stars

This strategy combines the ATR-banded Q-Trend indicator with the Klinger Volume Oscillator (KVO) to execute confluence trades. It enters long when a Q-Trend buy trigger aligns with a positive KVO value and a bullish candle confirmation, taking short trades und

Strategy v6 TrendVolume
Updated 3 months ago · None stated GitHub repository of Q-Trend + KVO Strategy

MACD Crossover (tutorial)

by pineforge-4pass
193 stars

This strategy calculates the Moving Average Convergence Divergence indicator and plots the MACD line, signal line, and histogram in a separate pane. It enters long positions when the MACD line crosses above the signal line and enters short positions when it cr

Strategy v6 Oscillators & momentumMoving averages
Updated yesterday · Apache-2.0 GitHub repository of MACD Crossover (tutorial)

ADX Strategy

by hasnocool
106 stars

An ADX-based trend-following strategy that enters long positions when the positive directional indicator (DI+) crosses above the Average Directional Index (ADX) while ADX remains below a preset threshold and a fast EMA is above a slow EMA. It allows adding to

Strategy v4 TrendOscillators & momentum
Updated 2 years ago · GPL-3.0 GitHub repository of ADX Strategy

BTC MACD Basic Tests

by iamrichardD
57 stars

BTC MACD Basic Tests implements a Pine Script unit-testing framework designed to validate components of a long-only Bitcoin MACD trading system. It constructs structured test cases to evaluate mock functions for MACD crossover calculations, volume threshold ch

Strategy v6 Oscillators & momentumTrend
Updated 1 year ago · Apache-2.0 GitHub repository of BTC MACD Basic Tests

Trailering S002

by ruckard
13 stars

Trailering S002 is a long-only automated strategy template built for Zignaly webhook execution. It evaluates historical price stats and maximum excursion to trigger long trades, dynamically adjusting capital allocation based on active signal conditions. The sc

Strategy v5 TrendOscillators & momentum
Updated 1 year ago · None stated GitHub repository of Trailering S002

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