커뮤니티
예스랭귀지 Q&A
답변완료
[공지] 예스랭귀지 AI 어시스턴트, '예스나 AI' 출시 및 무료 체험 안내
안녕하세요, 예스스탁 입니다.복잡한 수식 공부 없이 여러분의 아이디어를 말하면 시스템 트레이딩 언어 예스랭귀지로 작성해주는 서비스예스나 AI(YesNa AI)가 출시되었습니다.지금 예스나 AI를 직접 경험해 보실 수 있도록 20크레딧(질문권 20회)를 무료로 증정해 드리고 있습니다.바로 여러분의 아이디어를 코드로 변환해보세요.--------------------------------------------------🚀 YesNa AI 핵심 기능- 지표식/전략식/종목검색식 생성: 자연어로 요청하면 예스랭귀지 문법에 맞는 코드를 작성합니다.- 종목검색식 변환 지원: K증권의 종목 검색식을 예스랭귀지로 변환 지원합니다.- 컴파일 검증: 작성된 코드가 실행 가능한지 컴파일러를 통해 문법 검증을 거쳐 결과물을 제공합니다.상세한 서비스 개요 및 활용 방법은 [서비스 소개 페이지]에서 확인하실 수 있습니다.▶ 서비스 소개 페이지: 바로가기서비스 사용 유의사항 및 결제 환불정책은 [이용약관]을 참고 부탁드립니다.▶ 서비스 이용약관: 바로가기💬 이용 문의사용 중 문의사항은 [프로그램 사용법 Q&A] 게시판에서 [예스나 AI] 카테고리를 설정 후 문의해 주시면 상세히 안내해 드리겠습니다.--------------------------------------------------앞으로도 AI를 활용한 다양한 트레이딩 기능들을 지속적으로 선보일 예정입니다.많은 관심과 기대 부탁드립니다.
2026-02-27
1548
글번호 230811
답변완료
수식 문의드립니다.
안녕하세요 수식 문의드립니다.
이동평균선 기울기가 변할 때 화살표가 나오는데
1 부터 5 까지 이평 기울기 중에
5 개 기울기가 모두 같은 방향일 때
화살표가 나오게 부탁드립니다.
감사합니다. ^^
2025-05-16
239
글번호 190857
답변완료
종목검색 문의 드립니다
예스 지표수식 입니다 지표에서 골든 크로스 종목검색 문의드립니다
input : P(20);
var1 = ma(H,P);
Var2 = ma(L,P);
if C > var1 Then
Var3 = 1;
if C < Var2 Then
Var3 = -1;
value1 = IFf(Var3 < 0,var1,Var2);
value2 = IFf(Var3 < 0,var2,Var1);
Plot1(value1,"1",Blue);
plot2(Value2,"2",Red);
2025-05-15
245
글번호 190856
답변완료
부탁드립니다.
조건식을 만들려고 하는데
aa= 직전 20봉 고가중에 고가;
bb= 직전 20봉 저가중에 저가
1. 직전 10봉 안에 종가가 bb[1] 아래로 내려간적이 있다.
2. 직전 10봉 안에 종가가 aa[1] 위로 올라간적이 있다.
과거 10봉안의 종가, 그리고 그 봉에서의 aa[1],bb[1]가 달라져야될 것 같은데 그 수식작성을 모르겠습니다. 부탁드립니다.
2025-05-15
251
글번호 190855
사공하늘 님에 의해서 삭제되었습니다.
2025-05-15
95
글번호 190854
답변완료
후행스팬 60이평 돌파
안녕하세요, 도움 감사드립니다.
키움HTS에서 지표로 사용하고 있는, 후행스팬이 지수60이평 돌파시의 신호입니다.
M=shift(close,-midPeriod+1);
Crossup(M,eavg(M,60,25))
지표변수 - midperiod 26
이것을 종목검색으로 변환 부탁드립니다.
2025-05-15
341
글번호 190853
답변완료
지표 변환 부탁드립니다.
//@version=6
//-----------------------------------------------------------------------------
// NeuroTrend – Adaptive AI Trend Engine
//
//:
// NeuroTrend is an adaptive, AI-assisted trend indicator designed for momentum
// and swing trading. It uses dynamic EMAs, slope forecasting, neural memory,
// and a trend classification engine to deliver real-time insights. The system
// includes confidence scoring, reversal detection, and a premium visual dashboard.
//
// Key Features:
// • Adaptive EMA smoothing based on volatility and momentum conditions
// • Real-time slope angle, power, and projected trend forecasts
// • Neural memory system for volatility-aware threshold calibration
// • Classification of trend phases: Impulse, Cooling, Reversal, Stall, Neutral
// • Confidence score derived from DMI, slope, and volatility ratio
// • Reversal and stall zone detection with alert labeling
// • AI-style commentary with smart coaching logic
// • Compact dashboard with all trend diagnostics in one view
//
// Usage:
// Best used to time entries
// into strong trend conditions, confirm trend continuation, or detect exhaustion
// before reversals.
//
// Author: AresIQ
// License: Mozilla Public License 2.0
// Terms: This open-source 스크립트 may be modified and reused with attribution.
//
// Link to License: https://www.mozilla.org/en-US/MPL/2.0/
//-----------------------------------------------------------------------------
indicator("NeuroTrend", overlay=true)
// USER INPUTS ₩₩
enableReflex = input.bool(false, "Enable Reflex Mode", inline="reflex", group="Turbo Mode")
showCommentary = input.bool(true, "Show AI Commentary", inline="ai", group="Neuro Settings")
tablePosition = input.string("Top Right", "Dashboard Position", options=["Top Left", "Top Middle", "Top Right", "Bottom Left", "Bottom Middle", "Bottom Right"], group="Neuro Settings")
pos = tablePosition == "Top Left" ? position.top_left :
tablePosition == "Top Middle" ? position.top_center :
tablePosition == "Top Right" ? position.top_right :
tablePosition == "Bottom Left" ? position.bottom_left :
tablePosition == "Bottom Middle" ? position.bottom_center :
position.bottom_right
commentaryTextColor = input.color(color.white, "Commentary Text Color", inline="commentaryColor", group="Neuro Settings")
tableTextColor = input.color(color.white, "Dashboard Text Color", group="Neuro Settings")
baseFast = input.int(10, "Base Fast EMA")
baseSlow = input.int(21, "Base Slow EMA")
showConfidence = input.bool(true, "Show Confidence Score", inline="conf", group="Neuro Settings")
showReversal = input.bool(true, "Show Reversal Warnings", inline="rev", group="Neuro Settings")
showStall = input.bool(true, "Show Stall Alerts", inline="stall", group="Neuro Settings")
showProjection = input.bool(true, "Show Slope Projection", inline="proj", group="Neuro Settings")
enableAlerts = input.bool(true, "Enable Smart Alerts", inline="alerts", group="Alerts")
// CUSTOM ALERT BUILDER ₩₩
customEnableAlerts = input.bool(false, "Enable Custom Alerts", group="Alerts")
customMinConfidence = input.int(60, "Min Confidence", minval=0, maxval=100, group="Alerts")
customRequireImpulse = input.bool(true, "Require Impulse", group="Alerts")
customRequireBullish = input.bool(false, "Only Bullish Trends", group="Alerts")
customRequireBearish = input.bool(false, "Only Bearish Trends", group="Alerts")
customBlockReversal = input.bool(true, "Ignore Reversal Risk", group="Alerts")
customBlockStall = input.bool(false, "Ignore Stall", group="Alerts")
// SESSION PHASE DETECTION ₩₩
hourNow = hour(time)
minuteNow = minute(time)
sessionMinute = (hourNow - 9) * 60 + minuteNow - 30 // 0 at 9:30 AM
sessionPhase = sessionMinute < 90 ? "⏰ Morning Drive" :
sessionMinute < 270 ? "😴 Midday Drift" :
sessionMinute <= 390 ? "⚡ Power Hour" :
"⏳ After Hours"
// CONTEXT ₩₩
atr = ta.atr(14)
rsi = ta.rsi(close, 14)
volFactor = atr / close
momentumFactor = (rsi - 50) / 100
// ADAPTIVE LENGTHS ₩₩
fastLen = enableReflex ? baseFast * 0.75 : baseFast - volFactor * 5 + momentumFactor * 5
slowLen = enableReflex ? baseSlow * 0.85 : baseSlow + volFactor * 5 - momentumFactor * 5
alphaFast = 2.0 / (fastLen + 1.0)
alphaSlow = 2.0 / (slowLen + 1.0)
// ADAPTIVE EMA FUNCTION ₩₩
adaptiveEMA(src, alpha) =>
var float result = na
result := na(result[1]) ? src : alpha * src + (1 - alpha) * result[1]
// EMAS ₩₩
emaFast = adaptiveEMA(close, alphaFast)
emaSlow = adaptiveEMA(close, alphaSlow)
// SLOPE METRICS ₩₩
slopeDeg = math.atan(emaFast - emaSlow) * 180 / math.pi
slopePower = enableReflex ? slopeDeg * (1 + volFactor * 0.5 + momentumFactor * 1.5) : slopeDeg * (1 + volFactor + momentumFactor)
glowIntensity = math.min(math.abs(slopePower), 50)
// COLOR ENGINE ₩₩
baseColor = slopePower > 0 ? color.rgb(38, 230, 0) : color.rgb(168, 45, 36)
// RENDER LAYERS ₩₩
glowBase = slopePower > 0 ? color.rgb(80, 255, 100) : color.rgb(255, 70, 70)
coreColor = color.new(glowBase, 0)
glow1 = color.new(glowBase, 75)
glow2 = color.new(glowBase, 85)
shadowTrail = color.new(glowBase, 92)
plot(emaFast, title="Fast EMA Core", color=coreColor, linewidth=3)
plot(emaFast, title="Glow Layer 1", color=glow1, linewidth=6)
plot(emaFast, title="Glow Layer 2", color=glow2, linewidth=9)
plot(emaSlow, title="Slow EMA", color=color.new(glowBase, 80), linewidth=2)
plot(emaFast[5], title="Shadow Trail", color=shadowTrail, linewidth=1, style=plot.style_line)
// FILLS ₩₩
fill(plot(emaFast), plot(emaSlow), color=color.new(glowBase, 90), title="Trend Ribbon Fill")
// NEURAL MEMORY ENGINE ₩₩
atrMemory = ta.sma(atr, enableReflex ? 20 : 50)
slopeStdDev = ta.stdev(slopePower, enableReflex ? 20 : 50)
volatilityState = (atr / atrMemory + slopeStdDev / 30) / 2
volatilityFactor = math.min(math.max(volatilityState, 0.5), 1.5)
// Auto-calibrated thresholds
impulseThreshold = 40 * volatilityFactor
coolingThreshold = 20 * volatilityFactor
stallSlopeLimit = 10 * volatilityFactor
rsiFlatMin = 48 - (5 * (volatilityFactor - 1))
rsiFlatMax = 52 + (5 * (volatilityFactor - 1))
// TREND STATE CLASSIFIER ₩₩
isImpulse = math.abs(slopePower) > impulseThreshold
isCooling = math.abs(slopePower) > coolingThreshold and math.abs(slopePower) <= impulseThreshold
isNeutral = math.abs(slopePower) <= 20
isReversal = ta.change(slopeDeg, 1) < -30 or ta.rsi(close, 14) < 40
trendDir = slopePower > 0 ? "Bullish" : "Bearish"
// TREND AGE & DECAY ₩₩
var int trendAge = 0
trendAge := trendDir == trendDir[1] ? trendAge + 1 : 1
decayFactor = math.max(1.0 - trendAge / 100, 0.5) // Caps decay at 50%
trendColor = slopePower > 0 ? color.lime : color.red
phaseText = isImpulse ? "🔥 Impulse" : isCooling ? "🌀 Cooling" : isReversal ? "⚠️ Reversal Risk" : "⛔ Neutral"
// PHASE MEMORY ENGINE ₩₩
var string prevPhase = na
phaseChanged = not na(prevPhase) and phaseText != prevPhase
prevPhase := phaseText
slopeScore = math.round(math.abs(slopePower) * 2)
// CONFIDENCE SCORING ENGINE ₩₩
[plusDI, minusDI, adx] = ta.dmi(14, 14)
trendStrength = math.min(adx, 50) / 50
directionBias = math.abs(plusDI - minusDI) / 100
volatilityRatio = math.min(atr / math.abs(emaFast - emaSlow), 3.0) / 3.0
slopeNorm = math.min(math.abs(slopePower), 50) / 50
// CONFIDENCE SCORE ₩₩
confidenceRaw = (trendStrength + directionBias + slopeNorm + (1 - volatilityRatio)) / 4
confidenceScore = math.round(confidenceRaw * 100 * decayFactor)
confidenceLabel = confidenceScore >= 75 ? "High" : confidenceScore >= 50 ? "Medium" : "Low"
// REVERSAL SENSOR ENGINE ₩₩
slopeFlipping = ta.change(math.sign(slopePower)) != 0
slopeCollapsing = math.abs(slopePower) < 10
rsiDro*pping = rsi < 45
reversalRisk = (slopeFlipping and slopeCollapsing) or (rsiDro*pping and slopePower < 0)
// REVERSE SYMMETRY ₩₩
isBullishReversal = reversalRisk and slopePower > 30 and close > emaFast and close > emaSlow
isBearishReversal = reversalRisk and slopePower < -30 and close < emaFast and close < emaSlow
isReversingNow = isBullishReversal or isBearishReversal
reversalLabel = isBullishReversal ? "🚀 Bullish Reversal" : isBearishReversal ? "🚨 Bearish Reversal" : reversalRisk ? "⚠️ Reversal Threat" : "✅ Stable"
// RECOVERY DETECTION ENGINE ₩₩
wasBearish = trendDir[1] == "Bearish"
emaCrossover = close > emaFast and close[1] < emaFast[1] and close > emaSlow
recoveryBounce = isBullishReversal and wasBearish and emaCrossover
// STALL DETECTOR ENGINE ₩₩
slopeLow = math.abs(slopePower) < stallSlopeLimit
rsiFlat = rsi > rsiFlatMin and rsi < rsiFlatMax
atrCompression = atr < ta.sma(atr, 20)
stallDetected = rsiFlat and slopeLow and atrCompression
stallLabel = stallDetected ? "🛑 Dead Zone" : "✅ Active"
// SLOPE PROJECTION ENGINE ₩₩
slopeNow = slopeDeg
slopePrev = math.atan(emaFast[1] - emaSlow[1]) * 180 / math.pi
slopeDelta = slopeNow - slopePrev
slopeAccel = slopeDelta - (slopePrev - math.atan(emaFast[2] - emaSlow[2]) * 180 / math.pi)
slopeForecast = slopeNow + slopeDelta + slopeAccel
// ADAPTIVE SLOPE CLAMPING ENGINE ₩₩
baseClamp = 45.0
dynamicRange = 15.0
forecastVolatilityFactor = math.min(math.max((atr / ta.sma(atr, 50) + ta.stdev(slopePower, 50) / 30) / 2, 0.5), 1.5)
adaptiveClamp = baseClamp + (forecastVolatilityFactor - 1.0) * dynamicRange
slopeForecastClamped = math.max(math.min(slopeForecast, adaptiveClamp), -adaptiveClamp)
// SLOPE PROJECTION CONFIDENCE ₩₩
slopeMomentum = math.abs(slopeAccel)
forecastConfidence = slopeMomentum > 2.5 ? "High" : slopeMomentum > 1.0 ? "Medium" : "Low"
projectionLabel = slopeForecastClamped > 15 ? "📈 Rising" : slopeForecastClamped < -15 ? "📉 Falling" : "➖ Sideways"
projectionValue = " (" + str.tostring(math.round(slopeForecastClamped)) + "°, " + forecastConfidence + " Confidence)"
// MOMENTUM FADING DETECTION ₩₩
slopeFading = ta.change(slopePower) < 0 and not stallDetected and not reversalRisk and math.abs(slopePower) > 15
momentumFading = slopeFading and slopePower[1] > slopePower[2] and slopePower > 10
// SMART ENTRY WINDOW DETECTION ₩₩
impulseActive = isImpulse and slopePower > 20 and confidenceScore >= 60
pulledBack = close[1] < emaFast[1] and close > emaFast and low < emaFast
smartEntryWindow = impulseActive and pulledBack
plotshape(smartEntryWindow, title="Smart Entry", location=location.belowbar, style=shape.triangleup, size=size.small, color=color.teal)
// COMMENTARY GENERATOR ₩₩
aiCommentary = phaseChanged ? "🔄 Phase Shift: " + prevPhase + " → " + phaseText :
recoveryBounce ? "🔁 Recovery rally — bounce reclaiming trend structure. (" + sessionPhase + ")" :
smartEntryWindow ? "🎯 Smart entry window — impulse pullback with reclaim. (" + sessionPhase + ")" :
momentumFading ? "🪫 Momentum weakening — trend may lose steam soon. (" + sessionPhase + ")" :
isImpulse and confidenceScore >= 75 and not reversalRisk ? "📈 Strong trend forming — consider riding momentum. (" + sessionPhase + ")" :
isCooling and confidenceScore >= 50 ? "🌀 Trend slowing — caution if already in position. (" + sessionPhase + ")" :
stallDetected and not isImpulse ? "⏸️ Price stalling — this is not the time to enter. (" + sessionPhase + ")" :
isBullishReversal ? "🚀 Bullish reversal confirmed — breakout in progress. (" + sessionPhase + ")" :
isBearishReversal ? "🚨 Bearish reversal confirmed — breakdown in progress. (" + sessionPhase + ")" :
reversalRisk and confidenceScore < 50 ? "⚠️ Reversal threat building — watch for breakdown or bounce. (" + sessionPhase + ")" :
confidenceScore < 30 ? "🧪 Low conviction trend — better to wait for clarity. (" + sessionPhase + ")" :
"➖ Trend steady — no action required right now. (" + sessionPhase + ")"
var label commentaryLabel = na
if showCommentary and not na(high)
if not na(commentaryLabel)
label.delete(commentaryLabel)
commentaryLabel := showCommentary and not na(high) ? label.new(bar_index, math.max(high, high[1], high[2]) + atr * 1.5, aiCommentary, xloc.bar_index, yloc.price, style=label.style_label_center, size=size.normal, textcolor=commentaryTextColor, color=color.new(#eece89, 85), textalign=text.align_center, tooltip="NeuroTrend Commentary") : commentaryLabel
// DASHBOARD RENDERING ₩₩
var table dashboard = table.new(pos, 7, 2, border_width=1, frame_color=color.new(color.white, 90), bgcolor=color.new(color.navy, 95))
if bar_index % 5 == 0
table.cell(dashboard, 0, 0, "🧠 Phase", text_color=tableTextColor, bgcolor=color.new(color.black, 85), text_size=size.small)
table.cell(dashboard, 0, 1, phaseText, text_color=tableTextColor, bgcolor=color.new(trendColor, 20), text_size=size.small)
table.cell(dashboard, 1, 0, "📈 Direction", text_color=tableTextColor, bgcolor=color.new(color.black, 85), text_size=size.small)
table.cell(dashboard, 1, 1, trendDir, text_color=tableTextColor, bgcolor=color.new(trendColor, 10), text_size=size.small)
table.cell(dashboard, 2, 0, "🔋 Slope Power", text_color=tableTextColor, bgcolor=color.new(color.black, 85), text_size=size.small)
table.cell(dashboard, 2, 1, str.tostring(slopeScore) + " / 100", text_color=tableTextColor, bgcolor=color.new(trendColor, 85), text_size=size.small)
if showConfidence
table.cell(dashboard, 3, 0, "🧠 Confidence", text_color=tableTextColor, bgcolor=color.new(color.black, 85), text_size=size.small)
table.cell(dashboard, 3, 1, confidenceLabel + " (" + str.tostring(confidenceScore) + ")", text_color=tableTextColor, bgcolor=color.new(trendColor, 80), text_size=size.small)
if showReversal
table.cell(dashboard, 4, 0, "🚨 Reversal Risk", text_color=tableTextColor, bgcolor=color.new(color.black, 85), text_size=size.small)
table.cell(dashboard, 4, 1, reversalLabel, text_color=tableTextColor, bgcolor=reversalRisk ? color.new(color.red, 60) : color.new(color.green, 80), text_size=size.small)
if showStall
table.cell(dashboard, 5, 0, "⏸️ Momentum", text_color=tableTextColor, bgcolor=color.new(color.black, 85), text_size=size.small)
table.cell(dashboard, 5, 1, stallLabel, text_color=tableTextColor, bgcolor=stallDetected ? color.new(color.orange, 60) : color.new(color.green, 80), text_size=size.small)
if showProjection
table.cell(dashboard, 6, 0, "📡 Projection", text_color=tableTextColor, bgcolor=color.new(color.black, 85), text_size=size.small)
table.cell(dashboard, 6, 1, projectionLabel + projectionValue, text_color=tableTextColor, bgcolor=color.new(trendColor, 70), text_size=size.small)
// SMART ALERT CONDITION ₩₩
customAlertCondition =
customEnableAlerts and
confidenceScore >= customMinConfidence and
(not customRequireImpulse or isImpulse) and
(not customRequireBullish or slopePower > 0) and
(not customRequireBearish or slopePower < 0) and
(not customBlockReversal or not reversalRisk) and
(not customBlockStall or not stallDetected)
alertcondition(customAlertCondition, title="Custom NeuroTrend Alert", message="🔔 NeuroTrend: Your custom alert conditions have been met.")
// BUY / SELL SIGNAL LABELS ₩₩
showBuySellLabels = input.bool(true, "Show Buy/Sell Labels", group="Neuro Settings")
buySignal = ta.crossover(slopeDeg, 0) and slopePower > 0
sellSignal = ta.crossunder(slopeDeg, 0) and slopePower < 0
if showBuySellLabels
if buySignal
label.new(bar_index, low, "BUY", style=label.style_label_up, color=color.green, textcolor=color.white, yloc=yloc.belowbar)
if sellSignal
label.new(bar_index, high, "SELL", style=label.style_label_down, color=color.red, textcolor=color.white, yloc=yloc.abovebar)
2025-05-15
1239
글번호 190852
답변완료
글번호92636관련 수정부탁드립니다
글번호92636 관련...
조건식 잘적용해서쓰고있는데요... 캔들이 양봉일때는 검색이 안되는것같아요.. 양봉일때도 같이 검색되게 수정부탁드립니다
2025-05-15
278
글번호 190851
답변완료
수식을 짜보려하는데, 자꾸 에러가 납니다.
수식을 짜봤는데, 잘 안됩니다.
장기단순이평(150, 200) 정배열
단순이평 50/150/200 우상향
특히(200이평은 최소 1달 이상 우상향)
이런 조건을 구현하려고 다음과 같이 짜봤는데
MA(CLOSE,150)>MA(CLOSE,200) AND
MA(CLOSE,50)>MA(CLOSE,50[1] AND
MA(CLOSE,150)>MA(CLOSE,150[1] AND
MA(CLOSE,200)>MA(CLOSE,200[1] AND
MA(CLOSE,200)>MA(CLOSE,200[20]
계속 오류가 뜹니다.(( 5번째줄, 문법에러, 잘못된 토큰:'<File End>',올수있는것:';' ))
이렇게요...
위에 의도에 맞게 수식을 짜보고 싶은데 도와주세요.
2025-05-15
309
글번호 190850
요타 님에 의해서 삭제되었습니다.
2025-05-15
9
글번호 190849