답변완료
문의드립니다.
아래의 트레이딩뷰 수식을 변환 부탁드립니다.
1
====================
/@version=6
indicator(title="Volume Weighted Moving Average", shorttitle="VWMA", overlay=true, timeframe="", timeframe_gaps=true)
len = input.int(20, "Length", minval=1)
src = input(close, "Source")
ma = ta.vwma(src, len)
offset = input.int(0, "Offset", minval = -500, maxval = 500)
plot(ma, title="VWMA", color=#2962FF, offset = offset)
2
=======================
//@version=3
study(title="VWMACD", shorttitle="VWMACD", overlay=true)
src = close, len1 = input(12, minval=1), len2 = input(26, minval=1)
len = len2-len1
ma = vwma(src, len)
plot(ma, title="VWMA", color=blue)
3
===================
Periods = input(title="ATR Period", type=input.integer, defval=10)
src = input(hl2, title="Source")
Multiplier = input(title="ATR Multiplier", type=input.float, step=0.1, defval=3.0)
changeATR= input(title="Change ATR Calculation Method ?", type=input.bool, defval=true)
showsignals = input(title="Show Buy/Sell Signals ?", type=input.bool, defval=true)
highlighting = input(title="Highlighter On/Off ?", type=input.bool, defval=true)
atr2 = sma(tr, Periods)
atr= changeATR ? atr(Periods) : atr2
up=src-(Multiplier*atr)
up1 = nz(up[1],up)
up := close[1] > up1 ? max(up,up1) : up
dn=src+(Multiplier*atr)
dn1 = nz(dn[1], dn)
dn := close[1] < dn1 ? 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
upPlot = plot(trend == 1 ? up : na, title="Up Trend", style=plot.style_linebr, linewidth=2, color=color.green)
buySignal = trend == 1 and trend[1] == -1
plotshape(buySignal ? up : na, title="UpTrend Begins", location=location.absolute, style=shape.circle, size=size.tiny, color=color.green, transp=0)
plotshape(buySignal and showsignals ? up : na, title="Buy", text="Buy", location=location.absolute, style=shape.labelup, size=size.tiny, color=color.green, textcolor=color.white, transp=0)
dnPlot = plot(trend == 1 ? na : dn, title="Down Trend", style=plot.style_linebr, linewidth=2, color=color.red)
sellSignal = trend == -1 and trend[1] == 1
plotshape(sellSignal ? dn : na, title="DownTrend Begins", location=location.absolute, style=shape.circle, size=size.tiny, color=color.red, transp=0)
plotshape(sellSignal and showsignals ? dn : na, title="Sell", text="Sell", location=location.absolute, style=shape.labeldown, size=size.tiny, color=color.red, textcolor=color.white, transp=0)
mPlot = plot(ohlc4, title="", style=plot.style_circles, linewidth=0)
매번 감사드립니다. 수고하세요!!!
2025-05-06
323
글번호 190580
지표
답변완료
지표 변환 문의드립니다.
귀사의 무궁한 발전을 기원합니다
안녕하세요,수고 많으십니다
트레이딩뷰 지표를 예스트레이더로 변환해 주시면 대단히 감사하겠습니다.
주석이 좀 많네요.
챠트상에 봉그리기 비쥬얼은 구현하기 힘들면 넘어가시고, 매수,매도 신호만 ▲, ▼ 이런식으로 넣어 주시면 안될까요.
좋은 프로그램 만들어 주셔서 항상 잘 쓰고 있습니다.감사합니다.
++++++++++++++++++++++++++++++++++++++++++
// Mozilla Public License 2.0 at https://mozilla.org/MPL/2.0/
// © QuantAlgo
//@version=6
indicator(title="Zero Lag Signals For Loop [QuantAlgo]", overlay=true)
// ╔════════════════════════════════╗ //
// ║ USER-DEFINED SETTINGS ║ //
// ╚════════════════════════════════╝ //
// Input Groups
var string zlag_settings = "════════ Zero Lag Settings ════════"
var string loop_settings = "════════ For Loop Settings ════════"
var string thresh_settings = "════════ Threshold Settings ════════"
var string visual_settings = "════════ Visualization Settings ════════"
// Tooltips
tooltip_zl_length = "Length of the Zero Lag calculation period. Higher values create smoother signals."
tooltip_vol_mult = "Multiplier for volatility in signal generation. Higher values make signals more conservative by requiring larger price movements."
tooltip_loop_start = "Starting point for the loop analysis. Lower values analyze more recent price action."
tooltip_loop_end = "Ending point for the loop analysis. Higher values analyze longer historical periods."
tooltip_thresh_up = "Minimum score required to generate uptrend signals. Higher values create stricter conditions."
tooltip_thresh_down = "Maximum score required to generate downtrend signals. Lower values create stricter conditions."
tooltip_signals = "Enable/disable signal markers on the chart"
tooltip_candles = "Enable/disable candle coloring based on trend direction"
tooltip_bg_lines = "Enable/disable vertical lines on signal changes"
// Zero Lag Settings
length = input.int(50, "Zero Lag Length",
minval=1,
group=zlag_settings,
tooltip=tooltip_zl_length)
volatility_mult = input.float(1.5, "Volatility Multiplier",
minval=0.1,
group=zlag_settings,
tooltip=tooltip_vol_mult)
// Loop Settings
loop_start = input.int(1, "Loop Start",
minval=1,
group=loop_settings,
tooltip=tooltip_loop_start)
loop_end = input.int(70, "Loop End",
minval=1,
group=loop_settings,
tooltip=tooltip_loop_end)
// Threshold Settings
threshold_up = input.int(5, "Threshold Uptrend",
group=thresh_settings,
tooltip=tooltip_thresh_up)
threshold_down = input.int(-5, "Threshold Downtrend",
group=thresh_settings,
tooltip=tooltip_thresh_down)
// Visualization Settings
bullcolor = input.color(#00ffaa, "Bullish Color", group=visual_settings)
bearcolor = input.color(#ff0000, "Bearish Color", group=visual_settings)
show_signals = input.bool(true, "Show Signal Markers",
group=visual_settings, tooltip=tooltip_signals)
paint_candles = input.bool(true, "Color Candles",
group=visual_settings, tooltip=tooltip_candles)
show_bg_lines = input.bool(false, "Signal Change Lines",
group=visual_settings, tooltip=tooltip_bg_lines)
// ╔════════════════════════════════╗ //
// ║ ZERO LAG CALCULATIONS ║ //
// ╚════════════════════════════════╝ //
lag = math.floor((length - 1) / 2)
zl_basis = ta.ema(close + (close - close[lag]), length)
volatility = ta.highest(ta.atr(length), length*3) * volatility_mult
// ╔════════════════════════════════╗ //
// ║ FOR LOOP ANALYSIS ║ //
// ╚════════════════════════════════╝ //
forloop_analysis(basis_price) =>
sum = 0.0
for i = loop_start to loop_end by 1
sum += (basis_price > basis_price[i] ? 1 : -1)
sum
score = forloop_analysis(zl_basis)
// ╔════════════════════════════════╗ //
// ║ SIGNAL GENERATION ║ //
// ╚════════════════════════════════╝ //
// Long/Short conditions
long_signal = score > threshold_up and close > zl_basis + volatility
short_signal = score < threshold_down and close < zl_basis - volatility
// Trend detection
var trend = 0
if long_signal
trend := 1
else if short_signal
trend := -1
// Track trend changes
var prev_trend = 0
trend_changed = trend != prev_trend
prev_trend := trend
// ╔════════════════════════════════╗ //
// ║ VISUALIZATION ║ //
// ╚════════════════════════════════╝ //
// Current trend color
trend_col = trend == 1 ? bullcolor : trend == -1 ? bearcolor : na
// Plot Zero Lag line
p_basis = plot(zl_basis, "Zero Lag Basis", color=trend_col, linewidth=3)
p_price = plot(hl2, "Price", display=display.none, editable=false)
// Fill between Zero Lag and price
fill(p_basis, p_price, hl2, zl_basis, na, color.new(trend_col, 20))
// Plot trend shift labels
plotshape(trend_changed and trend == 1 ? zl_basis : na, "Bullish Trend",
shape.labelup, location.absolute, bullcolor,
text="𝑳", textcolor=#000000, size=size.small, force_overlay=true)
plotshape(trend_changed and trend == -1 ? zl_basis : na, "Bearish Trend",
shape.labeldown, location.absolute, bearcolor,
text="𝑺", textcolor=#ffffff, size=size.small, force_overlay=true)
// Background signal lines
bgcolor(show_bg_lines ?
(ta.crossover(trend, 0) ? bullcolor :
ta.crossunder(trend, 0) ? bearcolor : na) : na)
// Color candles based on trend
barcolor(paint_candles ?
(trend == 1 ? bullcolor :
trend == -1 ? bearcolor : na) : na)
// ╔════════════════════════════════╗ //
// ║ ALERTS ║ //
// ╚════════════════════════════════╝ //
alertcondition(ta.crossover(trend, 0),
title="Zero Lag Signals Long",
message="Zero Lag Signals Long {{exchange}}:{{ticker}}")
alertcondition(ta.crossunder(trend, 0),
title="Zero Lag Signals Short",
message="Zero Lag Signals Short {{exchange}}:{{ticker}}")
// ╔════════════════════════════════╗ //
// ║ CREATED BY ║ //
// ╚════════════════════════════════╝
2025-05-08
461
글번호 190576
지표