0% found this document useful (0 votes)
3 views1 page

龙 V.6y原

This document is a TradingView Pine Script indicator that generates buy and sell signals based on user-defined sensitivity and offset settings. It employs smoothing functions and filters to analyze price movements and determine bullish or bearish conditions. The script also includes visual signals on the Heikin Ashi chart and alert conditions for trading signals.

Uploaded by

qq11104491
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)
3 views1 page

龙 V.6y原

This document is a TradingView Pine Script indicator that generates buy and sell signals based on user-defined sensitivity and offset settings. It employs smoothing functions and filters to analyze price movements and determine bullish or bearish conditions. The script also includes visual signals on the Heikin Ashi chart and alert conditions for trading signals.

Uploaded by

qq11104491
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/ 1

//@version=5

indicator("[龙 V.6]", overlay=true, max_labels_count=500)

// Get user settings


showBuySell = input(true, "显示买入卖出", group="买入卖出信号")
sensitivity = input.float(3, "灵敏度 (1-6)", 1, 6, group="买入卖出信号")
offsetSignal = input.float(5, "信号偏移", 0, group="买入卖出信号")

// Functions
smoothrng(x, t, m) =>
wper = t * 2 - 1
avrng = ta.ema(math.abs(x - x[1]), t)
smoothrng = ta.ema(avrng, wper) * m
rngfilt(x, r) =>
rngfilt = x
rngfilt := x > nz(rngfilt[1]) ? x - r < nz(rngfilt[1]) ? nz(rngfilt[1]) : x - r
: x + r > nz(rngfilt[1]) ? nz(rngfilt[1]) : x + r

// Get components
source = close
smrng1 = smoothrng(source, 27, 1.5)
smrng2 = smoothrng(source, 55, sensitivity)
smrng = (smrng1 + smrng2) / 2
filt = rngfilt(source, smrng)
up = 0.0, up := filt > filt[1] ? nz(up[1]) + 1 : filt < filt[1] ? 0 :
nz(up[1])
dn = 0.0, dn := filt < filt[1] ? nz(dn[1]) + 1 : filt > filt[1] ? 0 :
nz(dn[1])
bullCond = bool(na), bullCond := source > filt and source > source[1] and up > 0
or source > filt and source < source[1] and up > 0
bearCond = bool(na), bearCond := source < filt and source < source[1] and dn > 0
or source < filt and source > source[1] and dn > 0
lastCond = 0, lastCond := bullCond ? 1 : bearCond ? -1 : lastCond[1]
bull = bullCond and lastCond[1] == -1
bear = bearCond and lastCond[1] == 1

// Colors
cyan = #00DBFF
pink = #E91E63

// Plot
off = (ta.highest(300) - ta.lowest(300)) * offsetSignal / 100

// 在 Heikin Ashi 上显示买入/卖出信号


plotshape(showBuySell and bull ? low - off : na, "买入标签" , shape.labelup ,
location.absolute, cyan, 0, "Buy" , color.white, size=size.tiny)
plotshape(showBuySell and bear ? high + off : na, "卖出标签", shape.labeldown,
location.absolute, pink, 0, "Sell", color.white, size=size.tiny)

// Alerts
alert05 = bull or bear
alertcondition(bull, "买入信号", "Buy Signal")
alertcondition(bear, "卖出信号", "Sell Signal ")
alertcondition(bull or bear, "入场", "Buy or Sell Signal")

You might also like