0% found this document useful (0 votes)
235 views4 pages

ZZ Algo MR Algo

The document is a TradingView script for the 'ZZ Algo MR V3' indicator, which includes settings for buy and sell signals, risk management, and candle coloring based on MACD analysis. It allows users to customize parameters such as sensitivity, ATR distance, and trailing stop settings. The script also features alert conditions for buy/sell signals and trend changes.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
235 views4 pages

ZZ Algo MR Algo

The document is a TradingView script for the 'ZZ Algo MR V3' indicator, which includes settings for buy and sell signals, risk management, and candle coloring based on MACD analysis. It allows users to customize parameters such as sensitivity, ATR distance, and trailing stop settings. The script also features alert conditions for buy/sell signals and trend changes.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
You are on page 1/ 4

//Telegram: @ZZAlgo

//@version=5
indicator('ZZ Algo MR V3', overlay=true)
import TradingView/ta/7

// Setting
showsignals = input(title='Sinyalleri Goster', defval=true, group = 'Al Ve Sat
Sinyal [ZZAlgo]')
sensitivity = input.int(title='Hassasiyet (1-20)', defval=20, minval = 1, maxval =
45, group = 'Al Ve Sat Sinyal [ZZAlgo]') + 1

levels = input.bool(false, "Kar Al/Zarar Durdur Noktasi" , group = "Risk


yonetimi [ZZ Algo]" , inline = "MMDB2")
lvlLines = true
linesStyle = "SOLID"
lvlDistance = input.int(20, "Mesafe", 1, inline="levels2", group = "Risk yonetimi
[ZZ Algo]")
lvlDecimals = input.int(2, "Ondalik Sayi", 1, 8, inline="levels2", group = "Risk
yonetimi [ZZ Algo]")
atrRisk = input.int(1, "Risk", 1, group = "Risk yonetimi [ZZ Algo]" ,
inline="levels3")
atrLen = input.int(14, "ATR Mesafesi", 1, group = "Risk yonetimi [ZZ Algo]" ,
inline="levels3")

ShowSmartTrail = input(true,'Akilli iz sürme', group = 'TOOLS [ZZ Algo]')


show_rev = input.bool(true, "Reversal Bulutu", group = 'TOOLS [ZZ Algo]')
TrendFollower = input(true, 'Trend Takip', group='TOOLS [ZZ Algo]')

Periods = sensitivity * 10
src = hl2
Multiplier = sensitivity / 2
changeATR = true
highlighting = false
atr2 = ta.sma(ta.tr, Periods)
atr = changeATR ? ta.atr(Periods) : atr2
up = src - Multiplier * atr
up1 = nz(up[1], up)
up := close[1] > up1 ? math.max(up, up1) : up
dn = src + Multiplier * atr
dn1 = nz(dn[1], dn)
dn := close[1] < dn1 ? math.min(dn, dn1) : dn
trend = 1
trend := nz(trend[1], trend)
trend := trend == -1 and close > dn1 ? 1 : trend == 1 and close < up1 ? -1 : trend
buySignal = trend == 1 and trend[1] == -1
plotshape(buySignal and showsignals ? up : na, title='Al', text='Al Sinyal',
location=location.absolute, style=shape.labelup, size=size.normal, color=#00ff00,
textcolor=color.new(color.black, 0))
sellSignal = trend == -1 and trend[1] == 1
plotshape(sellSignal and showsignals ? dn : na, title='Sat', text='Sat Sinyal',
location=location.absolute, style=shape.labeldown, size=size.normal, color=#ff0000,
textcolor=color.new(color.white, 0))

alertcondition(buySignal, title='ZZAlgo Buy', message='ZZAlgo Buy! Mesaji')


alertcondition(sellSignal, title='ZZAlgo Sell', message='ZZAlgo Sell! Mesaji')
changeCond = trend != trend[1]
alertcondition(changeCond, title='ZZ Algo Yon Degisimi!', message='ZZ Algo Yon
Degisimi!')
// Candle Coloring
// Input
fastLength = 25
slowLength = 55
signalLength = 9

// Data reference
[macd, signal, hist] = ta.macd(src, fastLength, slowLength, signalLength)

// 4 level of green
greenHigh = color.rgb(0, 188, 212)
greenMidHigh = color.rgb(0, 188, 212)
greenMidLow = color.rgb(0, 188, 212)
greenLow = color.rgb(0, 188, 212)

// Yellow
yellowLow = color.rgb(0, 230, 118)

// 4 level of red
redHigh = color.rgb(156, 39, 176)
redMidHigh = color.rgb(156, 39, 176)
redMidLow = color.rgb(156, 39, 176)
redLow = color.rgb(156, 39, 176)

// Default color
candleBody = yellowLow

// Ranging trend
if hist > 0
if hist > hist[1] and hist[1] > 0
candleBody := greenLow

if hist < 0
if hist < hist[1] and hist[1] < 0
candleBody := redLow

// Bullish trend
if macd > 0 and hist > 0
candleBody := greenMidLow

if hist > hist[1] and macd[1] > 0 and hist[1] > 0


candleBody := greenMidHigh

if hist > hist[2] and macd[2] > 0 and hist[2] > 0


candleBody := greenHigh

// Bearish trend
if macd < 0 and hist < 0
candleBody := redMidLow

if hist < hist[1] and macd[1] < 0 and hist[1] < 0


candleBody := redMidHigh

if hist < hist[2] and macd[2] < 0 and hist[2] < 0


candleBody := redHigh

barcolor(candleBody) // Include suggestion by Shaheen204

// Smart Trail
// inputs //
//{

trailType = 'modified'
ATRPeriod = 13
ATRFactor = 4
smoothing = 8

norm_o = request.security(ticker.new(syminfo.prefix, syminfo.ticker),


timeframe.period, open)
norm_h = request.security(ticker.new(syminfo.prefix, syminfo.ticker),
timeframe.period, high)
norm_l = request.security(ticker.new(syminfo.prefix, syminfo.ticker),
timeframe.period, low)
norm_c = request.security(ticker.new(syminfo.prefix, syminfo.ticker),
timeframe.period, close)
//}

//////// FUNCTIONS //////////////


//{
// Wilders ma //
Wild_ma(_src, _malength) =>
_wild = 0.0
_wild := nz(_wild[1]) + (_src - nz(_wild[1])) / _malength
_wild

/////////// TRUE RANGE CALCULATIONS /////////////////


HiLo = math.min(norm_h - norm_l, 1.5 * nz(ta.sma(norm_h - norm_l, ATRPeriod)))

HRef = norm_l <= norm_h[1] ? norm_h - norm_c[1] : norm_h - norm_c[1] - 0.5 *


(norm_l - norm_h[1])

LRef = norm_h >= norm_l[1] ? norm_c[1] - norm_l : norm_c[1] - norm_l - 0.5 *


(norm_l[1] - norm_h)

trueRange = trailType == 'modified' ? math.max(HiLo, HRef, LRef) : math.max(norm_h


- norm_l, math.abs(norm_h - norm_c[1]), math.abs(norm_l - norm_c[1]))
//}

/////////// TRADE LOGIC ////////////////////////


//{
loss = ATRFactor * Wild_ma(trueRange, ATRPeriod)

Up = norm_c - loss
Dn = norm_c + loss

TrendUp = Up
TrendDown = Dn
Trend = 1

TrendUp := norm_c[1] > TrendUp[1] ? math.max(Up, TrendUp[1]) : Up


TrendDown := norm_c[1] < TrendDown[1] ? math.min(Dn, TrendDown[1]) : Dn

Trend := norm_c > TrendDown[1] ? 1 : norm_c < TrendUp[1] ? -1 : nz(Trend[1], 1)


trail = Trend == 1 ? TrendUp : TrendDown

ex = 0.0
ex := ta.crossover(Trend, 0) ? norm_h : ta.crossunder(Trend, 0) ? norm_l : Trend ==
1 ? math.max(ex[1], norm_h) : Trend == -1 ? math.min(ex[1], norm_l) : ex[1]
//}

// //////// PLOT TP and SL /////////////

////// FIBONACCI LEVELS ///////////


//{
state = Trend == 1 ? 'long' : 'short'

fib1Level = 61.8
fib2Level = 78.6
fib3Level = 88.6

f1 = ex + (trail - ex) * fib1Level / 100


f2 = ex + (trail - ex) * fib2Level / 100
f3 = ex + (trail - ex) * fib3Level / 100
l100 = trail + 0

fill(plot(ShowSmartTrail ? (ta.sma(trail, smoothing)) : na, 'Trailingstop',


style=plot.style_line, color=Trend == 1 ? color.new(#14ff34, 0) : Trend == -1 ?
color.new(#ff0015, 0) : na),
plot( ShowSmartTrail ? (ta.sma(f2, smoothing)) : na, 'Fib 2',
style=plot.style_line, display=display.none),
color=state == 'long' ? color.rgb(224, 64, 251): state == 'short' ?
color.rgb(255, 152, 0): na)
//}

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy