커뮤니티

예스랭귀지 Q&A

글쓰기

[공지] 예스랭귀지 AI 어시스턴트, '예스나 AI' 출시 및 무료 체험 안내

안녕하세요, 예스스탁 입니다.복잡한 수식 공부 없이 여러분의 아이디어를 말하면 시스템 트레이딩 언어 예스랭귀지로 작성해주는 서비스예스나 AI(YesNa AI)가 출시되었습니다.지금 예스나 AI를 직접 경험해 보실 수 있도록 20크레딧(질문권 20회)를 무료로 증정해 드리고 있습니다.바로 여러분의 아이디어를 코드로 변환해보세요.--------------------------------------------------🚀 YesNa AI 핵심 기능- 지표식/전략식/종목검색식 생성: 자연어로 요청하면 예스랭귀지 문법에 맞는 코드를 작성합니다.- 종목검색식 변환 지원: K증권의 종목 검색식을 예스랭귀지로 변환 지원합니다.- 컴파일 검증: 작성된 코드가 실행 가능한지 컴파일러를 통해 문법 검증을 거쳐 결과물을 제공합니다.상세한 서비스 개요 및 활용 방법은 [서비스 소개 페이지]에서 확인하실 수 있습니다.▶ 서비스 소개 페이지: 바로가기서비스 사용 유의사항 및 결제 환불정책은 [이용약관]을 참고 부탁드립니다.▶ 서비스 이용약관: 바로가기💬 이용 문의사용 중 문의사항은 [프로그램 사용법 Q&A] 게시판에서 [예스나 AI] 카테고리를 설정 후 문의해 주시면 상세히 안내해 드리겠습니다.--------------------------------------------------앞으로도 AI를 활용한 다양한 트레이딩 기능들을 지속적으로 선보일 예정입니다.많은 관심과 기대 부탁드립니다.
프로필 이미지
예스스탁
2026-02-27
1211
글번호 230811
지표
답변완료

부탁 드려 봅니다 넘 길이가 길어서 죄송한다

This source code is subject to the terms of the Mozilla Public License 2.0 at https://mozilla.org/MPL/2.0/// ©Bigtaker//@version=5indicator("Advanced custom multi MA signals (EMA/SMA/VWMA/VWAP)", shorttitle="Multi MA Signals", overlay=true)// -----------------------------------------------------------------------------// [SECTION 1] User Inputs & Configuration// -----------------------------------------------------------------------------// 1.1 Moving Average (MA) Settings (1-5)// ---------------------------------------GRP_MA01 = "=== MA 01 Settings ==="i_ma01_enabled = input.bool(true, "Show Indicator", group=GRP_MA01)i_ma01_type = input.string("EMA", "MA Type", options=["EMA", "SMA", "VWMA", "VWAP"], tooltip="VWMA: Uses Length\nVWAP: Session-based (Ignores Length)", group=GRP_MA01)i_ma01_len = input.int(50, "Length", minval=1, group=GRP_MA01)i_ma01_tf = input.timeframe("240", "Timeframe", group=GRP_MA01)i_ma01_src = input.source(close, "Source", group=GRP_MA01)i_ma01_color = input.color(color.new(#00ff88, 70), "Color", group=GRP_MA01)GRP_MA02 = "=== MA 02 Settings ==="i_ma02_enabled = input.bool(true, "Show Indicator", group=GRP_MA02)i_ma02_type = input.string("EMA", "MA Type", options=["EMA", "SMA", "VWMA", "VWAP"], group=GRP_MA02)i_ma02_len = input.int(20, "Length", minval=1, group=GRP_MA02)i_ma02_tf = input.timeframe("D", "Timeframe", group=GRP_MA02)i_ma02_src = input.source(close, "Source", group=GRP_MA02)i_ma02_color = input.color(color.new(#ffffff, 80), "Color", group=GRP_MA02)GRP_MA03 = "=== MA 03 Settings ==="i_ma03_enabled = input.bool(true, "Show Indicator", group=GRP_MA03)i_ma03_type = input.string("EMA", "MA Type", options=["EMA", "SMA", "VWMA", "VWAP"], group=GRP_MA03)i_ma03_len = input.int(50, "Length", minval=1, group=GRP_MA03)i_ma03_tf = input.timeframe("D", "Timeframe", group=GRP_MA03)i_ma03_src = input.source(close, "Source", group=GRP_MA03)i_ma03_color = input.color(color.new(#cc00ff, 70), "Color", group=GRP_MA03)GRP_MA04 = "=== MA 04 Settings ==="i_ma04_enabled = input.bool(true, "Show Indicator", group=GRP_MA04)i_ma04_type = input.string("EMA", "MA Type", options=["EMA", "SMA", "VWMA", "VWAP"], group=GRP_MA04)i_ma04_len = input.int(50, "Length", minval=1, group=GRP_MA04)i_ma04_tf = input.timeframe("W", "Timeframe", group=GRP_MA04)i_ma04_src = input.source(close, "Source", group=GRP_MA04)i_ma04_color = input.color(color.new(#fae634, 50), "Color", group=GRP_MA04)GRP_MA05 = "=== MA 05 Settings ==="i_ma05_enabled = input.bool(true, "Show Indicator", group=GRP_MA05)i_ma05_type = input.string("EMA", "MA Type", options=["EMA", "SMA", "VWMA", "VWAP"], group=GRP_MA05)i_ma05_len = input.int(100, "Length", minval=1, group=GRP_MA05)i_ma05_tf = input.timeframe("W", "Timeframe", group=GRP_MA05)i_ma05_src = input.source(close, "Source", group=GRP_MA05)i_ma05_color = input.color(color.new(#1a1ef5, 50), "Color", group=GRP_MA05)// 1.2 Signal Logic Configuration// ---------------------------------------GRP_SIG01 = ">>> Signal Option 01 (Standard) <<<"i_sig01_enabled = input.bool(true, "Enable Signal 1 (Plot & Alert)", group=GRP_SIG01)i_sig01_fast_ref = input.string("MA1", "Short MA", options=["MA1", "MA2", "MA3", "MA4", "MA5", "None"], group=GRP_SIG01)i_sig01_slow_ref = input.string("MA3", "Long MA", options=["MA1", "MA2", "MA3", "MA4", "MA5", "None"], group=GRP_SIG01)GRP_SIG02 = ">>> Signal Option 02 (Darker) <<<"i_sig02_enabled = input.bool(false, "Enable Signal 2 (Plot & Alert)", group=GRP_SIG02)i_sig02_fast_ref = input.string("MA1", "Short MA", options=["MA1", "MA2", "MA3", "MA4", "MA5", "None"], group=GRP_SIG02)i_sig02_slow_ref = input.string("MA4", "Long MA", options=["MA1", "MA2", "MA3", "MA4", "MA5", "None"], group=GRP_SIG02)GRP_SIG03 = ">>> Signal Option 03 (Darkest) <<<"i_sig03_enabled = input.bool(false, "Enable Signal 3 (Plot & Alert)", group=GRP_SIG03)i_sig03_fast_ref = input.string("MA2", "Short MA", options=["MA1", "MA2", "MA3", "MA4", "MA5", "None"], group=GRP_SIG03)i_sig03_slow_ref = input.string("MA4", "Long MA", options=["MA1", "MA2", "MA3", "MA4", "MA5", "None"], group=GRP_SIG03)// 1.3 Visual & Candle Settings// ---------------------------------------GRP_VIS_CANDLE = ">>> Candle Color Settings <<<"i_candle_override = input.bool(true, "Force Candle Color", tooltip="If enabled, hides original candles and paints new candles with specified colors.", group=GRP_VIS_CANDLE)i_candle_ref_sig = input.string("Signal 1", "Reference Signal", options=["Signal 1", "Signal 2", "Signal 3"], group=GRP_VIS_CANDLE)// 1.4 Ribbon Settings// ---------------------------------------GRP_VIS_RIBBON = ">>> Ribbon Gradient Settings <<<"i_ribbon_enabled = input.bool(true, "Enable Gradient Ribbon", group=GRP_VIS_RIBBON)i_ribbon_ref_sig = input.string("Signal 1", "Ribbon Reference Signal", options=["Signal 1", "Signal 2", "Signal 3"], tooltip="Select which signal's MAs to fill between.", group=GRP_VIS_RIBBON)i_ribbon_opacity = input.int(40, "Ribbon Opacity (Transparency)", minval=0, maxval=90, tooltip="Lower values mean darker/brighter neon effect.", group=GRP_VIS_RIBBON)// 1.5 Dashboard & Misc Settings// ---------------------------------------GRP_VIS_GENERIC = ">>> Visual Settings <<<"i_show_status_val = input.bool(false, "Show Price in Status Line", group=GRP_VIS_GENERIC)GRP_DASHBOARD = ">>> Dashboard Settings <<<"i_dash_enabled = input.bool(true, "Show Dashboard", group=GRP_DASHBOARD)i_dash_pos = input.string("Bottom Right", "Position", options=["Top Right", "Bottom Right", "Top Left", "Bottom Left"], group=GRP_DASHBOARD)i_dash_size = input.string("Small", "Size", options=["Tiny", "Small", "Normal", "Large"], group=GRP_DASHBOARD)// -----------------------------------------------------------------------------// [SECTION 2] Color Definitions (Constants)// -----------------------------------------------------------------------------c_sig01_bull = color.rgb(0, 255, 191)c_sig01_bear = color.rgb(174, 0, 255)c_sig02_bull = color.new(#00ff00, 0)c_sig02_bear = color.new(#dc0af8, 0)c_sig03_bull = color.new(#ffd900, 0)c_sig03_bear = color.new(#ff009d, 0)// -----------------------------------------------------------------------------// [SECTION 3] Calculations (MTF & MA Logic)// -----------------------------------------------------------------------------// Function: Calculate Multi-Timeframe (MTF) MAf_calc_mtf_ma(_src, _len, _tf, _type) => float _ma = na // Determine MA Type if _type == "EMA" _ma := ta.ema(_src, _len) else if _type == "SMA" _ma := ta.sma(_src, _len) else if _type == "VWMA" _ma := ta.vwma(_src, _len) // Volume Weighted else if _type == "VWAP" _ma := ta.vwap(_src) // Anchored VWAP // Request MTF Data request.security(syminfo.tickerid, _tf, _ma, gaps=barmerge.gaps_off, lookahead=barmerge.lookahead_off)// Calculate MAs (1-5)ma01_series = f_calc_mtf_ma(i_ma01_src, i_ma01_len, i_ma01_tf, i_ma01_type)ma02_series = f_calc_mtf_ma(i_ma02_src, i_ma02_len, i_ma02_tf, i_ma02_type)ma03_series = f_calc_mtf_ma(i_ma03_src, i_ma03_len, i_ma03_tf, i_ma03_type)ma04_series = f_calc_mtf_ma(i_ma04_src, i_ma04_len, i_ma04_tf, i_ma04_type)ma05_series = f_calc_mtf_ma(i_ma05_src, i_ma05_len, i_ma05_tf, i_ma05_type)// Function: Resolve Dropdown Selection to Seriesf_resolve_ma_series(_option_str) => float _result = na if _option_str == "MA1" _result := ma01_series else if _option_str == "MA2" _result := ma02_series else if _option_str == "MA3" _result := ma03_series else if _option_str == "MA4" _result := ma04_series else if _option_str == "MA5" _result := ma05_series _result// Strategy Logic: Crossovers & Trend Status// ---------------------------------------// [Logic Update] The 'is_trend_bull' variables now calculate status regardless of the 'enabled' toggle.// This ensures the dashboard always displays correct data. // The 'enabled' toggle is now applied only to the 'trigger' variables for plots and alerts.// Signal 1sig01_fast_ma = f_resolve_ma_series(i_sig01_fast_ref)sig01_slow_ma = f_resolve_ma_series(i_sig01_slow_ref)bool is_data_01 = not na(sig01_fast_ma) and not na(sig01_slow_ma) // Check if data existsis_trend_bull_01 = is_data_01 and (sig01_fast_ma > sig01_slow_ma)is_trend_bear_01 = is_data_01 and (sig01_fast_ma < sig01_slow_ma)trigger_buy_01 = i_sig01_enabled and is_data_01 and ta.crossover(sig01_fast_ma, sig01_slow_ma)trigger_sell_01 = i_sig01_enabled and is_data_01 and ta.crossunder(sig01_fast_ma, sig01_slow_ma)// Signal 2sig02_fast_ma = f_resolve_ma_series(i_sig02_fast_ref)sig02_slow_ma = f_resolve_ma_series(i_sig02_slow_ref)bool is_data_02 = not na(sig02_fast_ma) and not na(sig02_slow_ma)is_trend_bull_02 = is_data_02 and (sig02_fast_ma > sig02_slow_ma)is_trend_bear_02 = is_data_02 and (sig02_fast_ma < sig02_slow_ma)trigger_buy_02 = i_sig02_enabled and is_data_02 and ta.crossover(sig02_fast_ma, sig02_slow_ma)trigger_sell_02 = i_sig02_enabled and is_data_02 and ta.crossunder(sig02_fast_ma, sig02_slow_ma)// Signal 3sig03_fast_ma = f_resolve_ma_series(i_sig03_fast_ref)sig03_slow_ma = f_resolve_ma_series(i_sig03_slow_ref)bool is_data_03 = not na(sig03_fast_ma) and not na(sig03_slow_ma)is_trend_bull_03 = is_data_03 and (sig03_fast_ma > sig03_slow_ma)is_trend_bear_03 = is_data_03 and (sig03_fast_ma < sig03_slow_ma)trigger_buy_03 = i_sig03_enabled and is_data_03 and ta.crossover(sig03_fast_ma, sig03_slow_ma)trigger_sell_03 = i_sig03_enabled and is_data_03 and ta.crossunder(sig03_fast_ma, sig03_slow_ma)// -----------------------------------------------------------------------------// [SECTION 4] Visualization & Plotting// -----------------------------------------------------------------------------var display_setting = i_show_status_val ? display.all : display.pane// Plot Moving Averagesplot(i_ma01_enabled ? ma01_series : na, title="MA 01", color=i_ma01_color, linewidth=2, display=display_setting)plot(i_ma02_enabled ? ma02_series : na, title="MA 02", color=i_ma02_color, linewidth=2, display=display_setting)plot(i_ma03_enabled ? ma03_series : na, title="MA 03", color=i_ma03_color, linewidth=2, display=display_setting)plot(i_ma04_enabled ? ma04_series : na, title="MA 04", color=i_ma04_color, linewidth=2, display=display_setting)plot(i_ma05_enabled ? ma05_series : na, title="MA 05", color=i_ma05_color, linewidth=2, display=display_setting)// Plot Signal Labels (Buy/Sell)plotshape(trigger_buy_01, title="Sig1 Golden", style=shape.labelup, location=location.belowbar, color=c_sig01_bull, text="BUY", textcolor=color.rgb(28, 99, 87), size=size.small)plotshape(trigger_sell_01, title="Sig1 Death", style=shape.labeldown, location=location.abovebar, color=c_sig01_bear, text="SELL", textcolor=color.rgb(255, 255, 255), size=size.small)plotshape(trigger_buy_02, title="Sig2 Golden", style=shape.labelup, location=location.belowbar, color=c_sig02_bull, text="BUY", textcolor=color.rgb(28, 99, 87), size=size.small)plotshape(trigger_sell_02, title="Sig2 Death", style=shape.labeldown, location=location.abovebar, color=c_sig02_bear, text="SELL", textcolor=color.white, size=size.small)plotshape(trigger_buy_03, title="Sig3 Golden", style=shape.labelup, location=location.belowbar, color=c_sig03_bull, text="BUY", textcolor=color.rgb(28, 99, 87), size=size.small)plotshape(trigger_sell_03, title="Sig3 Death", style=shape.labeldown, location=location.abovebar, color=c_sig03_bear, text="SELL", textcolor=color.white, size=size.small)// Gradient Ribbon Logic// ---------------------------------------float v_ribbon_fast = nafloat v_ribbon_slow = nacolor v_ribbon_base_color = na if i_ribbon_ref_sig == "Signal 1" v_ribbon_fast := sig01_fast_ma v_ribbon_slow := sig01_slow_ma v_ribbon_base_color := sig01_fast_ma > sig01_slow_ma ? c_sig01_bull : c_sig01_bearelse if i_ribbon_ref_sig == "Signal 2" v_ribbon_fast := sig02_fast_ma v_ribbon_slow := sig02_slow_ma v_ribbon_base_color := sig02_fast_ma > sig02_slow_ma ? c_sig02_bull : c_sig02_bearelse if i_ribbon_ref_sig == "Signal 3" v_ribbon_fast := sig03_fast_ma v_ribbon_slow := sig03_slow_ma v_ribbon_base_color := sig03_fast_ma > sig03_slow_ma ? c_sig03_bull : c_sig03_bearp_ribbon_fast = plot(i_ribbon_enabled ? v_ribbon_fast : na, "Ribbon Short", display=display.none, editable=false)p_ribbon_slow = plot(i_ribbon_enabled ? v_ribbon_slow : na, "Ribbon Long", display=display.none, editable=false)color c_ribbon_near_fast = color.new(v_ribbon_base_color, i_ribbon_opacity)color c_ribbon_near_slow = color.new(v_ribbon_base_color, math.min(i_ribbon_opacity + 60, 100)) fill(p_ribbon_fast, p_ribbon_slow, v_ribbon_fast, v_ribbon_slow, c_ribbon_near_fast, c_ribbon_near_slow, title="Neon Gradient Ribbon")// Candle Coloring Logic// ---------------------------------------bool v_is_active_bull = falsebool v_is_active_bear = falsecolor v_active_col_bull = nacolor v_active_col_bear = naif i_candle_ref_sig == "Signal 1" v_is_active_bull := is_trend_bull_01 v_is_active_bear := is_trend_bear_01 v_active_col_bull := c_sig01_bull v_active_col_bear := c_sig01_bearelse if i_candle_ref_sig == "Signal 2" v_is_active_bull := is_trend_bull_02 v_is_active_bear := is_trend_bear_02 v_active_col_bull := c_sig02_bull v_active_col_bear := c_sig02_bearelse if i_candle_ref_sig == "Signal 3" v_is_active_bull := is_trend_bull_03 v_is_active_bear := is_trend_bear_03 v_active_col_bull := c_sig03_bull v_active_col_bear := c_sig03_bearcolor v_final_candle_color = naif i_candle_override if v_is_active_bull v_final_candle_color := v_active_col_bull else if v_is_active_bear v_final_candle_color := v_active_col_bear else v_final_candle_color := color.gray // Hide original candles and plot new onescolor c_transparent = color.new(color.white, 100)barcolor(i_candle_override ? c_transparent : na, editable=false)plotcandle(open, high, low, close, title = "Custom Candle", color = v_final_candle_color, wickcolor = v_final_candle_color, bordercolor = v_final_candle_color, editable = true) // -----------------------------------------------------------------------------// [SECTION 5] Dashboard UI// -----------------------------------------------------------------------------// 1. Fetch RSI Data (MTF)rsi_val_240 = request.security(syminfo.tickerid, "240", ta.rsi(close, 14), gaps=barmerge.gaps_off, lookahead=barmerge.lookahead_on)rsi_val_d = request.security(syminfo.tickerid, "D", ta.rsi(close, 14), gaps=barmerge.gaps_off, lookahead=barmerge.lookahead_on)rsi_val_w = request.security(syminfo.tickerid, "W", ta.rsi(close, 14), gaps=barmerge.gaps_off, lookahead=barmerge.lookahead_on)// 2. Helper: RSI Background Colorf_get_rsi_bgcolor(_val) => if na(_val) color.new(color.gray, 80) else if _val <= 30 color.new(#ff1e69, 40) // Oversold (Red) else if _val >= 70 color.new(#0bb682, 40) // Overbought (Green) else color.new(color.white, 100)// 3. Render Dashboard Tableif i_dash_enabled var pos_table = i_dash_pos == "Top Right" ? position.top_right : i_dash_pos == "Bottom Right" ? position.bottom_right : i_dash_pos == "Top Left" ? position.top_left : position.bottom_left var size_table = i_dash_size == "Tiny" ? size.tiny : i_dash_size == "Small" ? size.small : i_dash_size == "Normal" ? size.normal : size.large var table status_table = table.new(pos_table, 2, 7, bgcolor=color.new(color.black, 50), border_color=color.gray, border_width=1, frame_color=color.gray, frame_width=1) // Table Header table.cell(status_table, 0, 0, "Market Status", bgcolor=color.new(color.black, 20), text_color=color.white, text_size=size_table, width=12) table.merge_cells(status_table, 0, 0, 1, 0) // Row 1: Signal 1 Status table.cell(status_table, 0, 1, "Signal 1", text_color=color.white, text_size=size_table, text_halign=text.align_left) bool is_na_01 = not is_data_01 // Check if data exists (already calculated above) string txt_s1 = is_na_01 ? "N/A" : (is_trend_bull_01 ? "BULL" : "BEAR") color bg_s1 = is_na_01 ? color.gray : (is_trend_bull_01 ? c_sig01_bull : c_sig01_bear) table.cell(status_table, 1, 1, txt_s1, bgcolor=color.new(bg_s1, 40), text_color=color.white, text_size=size_table) // Row 2: Signal 2 Status table.cell(status_table, 0, 2, "Signal 2", text_color=color.white, text_size=size_table, text_halign=text.align_left) bool is_na_02 = not is_data_02 string txt_s2 = is_na_02 ? "N/A" : (is_trend_bull_02 ? "BULL" : "BEAR") color bg_s2 = is_na_02 ? color.gray : (is_trend_bull_02 ? c_sig02_bull : c_sig02_bear) table.cell(status_table, 1, 2, txt_s2, bgcolor=color.new(bg_s2, 40), text_color=color.white, text_size=size_table) // Row 3: Signal 3 Status table.cell(status_table, 0, 3, "Signal 3", text_color=color.white, text_size=size_table, text_halign=text.align_left) bool is_na_03 = not is_data_03 string txt_s3 = is_na_03 ? "N/A" : (is_trend_bull_03 ? "BULL" : "BEAR") color bg_s3 = is_na_03 ? color.gray : (is_trend_bull_03 ? c_sig03_bull : c_sig03_bear) table.cell(status_table, 1, 3, txt_s3, bgcolor=color.new(bg_s3, 40), text_color=color.white, text_size=size_table) // Row 4: RSI (4H) table.cell(status_table, 0, 4, "RSI (4H)", text_color=color.white, text_size=size_table, text_halign=text.align_left) color bg_rsi_240 = f_get_rsi_bgcolor(rsi_val_240) string txt_rsi_240 = na(rsi_val_240) ? "N/A" : str.tostring(rsi_val_240, "#.##") table.cell(status_table, 1, 4, txt_rsi_240, bgcolor=bg_rsi_240, text_color=color.white, text_size=size_table) // Row 5: RSI (Daily) table.cell(status_table, 0, 5, "RSI (1D)", text_color=color.white, text_size=size_table, text_halign=text.align_left) color bg_rsi_d = f_get_rsi_bgcolor(rsi_val_d) string txt_rsi_d = na(rsi_val_d) ? "N/A" : str.tostring(rsi_val_d, "#.##") table.cell(status_table, 1, 5, txt_rsi_d, bgcolor=bg_rsi_d, text_color=color.white, text_size=size_table) // Row 6: RSI (Weekly) table.cell(status_table, 0, 6, "RSI (1W)", text_color=color.white, text_size=size_table, text_halign=text.align_left) color bg_rsi_w = f_get_rsi_bgcolor(rsi_val_w) string txt_rsi_w = na(rsi_val_w) ? "N/A" : str.tostring(rsi_val_w, "#.##") table.cell(status_table, 1, 6, txt_rsi_w, bgcolor=bg_rsi_w, text_color=color.white, text_size=size_table)// -----------------------------------------------------------------------------// [SECTION 6] Alert Conditions// -----------------------------------------------------------------------------alertcondition(trigger_buy_01, title="Signal 1 Golden Cross", message="Signal1: Golden Cross")alertcondition(trigger_sell_01, title="Signal 1 Death Cross", message="Signal1: Death Cross")alertcondition(trigger_buy_02, title="Signal 2 Golden Cross", message="Signal2: Golden Cross")alertcondition(trigger_sell_02, title="Signal 2 Death Cross", message="Signal2: Death Cross")alertcondition(trigger_buy_03, title="Signal 3 Golden Cross", message="Signal3: Golden Cross")alertcondition(trigger_sell_03, title="Signal 3 Death Cross", message="Signal3: Death Cross")alertcondition(trigger_buy_01 or trigger_buy_02 or trigger_buy_03, title="Any Golden Cross", message="MA signal: Golden Cross")alertcondition(trigger_sell_01 or trigger_sell_02 or trigger_sell_03, title="Any Death Cross", message="MA signal: Death Cross")
프로필 이미지
매치다2
2025-12-19
1083
글번호 229225
지표
답변완료

수식 부탁합니다.

안녕하세요.아래 지표 변환부탁 합니다.//@version=5indicator("Transient Zones v1.1 [v5 Upgrade]", "TZ v5", overlay=true)// --- Inputs ---h_left = input.int(10, title="H left")h_right = input.int(10, title="H right")sample_period = input.int(5000, title="Sample bars for % TZ")show_ptz = input.bool(true, title="Show PTZ")show_channel = input.bool(true, title="Show channel")// --- PTZ (Potential Transient Zones) Logic ---// 현재 바가 왼쪽 h_left 기간 동안의 최고/최저인지 확인h_left_low = ta.lowest(low, h_left)h_left_high = ta.highest(high, h_left)newlow = low <= h_left_low[1]newhigh = high >= h_left_high[1]// PTZ 시각화 (실시간으로 나타났다 사라질 수 있음)plotshape(newlow and show_ptz, style=shape.triangledown, location=location.belowbar, color=color.red, title="PTZ Low")plotshape(newhigh and show_ptz, style=shape.triangleup, location=location.abovebar, color=color.green, title="PTZ High")// 채널 그리기plot(show_channel ? h_left_low : na, color=color.new(color.silver, 50), title="Channel Low")plot(show_channel ? h_left_high : na, color=color.new(color.silver, 50), title="Channel High")// --- True TZ (Transient Zones) Logic ---// 과거 h_right만큼 시간이 지난 뒤, 해당 지점이 실제로 고점/저점이었는지 확인central_bar_low = low[h_right]central_bar_high = high[h_right]full_zone_low = ta.lowest(low, h_left + h_right + 1)full_zone_high = ta.highest(high, h_left + h_right + 1)central_bar_is_highest = central_bar_high >= full_zone_highcentral_bar_is_lowest = central_bar_low <= full_zone_low// True TZ 시각화 (h_right만큼 뒤로 밀어서 표시)plotarrow(central_bar_is_highest ? -1 : 0, offset=-h_right, colorup=color.green, colordown=color.red, title="Confirmed TZ")plotarrow(central_bar_is_lowest ? 1 : 0, offset=-h_right, colorup=color.green, colordown=color.red, title="Confirmed TZ")// --- Probability Calculations ---// TZ 카운트high_bar_tz_count = ta.cum(central_bar_is_highest ? 1 : 0)low_bar_tz_count = ta.cum(central_bar_is_lowest ? 1 : 0)total_tz = high_bar_tz_count + low_bar_tz_count// PTZ 카운트high_bar_ptz_count = ta.cum(newhigh ? 1 : 0)low_bar_ptz_count = ta.cum(newlow ? 1 : 0)total_ptz = high_bar_ptz_count + low_bar_ptz_count// 통계 데이터 계산 (차트 하단 데이터 창에서 확인 가능)percent_total_tz = (total_tz / sample_period) * 100percent_total_ptz = (total_ptz / sample_period) * 100percent_ptz_resolved = (1 - (total_tz / (total_ptz > 0 ? total_ptz : 1))) * 100// 데이터 출력을 위한 투명 플롯 (Data Window 전용)plot(percent_total_tz, color=color.new(color.black, 100), title="Total TZ %", display=display.data_window)plot(percent_total_ptz, color=color.new(color.navy, 100), title="Total PTZ %", display=display.data_window)plot(percent_ptz_resolved, color=color.new(color.gray, 100), title="PTZ Resolved %", display=display.data_window)
프로필 이미지
newstory
2025-12-19
315
글번호 229224
지표
답변완료

지표 수정 부탁드립니다.

2025-10-23 15:32:53 글번호 227236 수식 수정 부탁드립니다. 1. 전환선과 기준선, 2. 전환선과 후행스팬2, 3. 기준선과 후행스팬2, 4. 전환선과 60이평선, 5. 기준선과 60이평선, 6. 후행스팬과 60이평선, G.C와 D.C시 수평선이 발생봉의 종가에 수평선이 그려지고 있는데 G.C, D.C의 위치에 정확하게 수평선이 위치하도록 수정해 주시면 감사하겠습니다.
프로필 이미지
대박월천
2025-12-19
257
글번호 229222
지표
답변완료

지표 부탁 드립니다

// This Pine Script™ code is subject to the terms of the Mozilla Public License 2.0 at https://mozilla.org/MPL/2.0/// © khbajakoa91d88c9b75847d0//@version=5indicator("Net Liquidity signal")// BUYING VOLUME AND SELLING VOLUME //buyVolume = high == low ? 0 : volume * (close - low) / (high - low)sellVolume = -(high == low ? 0 : volume * (high - close) / (high - low))netVolume = buyVolume + sellVolumeplot(volume, style=plot.style_columns, color=#00897B46, title="UPPER V") // shows whole volume aboveplot(-volume, style=plot.style_columns, color=#FF525246, title="LOWER V") // shows whole volume belowplot(sellVolume, style=plot.style_columns, color=color.red, title="SELL V") // shows sell volumeplot(buyVolume, style=plot.style_columns, color=color.teal, title="BUY V") // shows buy volumeplot(netVolume, style=plot.style_columns, color=netVolume > 0 ? color.rgb(9, 237, 55) : color.red, title='net') // shows buy volumeb = netVolume > 0 ? netVolume : 0length1=input(2,"BuyMaMult")BL=input(22,"BuyMaLength")mab = length1*ta.sma(b, BL)plot(mab)s = netVolume < 0 ? netVolume : 0length=input(2,"SellMaMult")SL=input(22,"SellMaLength")mas = length*ta.sma(s, SL)plot(mas)cum=math.sum(netVolume,10)//plot(cum,color=color.white)long=netVolume>mab and netVolume[1]<0 and netVolume[2]<0 and netVolume>-(netVolume[1])and netVolume[1]>netVolume[2]short=netVolume<mas and netVolume[1]>0 and netVolume[2]>0 and -netVolume>(netVolume[1])and netVolume[1]<netVolume[2]plotshape(long ,location=location.bottom,size=size.small,style=shape.triangleup,color=color.green)plotshape(short ,location=location.top,size=size.small,style=shape.triangledown,color=color.red)alertcondition(long,"Buy")alertcondition(short,"Sell")no=input(3,"no of candles")plot(math.sum(netVolume,no),color=color.yellow)
프로필 이미지
매치다2
2025-12-19
906
글번호 229221
지표
답변완료

지표 부탁 드립니다

//@version=6indicator("GK Zero-Lag Major BOS Trend", overlay=true)len = input.int(34, "Zero-Lag Length")bosLen = input.int(20, "Major BOS Lookback")lag = math.floor((len - 1) / 2)src = close + (close - nz(close[lag], close))zlem = ta.ema(src, len)prevHigh = ta.highest(high, bosLen)[1]prevLow = ta.lowest(low, bosLen)[1]trendUp = zlem > zlem[1]trendDn = zlem < zlem[1]bullBos = trendUp and close > prevHighbearBos = trendDn and close < prevLowplot(zlem, "Zero-Lag", color = trendUp ? color.teal : color.maroon, linewidth = 2)plotshape(bullBos, title="GK BUY", text="GK BUY", style=shape.labelup, location=location.belowbar, color=color.teal, textcolor=color.white, size=size.small)plotshape(bearBos, title="GK SELL", text="GK SELL", style=shape.labeldown, location=location.abovebar, color=color.red, textcolor=color.white, size=size.small)
프로필 이미지
매치다2
2025-12-19
153
글번호 229220
지표
답변완료

수식부탁드립니다.

코스피200 선물 08:45 장시작 후 08:47까지 2분 동안 진폭의 배수를 점선(다양한 선과 굵기, 색상 선택 가능하도록)으로 표시 부탁드립니다.* 고점라인과 저점라인 각 15개의 점선 표시 * 예를들어 장시작 후 2분간의 진폭이 2.0p이고 선물지수가570~572였다면 - 고점 위 572, 574, 576, 578, 580......(15개) - 저점아래 570, 568, 566, 564, 562.....(15개) 위와 같이 분틱챠트에 매일 반복 생성되게 해주시구요. 지난 챠트에도 계속 표시되어 있게 부탁드립니다. 항상 고맙습니다.^^
프로필 이미지
대박월천
2025-12-19
132
글번호 229219
지표
답변완료

종목검색식으로 변환 부탁드립니다.

[일]거래대금(일:백만) 10000 이상 주가등락률:[일]1봉전(중) 종가대비 0봉전 종가등락률 0%이상최고종가:[주]ㅇ봉전 종가가 299봉중 최고종가주가등락률:[일]1봉전(중) 종가대비 ㅐ봉전 시가등락률 4.5%이하
프로필 이미지
까르멘
2025-12-19
126
글번호 229216
종목검색
답변완료

종목검색식으로 변환 부탁드립니다.

[일]0봉전 이평(단순 20) 종가가 상한선대비 0%이상[일]0봉전 Bollinger Band(20, 2) 종가가 상한선이상[일]0봉전 Bollinger Band(240, 2) 종가가 상한선이상[일]0봉전 이평(단순 240) 종가가 상한선대비 0%이상최고종가:[일]0봉전 종가가 299봉중 최고종가주가비교:[일]0봉전 (고가+저가)/2 <0봉전 종가
프로필 이미지
까르멘
2025-12-19
110
글번호 229215
종목검색
답변완료

지표부탁드립니다.

지지 · 저항 지표 제작 요청이평선 / 전저·전고점 / 마디존 기반 지지·저항 지표■ 공통사용 이평선: 5, 20, 60, 120, 240정배열 / 역배열 기준: 이평선 위치 기준이평선 턴 기준: 기울기 방향 전환 (+→- / -→+)■ 지지1. 이평선 지지 5 > 20 정배열 상승 구간에서 → 5이평선이 상승 → 하락으로 턴할 때, 하단 20이평선을 지지로 인식 20 > 60 정배열 상승 구간에서 → 20이평선이 상승 → 하락으로 턴할 때, 하단 60이평선을 지지로 인식 60 > 240 정배열 상승 구간에서 → 60이평선이 상승 → 하락으로 턴할 때, 하단 240이평선을 지지로 인식2. 전저점 지지 5와 20 골든크로스 발생 후 → 이후 다시 데드크로스가 발생하여 하락할 때 → 첫 골든크로스 발생 봉을 포함한 직전 조정 구간의 최저가를 전저점으로 인식 20과 60 골든크로스도 동일 로직 적용3. 마디존 지지 (20N 패턴) 20이평선이 상승 → 하락 → 재상승 (N자 패턴) 형성 시 해당 N자 구간의 20이평선 고점 20이평선 저점 두 값의 평균을 마디존 지지선으로 인식■ 저항1. 이평선 저항 5 < 20 역배열 하락 구간에서 → 5이평선이 하락 → 상승으로 턴할 때, 상단 20이평선을 저항으로 인식 20 < 60 역배열 하락 구간에서 → 20이평선이 하락 → 상승으로 턴할 때, 상단 60이평선을 저항으로 인식 60 < 240 역배열 하락 구간에서 → 60이평선이 하락 → 상승으로 턴할 때, 상단 240이평선을 저항으로 인식2. 전고점 저항 5와 20 데드크로스 발생 후 → 이후 다시 골든크로스가 발생하여 상승할 때 → 첫 데드크로스 발생 봉을 포함한 직전 상승 구간의 최고가를 전고점으로 인식 20과 60 데드크로스도 동일 로직 적용3. 마디존 저항 마디존1 (20 역N 패턴) 20이평선이 하락 → 상승 → 재하락 (역N자 패턴) 형성 시 해당 구간의 20이평선 고점과 저점 평균값을 저항선으로 인식 마디존2 (가격 단위 마디) 지수: 100포인트 단위 선물: 10포인트 단위 주식: 1만원 미만: 1,000원 단위 1만원 ~ 10만원: 10,000원 단위 10만원 이상: 100,000원 단위 현재가 기준 가장 가까운 단위 가격(반올림 또는 버림, 구현 가능 방식 사용)
프로필 이미지
오늘도수익
2025-12-19
297
글번호 229214
지표