커뮤니티
예스랭귀지 Q&A
답변완료
[공지] 예스랭귀지 AI 어시스턴트, '예스나 AI' 출시 및 무료 체험 안내
안녕하세요, 예스스탁 입니다.복잡한 수식 공부 없이 여러분의 아이디어를 말하면 시스템 트레이딩 언어 예스랭귀지로 작성해주는 서비스예스나 AI(YesNa AI)가 출시되었습니다.지금 예스나 AI를 직접 경험해 보실 수 있도록 20크레딧(질문권 20회)를 무료로 증정해 드리고 있습니다.바로 여러분의 아이디어를 코드로 변환해보세요.--------------------------------------------------🚀 YesNa AI 핵심 기능- 지표식/전략식/종목검색식 생성: 자연어로 요청하면 예스랭귀지 문법에 맞는 코드를 작성합니다.- 종목검색식 변환 지원: K증권의 종목 검색식을 예스랭귀지로 변환 지원합니다.- 컴파일 검증: 작성된 코드가 실행 가능한지 컴파일러를 통해 문법 검증을 거쳐 결과물을 제공합니다.상세한 서비스 개요 및 활용 방법은 [서비스 소개 페이지]에서 확인하실 수 있습니다.▶ 서비스 소개 페이지: 바로가기서비스 사용 유의사항 및 결제 환불정책은 [이용약관]을 참고 부탁드립니다.▶ 서비스 이용약관: 바로가기💬 이용 문의사용 중 문의사항은 [프로그램 사용법 Q&A] 게시판에서 [예스나 AI] 카테고리를 설정 후 문의해 주시면 상세히 안내해 드리겠습니다.--------------------------------------------------앞으로도 AI를 활용한 다양한 트레이딩 기능들을 지속적으로 선보일 예정입니다.많은 관심과 기대 부탁드립니다.
2026-02-27
5475
글번호 230811
답변완료
검색식 부탁 드립니다
분봉에서 1봉전보다 0봉전이 높다
2025-07-28
259
글번호 192789
답변완료
종목검색식 부탁드립니다.
종목검색식 부탁드립니다. (수치는 기본으로 해주세요 제가 변경하겠습니다. )
엔벨로프 중심선과 불린져밴드 중심선 골든크로스 나온 종목을 찾고 싶습니다.
-----------------------------------------------------------------------
종목검색식 부탁드립니다. (수치는 기본으로 해주세요 제가 변경하겠습니다. )
5ma 엔벨로프 중심선 골든 크로스후 음봉 두개나온 종목을 찾고싶습니다.
-----------------------------------------------------------------------
두가지 따로 식 부탁드립니다. 감사합니다.
2025-07-28
291
글번호 192788
답변완료
분봉차트에서 일봉최고값
안녕하세요.
한투 해외선물운용중입니다.
일봉차트 전략에서 몇일동안의 최고값을 돌파하는 수식을 분봉차트로 변형하고 싶은데,
C >= Highest(H,22*12)[1] //12일동안의 최고값을 돌파
를 어떻게 바꿀 수 있을까요?
2025-07-28
295
글번호 192787
답변완료
검색식 부탁드립니다~
수고하십니다. 2가지 종목검색식 부탁드립니다.
1.
Hc=Max(C,O);
Lc=Min(C,O);
HH=Highest(Hc, 횡보기간);
LL=Lowest(Lc, 횡보기간);
변동폭=(HH-LL)/LL*100;
조건=
변동폭(1)<변동률 &&
CrossUp(C,HH(1))
/횡보기간 : 20
/변동률 : 10
>> 이 값을 발생하고, 오늘이후로 종가가 이 값을 돌파할 때 검색식 부탁드립니다.
2. 오늘 중심값 (H+L)/2 을 깨고 내려갔다가, 다시 돌파할 때 검색 부탁드립니다.
감사합니다.
2025-07-28
285
글번호 192786
답변완료
종목 검색 부탁드립니다.
1. 아래수식을 참조하여 수식1) 이 수식2) 를 골든크로스 할때,
"단, 0봉전~10봉전 모든종목" 검색식 부탁드려요
--------아래-----
(수식1)
tenkan=If(Sum(거래량, ConvPeriod) > 0,
Sum(((고가 + 저가) / 2) * 거래량, ConvPeriod) / Sum(거래량, ConvPeriod),
(Max(고가, ConvPeriod) + Min(저가, ConvPeriod)) / 2);
(수식2)
kijun = If(Sum(거래량, BasePeriod) > 0,
Sum(((고가 + 저가) / 2) * 거래량, BasePeriod) / Sum(거래량, BasePeriod),
(Max(고가, BasePeriod) + Min(저가, BasePeriod)) / 2);
(수식3)
shift(close,-25)
(수식4)
spanA = (tenkan + kijun) / 2;
//SHIFT(spanA,25)
(수식5)
spanB = tenkan=If(Sum(거래량, SpanBPeriod) > 0,
Sum(((고가 + 저가) / 2) * 거래량, SpanBPeriod) / Sum(거래량, SpanBPeriod),
(Max(고가, SpanBPeriod) + Min(저가, SpanBPeriod)) / 2);
//SHIFT(spanB,25)
- 지표조건설정
ConvPeriod : 9
BasePeriod : 26
SpanBPeriod : 52
Shift : 26
2025-07-28
294
글번호 192776
답변완료
안녕하세요. 지표 문의 입니다.
S = sar(0.03, 0.25);
파라상단 = Valuewhen(1, CrossDown(C, S), S);
S = sar(0.03, 0.25);
if CrossDown(C, S) Then 파라상단 = S;
이렇게 키움 수식으로 예스로 바꿔서 사용하는 중인데요.
간혹 키움 차트와 예스 차트에서 나타나는 지표라인이 다른 종목들이 나와서 문의 드립니다. 왜 그런지 알 수 있을까요?
첨부파일은 7월 25일 기준 펄어비스 종목입니다.
2025-07-28
376
글번호 192775
답변완료
제가 만든 지표의 값을 시스템식에서 사용할 수 없나요?
제가 만든 지표가 있는데요.
해당 지표에서 생성된 값을 시스템에서 사용하고 싶은데,
지표에서 발생되는 값을 어떻게 가져올 수 있을까요?
2025-07-27
318
글번호 192774
답변완료
볼린저밴드 수식 문의
볼린저 밴드를 활용하여 매매를 하고자 합니다.
가격이 볼린저 밴드의 상단에 닿았을 때 매도 진입하고
하단에 닿았을때 매수 진입하는 전략을 세우고 싶은데요.
아래 전략에서 부등호의 방향이 맞는지 문의 드립니다.
====================================================================
Input:Period(20),MultiD(2);
var:BBmd(0),BBup(0),BBdn(0);
BBmd=ma(C,Period);
BBup=BollBandUp(Period,MultiD);
BBdn=BollBandDown(Period,MultiD);
If MarketPosition<=0 and H < bbup Then Sell("s",atmarket,bbup);
If MarketPosition>=0 and L > bbdn Then Buy("b",atmarket,bbdn);
2025-07-27
303
글번호 192773
답변완료
지표 수정바랍니다.
안녕하세요?
아래 트뷰 원본지표를 예스랭귀지로 변환하였는데, 선은 잘 나오는 것 같은데, 원본 그림처럼 잘 나오지 않는 것 같습니다. 그리고 당일만 선들이 나오네요. 과거에도 선들이 나오면 좋겠습니다. 체크한번 부탁드립니다.
== 예스랭귀지 ==
// === 1. Input Parameters ===
Input:
PivotLen(20), // Pivot length for detection
Repainting(True), // If False, wait for bar close (LastBarOnChart=1) to confirm breakout
ShowTargets(False), // Draw flat target lines at pivot prices
BearColor(Red), // Color for bearish trendlines
BullColor(Green), // Color for bullish trendlines
ExtendLeft(True), // Always extend trendlines to the left
ExtendRight(True); // Always extend trendlines to the right
// === 2. Internal Variables ===
Vars:
phBar(0), plBar(0), // Offsets for swing pivots
lastPhIndex(0), prevPhIndex(0),
lastPhVal(0), prevPhVal(0),
lastPlIndex(0), prevPlIndex(0),
lastPlVal(0), prevPlVal(0),
offsetB(0), offsetE(0), // Relative bar offsets for trendline endpoints
phLineID(0), plLineID(0), // Trendline object IDs
hasCrossPh(False), hasCrossPl(False); // Breakout flags
// === 3. Detect Swing Pivots ===
phBar = SwingHighBar(1, H, PivotLen, PivotLen, PivotLen*2+1);
plBar = SwingLowBar(1, L, PivotLen, PivotLen, PivotLen*2+1);
// === 4. On New High Pivot ===
if phBar == PivotLen then
{
prevPhIndex = lastPhIndex;
prevPhVal = lastPhVal;
lastPhIndex = BarIndex - phBar;
lastPhVal = H[phBar];
hasCrossPh = False;
if phLineID <> 0 then TL_Delete(phLineID);
if prevPhIndex > 0 then
{
offsetB = BarIndex - prevPhIndex;
offsetE = phBar;
phLineID = TL_New(
sDate[offsetB], sTime[offsetB], prevPhVal,
sDate[offsetE], sTime[offsetE], lastPhVal
);
// Style and extend the line both directions
TL_SetColor(phLineID, BullColor);
TL_SetSize(phLineID, 2);
TL_SetStyle(phLineID, 2); // dashed style
TL_SetExtLeft(phLineID, ExtendLeft);
TL_SetExtRight(phLineID, ExtendRight);
}
}
// === 5. On New Low Pivot ===
if plBar == PivotLen then
{
prevPlIndex = lastPlIndex;
prevPlVal = lastPlVal;
lastPlIndex = BarIndex - plBar;
lastPlVal = L[plBar];
hasCrossPl = False;
if plLineID <> 0 then TL_Delete(plLineID);
if prevPlIndex > 0 then
{
offsetB = BarIndex - prevPlIndex;
offsetE = plBar;
plLineID = TL_New(
sDate[offsetB], sTime[offsetB], prevPlVal,
sDate[offsetE], sTime[offsetE], lastPlVal
);
TL_SetColor(plLineID, BearColor);
TL_SetSize(plLineID, 2);
TL_SetStyle(plLineID, 2);
TL_SetExtLeft(plLineID, ExtendLeft);
TL_SetExtRight(plLineID, ExtendRight);
}
}
// === 6. Breakout Detection ===
if phLineID <> 0 and !hasCrossPh then
{
if Repainting or LastBarOnChart == 1 then
{
if C > lastPhVal then
{
hasCrossPh = True;
TL_SetEnd(phLineID, sDate, sTime, lastPhVal);
Text_New(sDate, sTime, lastPhVal, "Br");
}
}
}
if plLineID <> 0 and !hasCrossPl then
{
if Repainting or LastBarOnChart == 1 then
{
if C < lastPlVal then
{
hasCrossPl = True;
TL_SetEnd(plLineID, sDate, sTime, lastPlVal);
Text_New(sDate, sTime, lastPlVal, "Br");
}
}
}
// === 7. Optional Target Lines ===
if ShowTargets then
{
if phLineID <> 0 then TL_New(sDate, sTime, lastPhVal, NextBarSdate, NextBarStime, lastPhVal);
if plLineID <> 0 then TL_New(sDate, sTime, lastPlVal, NextBarSdate, NextBarStime, lastPlVal);
}
== 트뷰 원본 스크립트 ==
// This source code is subject to the terms of the Mozilla Public License 2.0 at https://mozilla.org/MPL/2.0/
// © HoanGhetti
//@version=5
indicator("지표", overlay = true, max_lines_count = 500)
import HoanGhetti/SimpleTrendlines/4 as tl
input_len = input.int(defval = 20, title = 'Pivot Length', minval = 1)
input_pivotType = input.string(defval = 'Normal', title = 'Pivot Type', options = ['Normal', 'Fast'], tooltip = 'Normal: Uses Pine₩'s built-in pivot system.₩n₩nFast: Uses a custom pivot system that tracks every reversal.')
input_repaint = input.bool(defval = true, title = 'Repainting', tooltip = 'If disabled, it will wait for bar confirmation to avoid printing false alerts.')
input_targets = input.bool(defval = false, title = 'Target Levels')
input_bearC = input.color(defval = color.red, title = 'Bear Breakout', group = 'Styling')
input_bullC = input.color(defval = color.green, title = 'Bull Breakout', group = 'Styling')
input_extend = input.string(defval = extend.none, title = 'Extend', options = [extend.none, extend.right, extend.left, extend.both], group = 'Styling')
input_style = input.string(defval = line.style_dotted, title = 'Trendline Style', options = [line.style_dotted, line.style_dashed, line.style_solid], group = 'Styling')
input_tstyle = input.string(defval = line.style_dashed, title = 'Target Style', options = [line.style_dotted, line.style_dashed, line.style_solid], group = 'Styling')
input_override = input.bool(defval = false, title = 'Override Source', group = 'Override', tooltip = 'Overriding the source will allow this to create trendlines on any specified source.')
input_useSrc = input.bool(defval = true, title = 'Use Source for Cross Detection', group = 'Override', tooltip = 'Instead of checking if the close value crossed trendline, check for the specified source.')
input_source = input.source(defval = low, title = 'Source', group = 'Override')
pl = fixnan(ta.pivotlow(input_override ? input_source : low, input_pivotType == 'Normal' ? input_len : 1, input_len))
ph = fixnan(ta.pivothigh(input_override ? input_source : high, input_pivotType == 'Normal' ? input_len : 1, input_len))
pivot(float pType) =>
pivot = pType == pl ? pl : ph
xAxis = ta.valuewhen(ta.change(pivot), bar_index, 0) - ta.valuewhen(ta.change(pivot), bar_index, 1)
prevPivot = ta.valuewhen(ta.change(pivot), pivot, 1)
pivotCond = ta.change(pivot) and (pType == pl ? pivot > prevPivot : pivot < prevPivot)
pData = tl.new(x_axis = xAxis, offset = input_len, strictMode = true, strictType = pType == pl ? 0 : 1)
pData.drawLine(pivotCond, prevPivot, pivot, input_override ? input_source : na)
pData
breakout(tl.Trendline this, float pType) =>
var bool hasCrossed = false
if ta.change(this.lines.startline.get_y1())
hasCrossed := false
this.drawTrendline(not hasCrossed)
confirmation = not hasCrossed and (input_repaint ? not hasCrossed : barstate.isconfirmed)
if (pType == pl ? (input_override and input_useSrc ? input_source : close) < this.lines.trendline.get_y2() : (input_override and input_useSrc ? input_source : close) > this.lines.trendline.get_y2()) and confirmation
hasCrossed := true
this.lines.startline.set_xy2(this.lines.trendline.get_x2(), this.lines.trendline.get_y2())
this.lines.trendline.set_xy2(na, na)
this.lines.startline.copy()
hasCrossed
plData = pivot(pl)
phData = pivot(ph)
style(tl.Trendline this, color col) =>
this.lines.startline.set_color(col), this.lines.trendline.set_color(col)
this.lines.startline.set_width(2), this.lines.trendline.set_width(2)
this.lines.trendline.set_style(input_style), this.lines.trendline.set_extend(input_extend)
style(plData, input_bearC), style(phData, input_bullC)
cu = breakout(plData, pl)
co = breakout(phData, ph)
plotshape(ta.change(cu) and cu ? plData.lines.startline.get_y2() : na, title = 'Bearish Breakout', style = shape.labeldown, color = input_bearC, textcolor = color.white, location = location.absolute, text = 'Br')
plotshape(ta.change(co) and co ? phData.lines.startline.get_y2() : na, title = 'Bullish Breakout', style = shape.labelup, color = input_bullC, textcolor = color.white, location = location.absolute, text = 'Br')
alertcondition(ta.change(cu) and cu, 'Bearish Breakout')
alertcondition(ta.change(co) and co, 'Bullish Breakout')
// Target Levels
phData_target = tl.new(phData.values.changeInX)
plData_target = tl.new(plData.values.changeInX)
phData_target.drawLine(ta.change(phData.values.y1) and input_targets, phData.values.y2, phData.values.y2)
plData_target.drawLine(ta.change(plData.values.y1) and input_targets, plData.values.y2, plData.values.y2)
target_style(tl.Trendline this, color col) =>
this.lines.startline.set_style(input_tstyle)
this.lines.trendline.set_style(input_tstyle)
this.lines.startline.set_color(col)
this.lines.trendline.set_color(col)
target_style(plData_target, input_bearC)
target_style(phData_target, input_bullC)
breakout(phData_target, ph)
breakout(plData_target, pl)
2025-07-27
1664
글번호 192772