Indicator · Pine Script v4 · On the chart

DC Hacendado A

by crissrocca· code credited to vumanchu

DC Hacendado A is an overlay indicator inspired by Market Cipher A and VuManChu Cipher A.

View on GitHub

GitHub stars9on the repository
Pine versionv4older, still runs
Lines of code165
Settings26inputs
LicenceMPL-2.0
Last update3 years ago23 Mar 2023

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 indicator, select all of the template text and paste. Press Save and give it a name.
  4. 4Add it to the chartPress Add to chart, then adjust the settings with the gear icon next to its name.

Source Code

165 lines of Pine Script v4 from a.txt, published under MPL-2.0. Keep the author's credit and licence lines when you reuse it.

a.txt
// This source code is subject to the terms of the Mozilla Public License 2.0 at https://mozilla.org/MPL/2.0/
// © vumanchu
//@version=4

// Thanks Dynausmaux for the code
// Based on Cipher_A from falconCoin https://www.tradingview.com/script/cAw5GEAB-Market-Cipher-A-free-version-1-1/
// Thanks to LazyBear foor WaveTrend Oscillator https://www.tradingview.com/script/2KE8wTuF-Indicator-WaveTrend-Oscillator-WT/
// I just added the red diamond, blood diamond and yellowX pattern, i dont know if is exact but seems to be.
// Still need a lot of visual adjustments to look like market cipher A but it's an attempt
// Original code from VuManChu Cipher A 
// study(title="VuManChu Cipher A", shorttitle="VMC Cipher_A", overlay=true)
study(title="DC Hacendado A", shorttitle="DC_A", overlay=true, max_lines_count = 500, max_labels_count = 500)

// FUNCTIONS {

// WaveTrend
f_wavetrend(_src, _chlen, _avg, _malen) =>
    _esa = ema(_src, _chlen)
    _de = ema(abs(_src - _esa), _chlen)
    _ci = (_src - _esa) / (0.015 * _de)
    _tci = ema(_ci, _avg)
    _wt1 = _tci
    _wt2 = sma(_wt1, _malen)
    [_wt1, _wt2]

// 8 EMA Ribbon
f_emaRibbon(_src, _e1, _e2, _e3, _e4, _e5, _e6, _e7, _e8) =>
    _ema1 = ema(_src, _e1)
    _ema2 = ema(_src, _e2)
    _ema3 = ema(_src, _e3)
    _ema4 = ema(_src, _e4)
    _ema5 = ema(_src, _e5)
    _ema6 = ema(_src, _e6)
    _ema7 = ema(_src, _e7)
    _ema8 = ema(_src, _e8)
    [_ema1, _ema2, _ema3, _ema4, _ema5, _ema6, _ema7, _ema8]
    
f_rsimfi(_period, _multiplier, _tf) => security(syminfo.tickerid, _tf, sma(((close - open) / (high - low)) * _multiplier, _period))
 
// } FUNCTIONS  


// PARAMETERS {

// WaveTrend
wtChannelLen = input(9, title = 'WT Channel Length')
wtAverageLen = input(13, title = 'WT Average Length')
wtMASource = input(hlc3, title = 'WT MA Source')
wtMALen = input(3, title = 'WT MA Length')

// WaveTrend Overbought & Oversold lines
obLevel = input(53, title = 'WT Overbought Level 1')
obLevel2 = input(60, title = 'WT Overbought Level 2')
obLevel3 = input(100, title = 'WT Overbought Level 3')
osLevel = input(-53, title = 'WT Oversold Level 1')
osLevel2 = input(-60, title = 'WT Oversold Level 2')
osLevel3 = input(-80, title = 'WT Oversold Level 3')

// EMA Ribbon
showRibbon = input(false, "Show Ribbon")
ema1Len = input(5, title = "EMA 1 Length")
ema2Len = input(11, title = "EMA 2 Length")
ema3Len = input(15, title = "EMA 3 Length")
ema4Len = input(18, title = "EMA 4 Length")
ema5Len = input(21, title = "EMA 5 Length")
ema6Len = input(24, title = "EMA 6 Length")
ema7Len = input(28, title = "EMA 7 Length")
ema8Len = input(34, title = "EMA 8 Length")

// RSI
rsiSRC = input(close, title = "RSI Source")
rsiLen = input(7, title = "RSI Length")
rsiOversold = input(40, title = 'RSI Oversold', minval = 50, maxval = 100)
rsiOverbought = input(60, title = 'RSI Overbought', minval = 0, maxval = 50)

// RSI+MFI
rsiMFIShow = input(true, title = "Show RSI+MFI")
rsiMFIperiod = input(60, title = 'RSI+MFI Period')
rsiMFIMultiplier = input(150, title = 'RSI+MFI Area multiplier')

// }


// CALCULATE INDICATORS {

// EMA Ribbon
[ema1, ema2, ema3, ema4, ema5, ema6, ema7, ema8] = f_emaRibbon(close, ema1Len, ema2Len, ema3Len, ema4Len, ema5Len, ema6Len, ema7Len, ema8Len)

// RSI 
rsi = rsi(rsiSRC, rsiLen)

// Calculates WaveTrend
[wt1, wt2] = f_wavetrend(wtMASource, wtChannelLen, wtAverageLen, wtMALen)

// WaveTrend Conditions
wtOverSold = wt2 <= osLevel
wtOverBought = wt2 >= obLevel
wtCross = cross(wt1, wt2)
wtCrossUp = wt2 - wt1 <= 0
wtCrossDown = wt2 - wt1 >= 0

// RSI + MFI
rsiMFI = f_rsimfi(rsiMFIperiod, rsiMFIMultiplier, timeframe.period)

// Signals
longEma = crossover(ema2, ema8)
redCross = crossunder(ema1, ema2)
blueTriangle = crossover(ema2, ema3)
redDiamond = wtCross and wtCrossDown
yellowCross = redDiamond and wt2 < 45 and wt2 > osLevel3 and rsi < 30 and rsi > 15 and rsiMFI < -5
bloodDiamond = redDiamond and redCross
bullCandle = open > ema2 and open > ema8 and (close[1] > open[1]) and (close > open) and not redDiamond and not redCross
shortEma = crossover(ema8, ema2)

// } CALCULATE INDICATORS


// DRAW {

// EMA Ribbon
ribbonDir = ema8 < ema2
colorEma = ribbonDir ? color.green : color.red
p1 = plot(ema1, color=showRibbon ? ribbonDir ? #1573d4 : #ef5350 : na, linewidth=1, title="EMA 1")
p2 = plot(ema2, color=showRibbon ? ribbonDir ? #3096ff : #ef5350 : na, linewidth=1, title="EMA 2")
plot(ema3, color=showRibbon ? ribbonDir ? #57abff : #ef5350 : na, linewidth=1, title="EMA 3")
plot(ema4, color=showRibbon ? ribbonDir ? #85c2ff : #ef5350 : na, linewidth=1, title="EMA 4")
plot(ema5, color=showRibbon ? ribbonDir ? color.yellow : color.yellow : na, linewidth=1, title="EMA 5")
plot(ema6, color=showRibbon ? ribbonDir ? #b3d9ff : #ef5350 : na, linewidth=1, title="EMA 6")
plot(ema7, color=showRibbon ? ribbonDir ? #c9e5ff : #ef5350 : na, linewidth=1, title="EMA 7")
plot(ema8, color=showRibbon ? ribbonDir ? #dfecfb : #ef5350 : na, linewidth=1, title="EMA 8")
p8 = plot(ema8, color=showRibbon ? na : colorEma, linewidth=2, title="EMA 8")
fill(p1, p2, color = #1573d4)
fill(p2, p8, color = #363a45)

// SHAPES

plotshape(longEma, style=shape.circle, color=#00ff00, location=location.abovebar, size=size.tiny, title="Long EMA Signal")
plotshape(shortEma, style=shape.circle, color=#ff0000, location=location.abovebar, size=size.tiny, title="Short EMA Signal")
plotshape(redCross, style=shape.xcross, color=#ff0000, location=location.abovebar, size=size.tiny, title="Red cross")
plotshape(blueTriangle, style=shape.triangleup, color=#0064ff, location=location.abovebar, size=size.small, title="Blue Triangle")
plotshape(redDiamond, style=shape.diamond, color=#ff0000, location=location.abovebar, size=size.tiny, title="Red Diamond")
plotshape(bullCandle, style=shape.diamond, color=color.yellow, location=location.abovebar, size=size.tiny, title="Bull candle")
plotshape(bloodDiamond, style=shape.diamond, color=#ff0000, location=location.abovebar, size=size.small, title="Blood Diamond")
plotshape(yellowCross, style=shape.xcross, color=color.yellow, location=location.abovebar, size=size.small, title="Yellow Cross")
// } DRAW
  
  
// ALERTS {
alertcondition(redDiamond != 0, "Red Diamond", "Red Diamond")
alertcondition(bloodDiamond != 0, "Blood Diamond", "Blood Diamond")
alertcondition(yellowCross != 0, "YellowX", "YellowX")
alertcondition(redCross != 0, "RedX", "RedX")
alertcondition(longEma != 0, "Longema", "Longema")
alertcondition(blueTriangle != 0, "Bluetriangle", "Bluetriangle")
// } ALERTS

// CLOUD EMAs
M55=ema(close, 55)
M21=ema(close, 21)
M200=ema(close, 200)

PT1 = plot(M55,color=#02F539, linewidth=2)
PT2 = plot(M21,color=#FFF202, linewidth=2)
PT3 = plot(M200,color=#F50202, linewidth=2)
fill(PT1,PT3,color = #02F539)

Overview

DC Hacendado A calculates an eight-line exponential moving average ribbon alongside WaveTrend oscillator conditions, Relative Strength Index measurements, and a custom RSI plus Money Flow Index metric. Drawn directly on the price chart, it provides momentum and trend visual cues based on average crossovers and overbought or oversold thresholds. Users can toggle the display of the ribbon and adjust lengths for all underlying calculations.

Details

Published by

crissrocca on GitHub

Code credit

vumanchu, as written in the script's header

Type

Indicator, Pine Script v4

Draws

On the price chart

Category

Trend, Oscillators & momentum, Moving averages

Markets

Crypto

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.

File

a.txt

Settings

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

SettingTypeDefaultVariable
WT Channel Lengthint9wtChannelLen
WT Average Lengthint13wtAverageLen
WT MA Sourcesourcehlc3wtMASource
WT MA Lengthint3wtMALen
WT Overbought Level 1int53obLevel
WT Overbought Level 2int60obLevel2
WT Overbought Level 3int100obLevel3
WT Oversold Level 1int-53osLevel
WT Oversold Level 2int-60osLevel2
WT Oversold Level 3int-80osLevel3
Show RibbonboolfalseshowRibbon
EMA 1 Lengthint5ema1Len
Show all 26 settings
SettingTypeDefaultVariable
EMA 2 Lengthint11ema2Len
EMA 3 Lengthint15ema3Len
EMA 4 Lengthint18ema4Len
EMA 5 Lengthint21ema5Len
EMA 6 Lengthint24ema6Len
EMA 7 Lengthint28ema7Len
EMA 8 Lengthint34ema8Len
RSI SourcesourceclosersiSRC
RSI Lengthint7rsiLen
RSI Oversoldint40rsiOversold
RSI Overboughtint60rsiOverbought
Show RSI+MFIbooltruersiMFIShow
RSI+MFI Periodint60rsiMFIperiod
RSI+MFI Area multiplierint150rsiMFIMultiplier
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

948 stars

The Adaptive RSI Moving Average (ARSIMA) is an overlay indicator that dynamically adjusts its smoothing factor based on the Relative Strength Index (RSI). When the RSI moves toward extreme overbought or oversold conditions, the smoothing factor increases to ma

Indicator v4 Moving averagesOscillators & momentum
Updated 10 days ago · GPL-3.0 GitHub repository of Adaptive RSI Moving Average
218 stars

TradersPost Trading Checklist is an overlay indicator that evaluates a suite of popular technical conditions for long and short trade setups. It checks session-anchored VWAP, fast and slow EMA alignments and crosses, 200 SMA, RSI overbought or oversold conditi

Indicator v6 Screeners & dashboardsTrend
Updated 3 months ago · None stated GitHub repository of TradersPost Trading Checklist

Daily Trend Filter

by agutinbaigo28
147 stars

Calculates market regime conditions by combining RSI, MACD, and ADX/DMI indicators. It evaluates whether the market is in a strong bullish, strong bearish, neutral, or non-trending regime. The script plots a colored line overlaying the close price to reflect t

Indicator v5 TrendOscillators & momentum
Updated 6 weeks ago · MIT GitHub repository of Daily Trend Filter

AAPP

by capissimo
114 stars

This indicator plots an adaptive moving average or scaled RSI divergence line directly on the price chart. It calculates dual RSI series to measure momentum divergence, scales the values to the chart's price range, and constructs an adaptive average filtered b

Indicator v4 Moving averagesTrend
Updated 1 year ago · None stated GitHub repository of AAPP

Signal Strategy 15m

by tripolskypetr
72 stars

This indicator generates trend-following trade signals on the price chart by combining moving average crossovers with multi-factor filters. It triggers entry alerts when fast and slow EMAs cross in the direction of a baseline trend EMA, confirmed by non-extrem

Indicator v5 TrendMoving averages
Updated 3 days ago · MIT GitHub repository of Signal Strategy 15m
56 stars

Double Screened Decision is a multi-timeframe trend and momentum indicator overlaid directly on the price chart. It dynamically selects a higher timeframe based on the active chart resolution to evaluate higher-timeframe MACD, Bollinger Bands, RSI, and Stochas

Indicator v5 TrendMoving averages Repaints
Updated 4 months ago · None stated GitHub repository of Double Screened Decision

More indicators

Trade Your Charts With a Regulated Broker

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

Compare brokers