커뮤니티
예스랭귀지 Q&A
[공지] 예스랭귀지 AI 어시스턴트, '예스나 AI' 출시 및 무료 체험 안내
안녕하세요, 예스스탁 입니다.복잡한 수식 공부 없이 여러분의 아이디어를 말하면 시스템 트레이딩 언어 예스랭귀지로 작성해주는 서비스예스나 AI(YesNa AI)가 출시되었습니다.지금 예스나 AI를 직접 경험해 보실 수 있도록 20크레딧(질문권 20회)를 무료로 증정해 드리고 있습니다.바로 여러분의 아이디어를 코드로 변환해보세요.--------------------------------------------------🚀 YesNa AI 핵심 기능- 지표식/전략식/종목검색식 생성: 자연어로 요청하면 예스랭귀지 문법에 맞는 코드를 작성합니다.- 종목검색식 변환 지원: K증권의 종목 검색식을 예스랭귀지로 변환 지원합니다.- 컴파일 검증: 작성된 코드가 실행 가능한지 컴파일러를 통해 문법 검증을 거쳐 결과물을 제공합니다.상세한 서비스 개요 및 활용 방법은 [서비스 소개 페이지]에서 확인하실 수 있습니다.▶ 서비스 소개 페이지: 바로가기서비스 사용 유의사항 및 결제 환불정책은 [이용약관]을 참고 부탁드립니다.▶ 서비스 이용약관: 바로가기💬 이용 문의사용 중 문의사항은 [프로그램 사용법 Q&A] 게시판에서 [예스나 AI] 카테고리를 설정 후 문의해 주시면 상세히 안내해 드리겠습니다.--------------------------------------------------앞으로도 AI를 활용한 다양한 트레이딩 기능들을 지속적으로 선보일 예정입니다.많은 관심과 기대 부탁드립니다.
2026-02-27
1365
글번호 230811
답변완료
data2 고가 후 저가 구하는 수식 부탁드립니다.
안녕하세요
data2에서 당일 고가 후 저가 그리고 저가 후 고가 구하는 수식 부탁드립니다.
감사합니다.
2024-10-26
624
글번호 184634
답변완료
89647 글 확인좀 요청 드림니다.
* 좋은 한주 되십시요
* 아래글이 안되는데 수정 좀 요청 드림니다.
* 요청 사항: 고가선 3번째 크로스업 되면 봉 강조
저가선 3번째 크로스 다운 되면 봉강조.
즉 봉 중간값이(h+l)/2 이전에 고가선 3개를 크로스업 되면 봉강조
봉 중간값이(h+l)/2 이전에 저가선 3개를 크로스다운 되면 봉강조
## 아래
input : P(2),n(7),틱(2), 굵기(1);
var : TX(0);
var : cnt(0),LL(0),HH(0);
Array : LTL[10](0),HTL[10](0);
var : LTL1(0),LTL2(0),LTL3(0),LTL4(0),LTL5(0),LTL6(0);
var : HTL1(0),HTL2(0),HTL3(0),HTL4(0),HTL5(0),HTL6(0);
if L < Lowest(L,P)[1] and (LL == 0 or (LL > 0 and abs(L-LL) >= PriceScale*틱)) Then
{
LL = L+0.04;
For cnt = 9 DownTo 1
{
LTL[cnt] = LTL[cnt-1];
}
LTL[0] = TL_new(sDate,sTime,LL,NextBarSdate,NextBarStime,LL);
TL_SetColor(LTL[0],LGreen);
TL_SetSize(LTL[0],굵기);
TL_Delete(LTL[n]);
}
Else
{
TL_SetEnd(LTL[0],sDate,sTime,LL);
}
if H > highest(H,P)[1] and (HH == 0 or (HH > 0 and abs(H-HH) >= PriceScale*틱)) Then
{
HH = H-0.04;
For cnt = 9 DownTo 1
{
HTL[cnt] = HTL[cnt-1];
}
HTL[0] = TL_new(sDate,sTime,HH,NextBarSdate,NextBarStime,HH);
TL_SetColor(HTL[0],Red);
TL_SetSize(HTL[0],굵기);
TL_Delete(HTL[n]);
}
Else
{
TL_SetEnd(HTL[0],sDate,sTime,HH);
}
if H >= L+PriceScale*20 and C > O and CrossUp((H+L)/2,HH) Then
PlotPaintBar(H,L,"강조",Red);
if H >= L+PriceScale*20 and C < O and CrossDown((H+L)/2,LL) Then
PlotPaintBar(H,L,"강조",Blue);
수고하십시요.
2024-10-28
767
글번호 184633
답변완료
진입횟수3
첨부파일은 답변수식에 진입횟수를 모두 1로 놓고 확인한 결과입니다.
차트는 선물5분봉입니다.
"b"진입이 22년1월27일 4번 진입하고
"트레진입"이 22년1월28일 3번 진입하고 있습니다.
셋팅한대로 1번씩 진입하도록 수정해주셨으면 합니다.
아래수식은 제가 시뮬레이션에 사용한 수식입니다.
답변수식에 고점갱신부분을 추가한 내용입니다.
********************************************************************************
input : st(103000);
input : b진입횟수(1),손절진입횟수(1),트레진입횟수(1),최소변화진입횟수(1);
input : 손절고점갱신(3),트레고점갱신(4),최소변화고점갱신(5);
input : ls(0.5),tr(0.5),최소가격(0.5),봉수(10);
var : count(0);
var : b진입count(0),손절진입count(0),트레진입count(0),최소변화진입count(0);
var : T1(0),entry(0);
if Bdate != Bdate[1] Then
{
b진입count = 0;
손절진입count = 0;
트레진입count = 0;
최소변화진입count = 0;
}
if (MarketPosition == 1 and MarketPosition != MarketPosition[1]) Then
{
if IsEntryName("b") == true Then
b진입count = b진입count+1;
if IsEntryName("손절진입") == true Then
손절진입count = 손절진입count+1;
if IsEntryName("트레진입") == true Then
트레진입count = 트레진입count+1;
if IsEntryName("최소변화진입") == true Then
최소변화진입count = 최소변화진입count+1;
}
if stime >= st and b진입count < b진입횟수 then
Buy("b");
if MarketPosition == 0 Then
{
if TotalTrades > TotalTrades[1] Then
count = 0;
if DayHigh(0) > DayHigh(0)[1] Then
count = count+1;
if IsExitName("StopLoss",1) == true and 손절진입count < 손절진입횟수 and
ExitDate(1) == sDate and
count == 손절고점갱신 Then
Buy("손절진입");
if IsExitName("StopTrailing",1) == true and 트레진입count < 트레진입횟수 and
ExitDate(1) == sDate and
count == 트레고점갱신 Then
Buy("트레진입");
if IsExitName("StopInactivity",1) == true and 최소변화진입count < 최소변화진입횟수 and
ExitDate(1) == sDate and
count == 최소변화고점갱신 Then
Buy("최소변화진입");
}
SetStopLoss(ls,pointStop);
SetStopTrailing(tr,0,pointStop,1);
SetStopInactivity(최소가격,봉수,PointStop);
2024-11-06
632
글번호 184632
답변완료
문의 드립니다.
안녕하세요
아래 지표 수식도 예스로 변경이 변경이 가능한지 궁금합니다.
감사합니다.
indicator("Radius Trend [ChartPrime]", overlay = true)
// --------------------------------------------------------------------------------------------------------------------}
// 𝙐𝙎𝙀𝙍 𝙄𝙉𝙋𝙐𝙏𝙎
// --------------------------------------------------------------------------------------------------------------------{
// @variable Step size for radius adjustment
float step = input.float(0.15, "Radius Step", step = 0.001)
// @variable Multiplier for initial distance calculation
float multi = input.float(2, "Start Points Distance", step = 0.1)
// Initialize variables
bool trend = na
var float multi1 = 0.
var float multi2 = 0.
int n = 3
var float band = 0.
// --------------------------------------------------------------------------------------------------------------------}
// 𝙄𝙉𝘿𝙄𝘾𝘼𝙏𝙊𝙍 𝘾𝘼𝙇𝘾𝙐𝙇𝘼𝙏𝙄𝙊𝙉𝙎
// --------------------------------------------------------------------------------------------------------------------{
// Calculate distances for band placement
float distance = ta.sma(math.abs(high-low), 100) * multi
float distance1 = ta.sma(math.abs(high-low), 100) * 0.2
// Initialize trend and band on the 101st bar
if bar_index == 101
trend := true
band := low * 0.8
// trend based on price relation to band
if close < band
trend := false
if close > band
trend := true
// Adjust band on trend changes
if trend[1] == false and ta.change(trend)
band := low - distance
if trend[1] == true and ta.change(trend)
band := high + distance
// Apply step angle to trend lines
if bar_index % n == 0 and trend
multi1 := 0
multi2 += step
band += distance1 * multi2
if bar_index % n == 0 and not trend
multi1 += step
multi2 := 0
band -= distance1 * multi1
// Smooth the band
Sband = ta.sma(band, n)
// Set color based on trend
color = trend ? #54b6d4 : #cf2b2b
// Calculate upper and lower bands
band_upper = ta.sma(band + distance*0.5, n)
band_lower = ta.sma(band - distance*0.5, n)
band1 = trend ? band_upper : band_lower
// --------------------------------------------------------------------------------------------------------------------}
// 𝙑𝙄𝙎𝙐𝘼𝙇𝙄𝙕𝘼𝙏𝙄𝙊𝙉
// --------------------------------------------------------------------------------------------------------------------{
// Plot the outer band
plot(band1, color = bar_index % 2 == 0 ? color.new(chart.fg_color, 50) : na)
// Plot the main band and fill area
p1 = plot(ta.change(trend) ? na : Sband, style = plot.style_linebr, color = color.gray)
p2 = plot(ta.sma(hl2, 20), display = display.none)
fill(p1, p2, band, ta.sma(hl2, 20), color.new(color, 60), na)
// --------------------------------------------------------------------------------------------------------------------}
2024-10-26
704
글번호 184631
답변완료
종목검색식 부탁드림니다.
항상 노고에 감사드림니다.
아래의 수식을 종목검색식으로 부탁드림니다.
가중12 = ma(C,12,가중);
가중60 = ma(C,60,가중);
이동120 = ma(C,120);
저점 = 가중12>가중12(1) && 가중12(1)<가중12(2);
고점 = Highestsince(1, 저점,H);
첫바닥12 = Valuewhen(1, 저점,가중12(1));
첫바닥60 = Valuewhen(1, 저점,가중60(1));
쌍바닥12 = Valuewhen(1, 저점,가중12(1));
쌍바닥60 = Valuewhen(1, 저점,가중60(1));
전고점 = Valuewhen(1, 저점, 고점(1));
첫바닥12<첫바닥60 &&
쌍바닥12<첫바닥60 &&
가중60 <가중12 &&
Crossup(H, 전고점) &&
C>이동120 &&
C>O
2024-10-26
732
글번호 184630
답변완료
부탁드립니다.
-수고하십니다.
-분봉에서 특정시간부터 이동평균선을 표시하는 지표를 부탁드립니다.
(예로 10시20분부터 봉이 있는것처럼 이평표시)
2024-10-26
636
글번호 184629
답변완료
종목 검색부탁드립니다.
1.아래수식에서, 종목검색 부탁드립니다
1) K 가(수식1) T 를(수식2) 골든크로스 할때 검색식
2) K 가(수식1) 전일보다 상승한 종목 검색식
3) K 가(수식1) 기준선 0 을 돌파할때 검색식
4) T 가(수식2) 기준선 0 을 돌파할때 검색식
5) K 가(수식1) 기준선 0선 위에 있는 모든종목 검색식
---아래----
(수식1) K
A=(H+L+C)/3;
xTrend=if(A>A(1),volume*100,-volume*100);
xFast=eavg(xTrend,FastX);
xSlow=eavg(xTrend,SlowX);
xKVO=xFast-xSlow;
(수식2) T
A=(H+L+C)/3;
xTrend=if(A>A(1),volume*100,-volume*100);
xFast=eavg(xTrend,FastX);
xSlow=eavg(xTrend,SlowX);
xKVO=xFast-xSlow;
xTrigger=eavg(xKVO,TrigLen);
<지표변수>
TrigLen 10
FastX 30
SlowX 50
기준선 0
----------------------------------------------------
----------------------------------------------------
2. 아래수식에서,
기준선 0을 돌파한 종목을, 0봉전~30봉전까지 모든 종목을 검색하고자 합니다
종목검색식 부탁 드려요.
----아래----
수식: C-C (기간 1 )
지표변수 : 기간1 25
기준선 0
2024-10-28
659
글번호 184628
답변완료
저가, 고가 대비
늘 감사합니다.
당일에 매수 1회, 매도1회만
익절 20틱, 손절 10틱
10시 30분 강제 청산
당일 저가대비 +25틱 상승 하면 매도
하루에 한번만 거래
당일 고가대비 -25틱 하락 하면 매수
하루에 한번만 거래
감사합니다.
2024-10-26
692
글번호 184627
답변완료
수고하십니다
항상감사드리며
트레이딩뷰 챠트인데 간곡히 변환 부탁드립니다
indicator("Market Structure Algo", "MS Algo", true)
left = input.int(5, "Internal MS", minval = 2)
left1 = input.int(30, "External MS", minval = 7)
dist = input.float(2.00, "Zone Distance", minval = 1, step = 0.1, inline = "zone")
zone = input.bool(true, "", inline = "zone")
right = left
right1 = left1
upcolor = input.color(#2962ff, "Positive color", group = "Appearence")
downcolor = input.color(#e91e63, "Negative color", group = "Appearence")
// Internal
pvh = ta.pivothigh(left, right)
pvl = ta.pivotlow(left, right)
var float ph = na
var float pl = na
ph := pvh != 0 ? pvh : ph[1]
pl := pvl != 0 ? pvl : pl[1]
currenth = ta.valuewhen(pvh != 0, high[right], 0)
lasth = ta.valuewhen(pvh != 0, high[right], 1)
currentl = ta.valuewhen(pvl != 0, low[right], 0)
lastl = ta.valuewhen(pvl != 0, low[right], 1)
var int ms = na
ms := if currenth > lasth and currentl > lastl and close > ph
ms := 2
else if close > ph
ms := 1
else if currenth < lasth and currentl < lastl and close < pl
ms := -2
else if close < pl
ms := -1
else
ms[1]
var int last = na
longsig = close > ph and ms[1] < 0
shortsig = close < pl and ms[1] > 0
longsig1 = close > ph and ms[1] > 0
shortsig1 = close < pl and ms[1] < 0
longsig2 = longsig1 and longsig1[1] == false and longsig[1] == false
shortsig2 = shortsig1 and shortsig1[1] == false and shortsig[1] == false
longexit = high > ph and close < ph
shortexit = low < pl and close > pl
// External
pvh1 = ta.pivothigh(left1, right1)
pvl1 = ta.pivotlow(left1, right1)
var float ph1 = na
var float pl1 = na
ph1 := pvh1 != 0 ? pvh1 : ph1[1]
pl1 := pvl1 != 0 ? pvl1 : pl1[1]
// Zone
ma = ta.sma(close, left1)
atr = ta.atr(left1)
ma2 = ms > 0 and ms[1] > 0 ? ma - atr * dist : ms < 0 and ms[1] < 0 ? ma + atr*dist : na
ma3 = ms > 0 and ms[1] > 0 ? ma2 + atr : ms < 0 and ms[1] < 0 ? ma2 - atr : na
// Plot
if pvh != 0
l1 = line.new(x1 = bar_index - right, y1 = ph, x2 = bar_index + math.round(right/2), y2 = ph, color = color.new(upcolor, 50), style = line.style_dashed)
if pvl != 0
l2 = line.new(x1 = bar_index - right, y1 = pl, x2 = bar_index + math.round(right/2), y2 = pl, color = color.new(downcolor, 50), style = line.style_dashed)
if pvh1 != 0
l3 = line.new(x1 = bar_index - right1, y1 = ph1, x2 = bar_index + math.round(right1/2), y2 = ph1, color = upcolor, width = 2)
if pvl1 != 0
l4 = line.new(x1 = bar_index - right1, y1 = pl1, x2 = bar_index + math.round(right1/2), y2 = pl1, color = downcolor, width = 2)
barcolor(ms >= 2 ? upcolor : ms == 1 ? color.new(upcolor, 50) : ms <= -2 ? downcolor : ms == -1 ? color.new(downcolor, 50) : na)
plotshape(longsig, "Long Signal", shape.labelup, location.belowbar, upcolor, 0, "↑", textcolor = color.new(color.white, 50))
plotshape(longsig2, "Buy Signal", shape.triangleup, location.belowbar, upcolor)
plotshape(shortsig, "Short Signal", shape.labeldown, location.abovebar, downcolor, 0, "↓", textcolor = color.new(color.white, 50))
plotshape(shortsig2, "Sell Signal", shape.triangledown, location.abovebar, downcolor)
plotshape(longexit, "Long Exit", shape.triangledown, location.abovebar, color.gray)
plotshape(shortexit, "Short Exit", shape.triangleup, location.belowbar, color.gray)
p1 = plot(zone ? ma2 : na, "External Zone", close > ma2 ? upcolor : close < ma2 ? downcolor : na, 1, plot.style_linebr)
p2 = plot(zone ? ma3 : na, "Internal Zone", close > ma2 ? color.new(upcolor, 80) : close < ma2 ? color.new(downcolor, 80) : na, 1, plot.style_linebr)
fill(p1, p2, color = close > ma2 ? color.new(upcolor, 80) : color.new(downcolor, 80), title = "Zone fill")
alertcondition(longsig, "Long CHoCH")
alertcondition(shortsig, "Short CHoCH")
alertcondition(longsig2, "Long BOS")
alertcondition(shortsig2, "Short BOS")
2024-10-26
992
글번호 184626