Harold_NL

GRaB Candles by mattlacoco with MMM by Harold_NL V1.1

Update v1.1:
GRaB colors now green, red, gray
Added Murrey Range lines.
Cleaned up the code.

GRaB candles and a murrey math "midline" in one script.
Some traders using methods of Rob Booker (40% club, trifecta5) like to use both GRaB candles and Murrey Math to combine, or to compare entry and exit moments.
Color of candles are as GRaB candles.
Midline use: Crossing the midline is a change of color in murrey. Candles closing above the midline would be green and below would be red as murrey candles.

Credits:
Original script of Raghee Horner's GRaB Candles by Matt Lacoco (BUY BLUE SELL RED).
Murrey Math Midline added by Harold van Berk (most code copied from "UCS_Murrey's Math Oscillator_V2" by ucsgears)

Candle colors defined by GRaB
Green bulish, Red bearish, Gray neutral

Dark for close lower than open
Light for close higher than open

Candles that close above the Murrey Math Middle line would normally be (murrey) green. Below would be (murrey) red.

Murrey lines can be switched off in "format" of the indicator.

Mã nguồn mở

Với tinh thần TradingView, tác giả của tập lệnh này đã xuất bản nó dưới dạng mã nguồn mở, vì vậy các nhà giao dịch có thể hiểu và xác minh nó. Chúc mừng tác giả! Bạn có thể sử dụng mã này miễn phí, nhưng việc sử dụng lại mã này trong một ấn phẩm chịu sự điều chỉnh của Nội quy nội bộ. Bạn có thể yêu thích nó để sử dụng nó trên biểu đồ.

Thông báo miễn trừ trách nhiệm

Thông tin và ấn phẩm không có nghĩa là và không cấu thành, tài chính, đầu tư, kinh doanh, hoặc các loại lời khuyên hoặc khuyến nghị khác được cung cấp hoặc xác nhận bởi TradingView. Đọc thêm trong Điều khoản sử dụng.

Bạn muốn sử dụng tập lệnh này trên biểu đồ?
study(title='Buy green Sell Red', shorttitle='BGSR', overlay=true)
// V1.1 Adjusting colors to GRaB originals Green, Red and Blue.
// Introducing a color for neutral.

// plot midline from Murrey Math for trifecta entry and exit
// Inputs
length = input(100, minval = 10, title = "Murrey: Look back Length")
showmidline = input(true, title = "Murrey: plot midline")
showrange = input(true, title = "Murrey: plot range")

// begin MMM line
hi = highest(high, length)
lo = lowest(low, length)
range = hi - lo
midline = lo + range / 2

//plot (midline, color = black)
//showmidline == true ? plot (midline, color = black) : na
//showrange ? plot (range, color = orange) : na

plotmidline = showmidline == true ? midline : na
plotrange = showrange == true ? lo : na

plot(plotmidline, title="Murrey Math Midline",color=black) 
plot(plotrange, title="Murrey Math Range low",color=fuchsia)
plot(plotrange + range, title="Murrey Math Range high",color=fuchsia)
// end MMM line

// vars
emaPeriod = input(title="GRaB: EMA Period", type=integer, defval=34)
showWave = input(title="GRaB: Show Wave", type=bool, defval=false)

// build wave
emaHigh = ema(high,emaPeriod)
emaLow = ema(low,emaPeriod)
emaClose = ema(close,emaPeriod)

waveHigh = showWave == true ? emaHigh : na
waveLow = showWave == true ? emaLow : na
waveClose = showWave == true ? emaClose : na

plot(waveHigh, title="EMA High",color=red )
plot(waveLow, title="EMA Low", color=green)
plot(waveClose, title="EMA Close", color=silver)

// paint GRaB candles according to close position relative to wave
barcolor(close < emaLow ? close > open ? red : maroon : close > emaHigh ? close > open ? lime : green: close > open ? silver : gray)