커뮤니티
예스랭귀지 Q&A
답변완료
[공지] 예스랭귀지 AI 어시스턴트, '예스나 AI' 출시 및 무료 체험 안내
안녕하세요, 예스스탁 입니다.복잡한 수식 공부 없이 여러분의 아이디어를 말하면 시스템 트레이딩 언어 예스랭귀지로 작성해주는 서비스예스나 AI(YesNa AI)가 출시되었습니다.지금 예스나 AI를 직접 경험해 보실 수 있도록 20크레딧(질문권 20회)를 무료로 증정해 드리고 있습니다.바로 여러분의 아이디어를 코드로 변환해보세요.--------------------------------------------------🚀 YesNa AI 핵심 기능- 지표식/전략식/종목검색식 생성: 자연어로 요청하면 예스랭귀지 문법에 맞는 코드를 작성합니다.- 종목검색식 변환 지원: K증권의 종목 검색식을 예스랭귀지로 변환 지원합니다.- 컴파일 검증: 작성된 코드가 실행 가능한지 컴파일러를 통해 문법 검증을 거쳐 결과물을 제공합니다.상세한 서비스 개요 및 활용 방법은 [서비스 소개 페이지]에서 확인하실 수 있습니다.▶ 서비스 소개 페이지: 바로가기서비스 사용 유의사항 및 결제 환불정책은 [이용약관]을 참고 부탁드립니다.▶ 서비스 이용약관: 바로가기💬 이용 문의사용 중 문의사항은 [프로그램 사용법 Q&A] 게시판에서 [예스나 AI] 카테고리를 설정 후 문의해 주시면 상세히 안내해 드리겠습니다.--------------------------------------------------앞으로도 AI를 활용한 다양한 트레이딩 기능들을 지속적으로 선보일 예정입니다.많은 관심과 기대 부탁드립니다.
2026-02-27
1507
글번호 230811
답변완료
종목검색식 요청드립니다.
아래 2가지에 대한 지표변환과 종목검색식 부탁드립니다. 항상 감사합니다.1. 아래 키움수식라인을 예스랭귀지 지표로 변환 부탁드리고, 아래라인을 N동 이내에 돌파한 종목을 검색하는 검색식도 부탁드립니다. *키움수식라인 M=(C+이전주종가(1)+이전주종가(2)+이전주종가(3)+이전주종가(4)+ 이전주종가(5)+이전주종가(6)+이전주종가(7)+이전주종가(8)+ 이전주종가(9))/10;2. 아래키움수식의 지표와 종목검색식 부탁드립니다.* 키움수식BU=BBandsUp(20,2);((CrossUp(C, BU))or(C>BU))&&BandWidth(20,2.0)>0.2&&MFI(20)>70&&RSI(14)>50&&((highest(C(1), 20) < C)OR(highest(V(1), 20) < V))
2025-12-20
180
글번호 229228
답변완료
종목검색식으로 부탁드립니다.
조건1_상승 = (C - ref(C,1)) / ref(C,1) >= 0.15;조건1_60최고 = H == Highest(H, 60);조건1 = 조건1_60최고 && 조건1_상승 && barssince(조건1_60최고 && 조건1_상승) <= 봉수1;조건1최고가 = Valuewhen(1, 조건1_60최고 && 조건1_상승, H);조건2_근접 = ABS(H - 조건1최고가) / 조건1최고가 <= 0.02;조건2_상승 = (C - ref(C,1)) / ref(C,1) >= 0.15;조건2_시간 = barssince(조건1_60최고 && 조건1_상승) <= 봉수2;조건2 = 조건2_근접 && 조건2_상승 && 조건2_시간;CC = barssince(조건2);DD = countsince(CC==0, 조건2);신호_첫발생 = 조건2 && DD == 1;if(신호_첫발생, H + 1, 0)
2025-12-20
151
글번호 229227
답변완료
문의드립니다.
지난번에 주신 아래의 수식을 5분봉차트에서 '1시간봉의 아래의 지표'가 표현되게 하고자 합니다. 5분봉에서 30분의 아래지표를 또는 5분붕에서 2시간봉차트의 아래지표를 적용할 수 있게 하는 등 시간프레임을 변경할 수 있게 수식을 수정부탁드립니다. 도와주셔서 항상 감사드립니다. 수고하세요!!! input : BB_len(2),BB_mult(2);input : BB상단굵기(1),BB중단굵기(1),BB하단굵기(1);var : src_bb(0),basis(0),dev(0),upperBB(0),lowerBB(0);var : sellBB(False),Buybb(False);sellBB = high >= upperBB;buyBB = low <= lowerBB;input : Period1(4),mult1(0.2),st1굵기(1);input : Period2(6),mult2(1.2),st2굵기(1);input : Period3(7),mult3(1.4),st3굵기(1);var : alpha1(0),a1(0),s1(0),u1(0),d1(0),up1(0),dn1(0),tr1(1);var : alpha2(0),a2(0),s2(0),u2(0),d2(0),up2(0),dn2(0),tr2(1);var : alpha3(0),a3(0),s3(0),u3(0),d3(0),up3(0),dn3(0),tr3(1);var : st1(0),st2(0),st3(0);src_bb = open;basis = ma(src_bb, bb_len);dev = std(src_bb, bb_len);upperBB = basis + bb_mult * dev;lowerBB = basis - bb_mult * dev;plot1(upperBB, "BB Upper", red,Def,BB상단굵기);plot2(basis, "BB Basis", orange,Def,BB중단굵기); plot3(lowerBB, "BB Lower", blue,Def,BB하단굵기);alpha1 = 1 / period1;a1 = IFf(IsNan(a1[1]) == true, ma(TrueRange,period1) , alpha1 * TrueRange + (1 - alpha1) * IFf(isnan(a1[1])==true,0,a1[1]));s1 = (h+l)/2;u1 = s1 - mult1 * a1;d1 = s1 + mult1 * a1;Up1 = iff(close[1] > iff(IsNan(Up1[1])==true,0,Up1[1]) , max(u1, iff(IsNan(Up1[1])==true,0,Up1[1])) , u1);Dn1 = iff(close[1] < iff(IsNan(Dn1[1])==true,0,Dn1[1]) , min(d1, iff(IsNan(Dn1[1])==true,0,Dn1[1])) , d1);tr1 = iff(close > iff(IsNan(Dn1[1])==true,0,Dn1[1]) , 1 ,IFf(close < iff(IsNan(Up1[1])==true,0,Up1[1]) , -1 , tr1));alpha2 = 1 / period2;a2 = IFf(IsNan(a2[1]) == true, ma(TrueRange,period2) , alpha2 * TrueRange + (1 - alpha2) * IFf(isnan(a2[1])==true,0,a2[1]));s2 = (h+l)/2;u2 = s2 - mult2 * a2;d2 = s2 + mult2 * a2;Up2 = iff(close[1] > iff(IsNan(Up2[1])==true,0,Up2[1]) , max(u2, iff(IsNan(Up2[1])==true,0,Up2[1])) , u2);Dn2 = iff(close[1] < iff(IsNan(Dn2[1])==true,0,Dn2[1]) , min(d2, iff(IsNan(Dn2[1])==true,0,Dn2[1])) , d2);tr2 = iff(close > iff(IsNan(Dn2[1])==true,0,Dn2[1]) , 1 ,IFf(close < iff(IsNan(Up2[1])==true,0,Up2[1]) , -1 , tr2));alpha3 = 1 / period3;a3 = IFf(IsNan(a3[1]) == true, ma(TrueRange,period3) , alpha3 * TrueRange + (1 - alpha3) * IFf(isnan(a3[1])==true,0,a3[1]));s3 = (h+l)/2;u3 = s3 - mult3 * a3;d3 = s3 + mult3 * a3;Up3 = iff(close[1] > iff(IsNan(Up3[1])==true,0,Up3[1]) , max(u3, iff(IsNan(Up3[1])==true,0,Up3[1])) , u3);Dn3 = iff(close[1] < iff(IsNan(Dn3[1])==true,0,Dn3[1]) , min(d3, iff(IsNan(Dn3[1])==true,0,Dn3[1])) , d3);tr3 = iff(close > iff(IsNan(Dn3[1])==true,0,Dn3[1]) , 1 ,IFf(close < iff(IsNan(Up3[1])==true,0,Up3[1]) , -1 , tr3));st1 = iff(tr1 == 1 , up1 , dn1 );st2 = iff(tr2 == 1 , up2 , dn2 );st3 = iff(tr3 == 1 , up3 , dn3);plot4(st1, "ST1", iff(tr1 == 1 , green , red),Def,st1굵기);plot5(st2, "ST2", iff(tr2 == 1 , green , red),Def,st2굵기);plot6(st3, "ST3", iff(tr3 == 1 , green , red),Def,st3굵기);var : allAbove(False),allBelow(False);var : regime(0),prevRegime(0);var : bullStart(False),bearStart(False);var : buySignal(False),SellSignal(False);var : tx1(0),tx2(0);allAbove = close > st1 and close > st2 and close > st3;allBelow = close < st1 and close < st2 and close < st3;prevRegime = regime;if allAbove Then regime = 1;if allBelow Then regime = -1;bullStart = regime == 1 and prevRegime != 1 ;bearStart = regime == -1 and prevRegime != -1;if bullStart Then{ tx1 = text_new(sDate,sTime,L,"Bull"); Text_SetStyle(tx1,2,0); Text_SetColor(tx1,Green);}if bearStart Then{ tx1 = text_new(sDate,sTime,H,"Bear"); Text_SetStyle(tx1,2,1); Text_SetColor(tx1,Red);}buySignal = (regime == 1) and buyBB ;sellSignal = (regime == -1) and sellBB;if buySignal Then{ tx2 = text_new(sDate,sTime,L,"▲"); Text_SetStyle(tx2,2,0); Text_SetColor(tx2,Green);}if sellSignal Then{ tx2 = text_new(sDate,sTime,H,"▼"); Text_SetStyle(tx2,2,1); Text_SetColor(tx2,Red);}
2025-12-20
191
글번호 229226
답변완료
부탁 드려 봅니다 넘 길이가 길어서 죄송한다
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")
2025-12-19
1861
글번호 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)
2025-12-19
402
글번호 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
319
글번호 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)
2025-12-19
1500
글번호 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)
2025-12-19
188
글번호 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
176
글번호 229219