커뮤니티
예스랭귀지 Q&A
[공지] 예스랭귀지 AI 어시스턴트, '예스나 AI' 출시 및 무료 체험 안내
안녕하세요, 예스스탁 입니다.복잡한 수식 공부 없이 여러분의 아이디어를 말하면 시스템 트레이딩 언어 예스랭귀지로 작성해주는 서비스예스나 AI(YesNa AI)가 출시되었습니다.지금 예스나 AI를 직접 경험해 보실 수 있도록 20크레딧(질문권 20회)를 무료로 증정해 드리고 있습니다.바로 여러분의 아이디어를 코드로 변환해보세요.--------------------------------------------------🚀 YesNa AI 핵심 기능- 지표식/전략식/종목검색식 생성: 자연어로 요청하면 예스랭귀지 문법에 맞는 코드를 작성합니다.- 종목검색식 변환 지원: K증권의 종목 검색식을 예스랭귀지로 변환 지원합니다.- 컴파일 검증: 작성된 코드가 실행 가능한지 컴파일러를 통해 문법 검증을 거쳐 결과물을 제공합니다.상세한 서비스 개요 및 활용 방법은 [서비스 소개 페이지]에서 확인하실 수 있습니다.▶ 서비스 소개 페이지: 바로가기서비스 사용 유의사항 및 결제 환불정책은 [이용약관]을 참고 부탁드립니다.▶ 서비스 이용약관: 바로가기💬 이용 문의사용 중 문의사항은 [프로그램 사용법 Q&A] 게시판에서 [예스나 AI] 카테고리를 설정 후 문의해 주시면 상세히 안내해 드리겠습니다.--------------------------------------------------앞으로도 AI를 활용한 다양한 트레이딩 기능들을 지속적으로 선보일 예정입니다.많은 관심과 기대 부탁드립니다.
2026-02-27
1413
글번호 230811
ryan1 님에 의해서 삭제되었습니다.
2024-05-17
55
글번호 179625
답변완료
문의 드립니다
수식어 부탁드립니다.
해외선물 매매시간 0700 익일0600
익절100 손절100 , 진입청산 1회
1. 매수후 청산
전일 장중 하락폭을 100%로 가정했을때 당일 장중 그폭의 60%를 내려갔을때
매수후 당일 이전 고점의 95%의 지점에 청산
2. 매도후 청산
전일 장중 상승폭을 100%로 가정했을때 당일 그폭의 60%를 올라갔을때
매도후 당일 이전 저점의 95%의지점에 청산
*추가질문*
해외선물 시간설정이 밤12시로 시작되는 이유가 스타트시간이 스톱시간보다
낮은경우의 수 인지 문의 드립니다.
저번에 이야기 하셨는데 잘 정립이 되질 않네요.
2024-05-17
734
글번호 179624
답변완료
문의드립니다.
늘 고맙습니다.
청산식을 만들다보니 잘 이해가 안가는 부분이 있어 문의 드립니다.
아래와 같은 청산식을 돌려보았습니다.
그런데 아래 수식중
be11-2:
bei12=index;
이것을 넣지않고 돌리니 진입후 바로 청산이 되어 버립니다.
왜 그런것인가요?
그 아래 if문이 없어서 그걸 다시 쓰지도 않는데 말이죠.
var:be11(0),bei11(0),bei12(0),be11목표(0);
if MarketPosition == 1 Then
{
be11=1;
bei11=Index;
be11목표=진폭[BarsSinceEntry]+LL50[BarsSinceEntry];
}
if be11==1 and bei11>0 Then
{
be11=2;
bei12=Index;
ExitLong("장기정배열매수청산",AtLimit,be11목표,"장기정배열매수");
ExitLong("장기정배열매수청산2",AtLimit,EntryPrice+75,"장기정배열매수");
ExitLong("장기정배열매수손절",AtStop,EntryPrice-25,"장기정배열매수");
}
2024-05-17
706
글번호 179623
답변완료
시스템 작성의뢰
수고 하십니다 !
Input : Period1(1), Period2(15), Period3(30), Period4(60), Period5(120),period6(240),Period7(480), Period8(960), Period9(1920), Period10(3840),period11(7680);
var : Sma1(0),Sma2(0),Sma3(0),Sma4(0),Sma5(0),sma6(0),Sma7(0),Sma8(0),Sma9(0),Sma10(0),sma11(0),OBVV(0),PositiveVolumeIndex(0),dpo(0);
input : FIPeriod(5);
var : fval(0),fi(0);
sma1 = ma(C,period1);
sma2 = ma(C,period2);
sma3 = ma(C,period3);
sma4 = ma(C,period4);
sma5 = ma(C,period5);
sma6 = ma(C,period6);
sma7 = ma(C,period7);
sma8 = ma(C,period8);
sma9 = ma(C,period9);
sma10 = ma(C,Period10);
sma11 = ma(C,Period11);
위수식을 적용하여
이동 평균선이 역배열 하고 960 이평선과 1920 이평선의 간격이 10 틱이상 벌어지고
3840 이평선과 7680 이평선의 간격이 20 틱이상 벌어지고 slope of volume 지표가 위아래
로 1 이상 움직이고 1 평균 거래량이 60 이상 증가하고 test1 지표가 1.08 로 하락 하고
er bear power 지표가 0.00 으로 상승 하고 120 이평선과 240 이평선이 업 크로스 할때
매수 하고
이동 평균선이 정배열 하고 960 이평선과 1920 이평선의 간격이 10 틱이상 벌어지고
3840 이평선과 7680 이평선의 간격이 20 틱이상 벌어지고 slope of volume 지표가 위아래
로 1 이상 움직이고 1 평균 거래량이 60 이상 증가하고 test1 지표가 1.09 로 상승 하고
er bear power 지표가 -0.00 으로 하락 하고 120 이평선과 240 이평선이 다운 크로스 할때
매도 하는 시스템을 부탁 드립니다 !
2024-05-17
779
글번호 179622
답변완료
수식 문의드립니다.
안녕하세요.
다음 파인 스크립트 수식을 예스로 변환 부탁드립니다.
쓰기 금지단어 셀렉트&업데이트는 한글로 수정했습니다.
그리고 Table 과 Break-Even Curve는 시간이 걸리면 생략해도 됩니다.
다시 한번 감사드립니다^^
indicator(overlay=true,max_lines_count=500)
//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~}
// ~~ Settings {
// ~~ Tooltips
t1 = "셀렉트 the method used to calculate the trailing stop. 'Auto' dynamically
calculates based on market conditions. 'Percentage' uses a fixed percentage
for trailing. ₩n₩nThe second value defines the lookback period over which to
calculate the highest high and lowest low for trailing stop calculations.
Increasing this value will make the trailing stop less sensitive to price
changes."
t2 = "Sets the percentage step for the trailing stop when 'Percentage' method is
셀렉티드. Increasing this value will increase the distance of the trailing
stop from the price."
t3 = "Determines the bias of the trailing stop. 'Bullish' sets it to track only
upward moves, 'Bearish' only downward, and 'Auto' adjusts dynamically based on
price action."
// ~~ Inputs
step = input.string("Auto","Trailing Method",["Auto","Percentage","Pivot"], group="Trailing", inline="Trailing", tooltip="")
prd = input.int(20,"Trailing Size", minval=2, group="Trailing", inline="Trailing", tooltip=t1)
perc = input.float(.5,"Percentage Step",step=.01,group="Trailing", inline="", tooltip=t2)/100
bias = input.string("Auto","Set Bias",["Bullish","Bearish","Auto"], group="Bias", inline="", tooltip=t3)
upcol = input.color(#089981 , title='', group='Style', inline="Style")
dncol = input.color(#f23645, title='', group='Style', inline="Style")
upcol1 = input.color(color.lime , title='', group='Style', inline="Style1")
dncol1 = input.color(color.maroon, title='', group='Style', inline="Style1")
showBE = input.bool(true,"Break-Even Curve",group="Table",inline="Table")
showTable = input.bool(true, title='Show Table', group='Table', inline='Table')
labels = input.bool(false, title='Show Labels', group='Table', inline='Table')
tblSize = input.string("Auto","Table Size",["Auto","Tiny","Small","Normal","Large","Huge"], group="Table", inline="style")
posi = input.string(position.top_right, title="",options =[position.top_right,position.top_center,
position.top_left,position.bottom_right,position.bottom_center,position.bottom_left,position.middle_right,position.middle_left], group="Table",inline="style", tooltip="")
Table_Text = input.color(color.new(color.white, 0), title='Text', inline='style', group='Table')
Table_BG = input.color(color.new(#176cff, 0), title='BG', inline='style', group='Table')
//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~}
// ~~ General Variables {
b = bar_index
dot = label(na)
var curve = array.new<line>()
var labs = array.new<label>()
//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~}
// ~~ AutoMove calc {
hi = ta.highest(high,prd*10)
lo = ta.lowest(low,prd*10)
var ph = high
var pl = low
var phL = b
var plL = b
var peaks = array.new<float>()
ph := ta.highestbars(high, prd) == 0 ? high : ph
pl := ta.lowestbars(low, prd) == 0 ? low : pl
phL:= ta.highestbars(high, prd) == 0 ? b : phL
plL:= ta.lowestbars(low, prd) == 0 ? b : plL
dir = phL>plL ? 1 : -1
//Delayed
if dir!=dir[1]
peaks.push(dir>0 ? (ph[1]-pl)/ph[1] : (ph-pl[1])/pl[1])
//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~}
// ~~ Functions {
Switch(Los)=>
autocalc = na(peaks.median())?0:peaks.median()
output = switch step
"Auto" => Los?low-(low*autocalc):high+(high*autocalc)
"Percentage" => Los?low-(low*perc):high+(high*perc)
"Pivot" => Los?pl:ph
Cleaner(arr)=>
if arr.size()>0
for a in arr
a.delete()
arr.clear()
ts = switch tblSize
"Tiny" => size.tiny
"Small" => size.small
"Normal" => size.normal
"Large" => size.large
"Huge" => size.huge
"Auto" => size.auto
//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~}
// ~~ Trailing Mangement {
var longtsl = Switch(true)
var shorttsl = Switch(false)
var pos = 0
if low<=longtsl
longtsl := Switch(true)
shorttsl := Switch(false)
pos := -1
if high>=shorttsl
longtsl := Switch(true)
shorttsl := Switch(false)
pos := 1
pos := bias=="Bullish"?1:bias=="Bearish"?-1:pos
//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~}
// ~~ Plots {
active = longtsl==longtsl[1]
lt1 = plot(longtsl,color=active?pos>0?dncol:upcol:na, title="TSL")
st1 = plot(shorttsl,color=active?pos>0?upcol:dncol:na, title="TSL")
p1 = plot(close,"",color(na),editable=false,display=display.none)
mid = math.avg(longtsl,shorttsl)
plot(mid,color=active?color.rgb(125, 196, 255):na, style=plot.style_steplinebr, title="Mid")
PosOver = pos ==-1 and close>mid?na:upcol1
NegUnder = pos ==1 and close<mid?na:dncol1
fill(p1,lt1,pos>0 and active?color.new(PosOver,80):active?color.new(NegUnder,80):na, title="")
fill(p1,st1,pos>0 and active?color.new(upcol,80):active?color.new(dncol,80):na, title="")
//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~}
// ~~ Table {
if barstate.islast
tpdist = pos>0?shorttsl-close:close-longtsl
sldist = pos>0?close-longtsl:shorttsl-close
distdiff = tpdist/sldist
wr = (1/(1+distdiff))*100
if showTable
var tbl = table.new(posi, 2, 5, frame_color=color.black, frame_width=3, border_width=2, border_color=color.new(color.white, 100))
tbl.cell(0, 0, 'Risk/Reward', text_halign=text.align_center, bgcolor=Table_BG, text_color=Table_Text, text_size=ts)
tbl.cell(1, 0, "1:"+str.tostring(math.round(distdiff,2)), text_halign=text.align_center, bgcolor=Table_BG, text_color=Table_Text, text_size=ts)
tbl.cell(0,1, 'Minimum Winrate', text_halign=text.align_center, bgcolor=Table_BG, text_color=Table_Text, text_size=ts)
tbl.cell(1,1, str.tostring(wr,format.percent), text_halign=text.align_center, bgcolor=Table_BG, text_color=Table_Text, text_size=ts)
tbl.cell(0, 2, 'Reward', text_halign=text.align_center, bgcolor=Table_BG, text_color=Table_Text, text_size=ts)
tbl.cell(1, 2, str.tostring((tpdist/close)*100,format.percent), text_halign=text.align_center, bgcolor=Table_BG, text_color=Table_Text, text_size=ts)
tbl.cell(0, 3, 'Risk', text_halign=text.align_center, bgcolor=Table_BG, text_color=Table_Text, text_size=ts)
tbl.cell(1, 3, str.tostring((sldist/close)*100,format.percent), text_halign=text.align_center, bgcolor=Table_BG, text_color=Table_Text, text_size=ts)
tbl.cell(0, 4, 'Bias', text_halign=text.align_center, bgcolor=Table_BG, text_color=Table_Text, text_size=ts)
tbl.cell(1, 4, str.tostring(pos>0?"Bullish":"Bearish"), text_halign=text.align_center, bgcolor=pos>0?color.rgb(104, 218, 108):color.red, text_color=Table_Text, text_size=ts)
//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~}
// ~~ Break-Even Curve {
if showBE
Cleaner(curve)
top = lo + (hi-lo)/3
float prev_y = top
for j=b+100 to b+200 by 1
y = prev_y-((prev_y-lo)/14)
curve.push(line.new(j,prev_y,j+1,y,color=color.blue, width=2))
prev_y := y
//Create & 업데이트 Frame
var box box_upper_left = box.new(na,na,na,na,na, text="Zone 2", text_color = color.white, bgcolor=color.new(color.lime, 80))
var box box_upper_right = box.new(na,na,na,na,na, text="The Magic Zone",text_color = color.white, bgcolor=color.new(color.lime, 70))
var box box_lower_left = box.new(na,na,na,na,na, text ="Zone 1", text_color = color.white,bgcolor=color.new(color.green, 70))
var box box_lower_right = box.new(na,na,na,na,na, text="Zone 3", text_color = color.white,bgcolor=color.new(color.green, 80))
box_upper_left.set_lefttop(b+100,top)
box_upper_left.set_rightbottom(b+150,(top+lo)/2)
box_upper_right.set_lefttop(b+150,top)
box_upper_right.set_rightbottom(b+200,(top+lo)/2)
box_lower_left.set_lefttop(b+100,(top+lo)/2)
box_lower_left.set_rightbottom(b+150,lo)
box_lower_right.set_lefttop(b+150,(top+lo)/2)
box_lower_right.set_rightbottom(b+200,lo)
// Delete & Add labels
Cleaner(labs)
for i=0 to 10
labs.push(label.new(chart.point.from_index(b+100,lo+i*(top-lo)/10), str.tostring(i*2)+"R", color=color(na), textcolor=chart.fg_color, style=label.style_label_right))
labs.push(label.new(chart.point.from_index(b+100+i*10, lo), str.tostring(i * 10) + "%", color=color(na), textcolor=chart.fg_color, style=label.style_label_up))
// Dot for the 'Break-Even Point'
y = (top-lo)*(distdiff/20)
dot := label.new(chart.point.from_index(b+100+int(wr),lo+y),
style=label.style_circle,color=color.yellow,size=size.tiny)
(dot[1]).delete()
// ~~ labels {
var label stopLossLabel = na
var label riskRewardLabel = na
stoploss = pos>0?longtsl:shorttsl
riskreward = pos>0?shorttsl:longtsl
if labels
stopLossLabel := label.new(bar_index+5, stoploss, "Risk" + " " + str.tostring((sldist/close)*100,format.percent), color=dncol, textcolor=color.white, style=label.style_label_left, yloc=yloc.price)
riskRewardLabel := label.new(bar_index+5, riskreward, "Reward" + " " + str.tostring((tpdist/close)*100,format.percent), color=upcol, textcolor=color.white, style=label.style_label_left, yloc=yloc.price)
label.delete(stopLossLabel[1])
label.delete(riskRewardLabel[1])
//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~}
// ~~ Trend Change
switchUp = pos==1
switchDn = pos==-1
plotshape(switchUp and switchDn[1]?longtsl:na, location=location.absolute, style=shape.triangleup, color=upcol, size=size.small, title="Positive Trend")
plotshape(switchDn and switchUp[1]?shorttsl:na, location=location.absolute, style=shape.triangledown ,color=dncol, size=size.small, title="Negative Trend")
//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~}
2024-05-16
1133
글번호 179621
답변완료
문의드립니다.
87137번의 연장선에서 몇가지 더 문의드리겠습니다.
input : RSIP(14);
var : R(0),B(0),S(0),HH(0),LL(0),BPrice(0),SPrice(0);
var : k(0),lk(0);
R = RSI(RSIP);
k = StochasticsK(10,5);
if CrossUp(R,40) Then
{
B = 1;
if MarketPosition <= 0 and B[1] == -1 and ll < 30 and lk < 20 Then
{
BPrice = C;
Buy();
}
}
if CrossDown(R,40) Then
{
B = -1;
ll = R;
lk = k;
}
if B == -1 Then
{
if R < ll Then
ll = R;
if k < lk Then
lk = k;
}
------------------------------------------------------------------
1. 위의 식은 RSI가 40이하로 가서 RSI가 30이하와 스톡 20이하 조건을 만족한 후 RSI 40을 돌파할 때 매수신호가 나오는 식입니다. RSI 30이하+스톡 20이하에 추가로 20선 이격도 조건도 추가해서 작성하고 싶습니다.
var : Period1(20), DParity1(0);
DParity1 = Disparity(Period1);
20선 이격도로 99.90 이하입니다.
2. 위에 매수식만 있는데 1번을 포함해 반대 수치로 매도식도 함께 부탁드립니다.
늘 노고에 감사드립니다~
2024-05-17
782
글번호 179620
답변완료
검색식 부탁 드려요
아래신호수식을 예스트레이더로 종목검색 하고 싶은데요 단, 0봉전부터~60봉전 까지의 종목을 모두 검색하는 조건식을
만들고 싶습니다. 좋은 하루 되세요.
wvf = ((highest(C, 22) - low) / highest(C, 22)) * 100;
sDev = 2.0 * stdev(wvf, 20);
midLine = avg(wvf, 20);
upperBand = midLine + sDev;
rangeHigh = (highest(wvf, 50)) * ph;
os = (wvf >= upperBand) or (wvf >= rangeHigh);
ap = (HIGH+LOW+CLOSE)/3;
esa = eavg(ap, 기간1);
d = eavg(abs(ap - esa), 기간1);
ci = (ap - esa) / (0.015 * d);
wt1 = eavg(ci,기간2);
wt2 = avg(wt1,4);
A=Lowest(L, 260, 1);
A1=Lowest(L, 260, 1)*1.25;
A2=요일(DATE);
A3=Valuewhen(1,A2(1)>A2,O);
MO=floor(date/100);
MO1=MO%100;
A4=VALUEWHEN(1, MO1!=MO1(1),O);
wt1(1)<=-53 && (os(1) or os) && wvf(1)<wvf &&
(Crossup(wt1,wt2) or Crossup(wt1,-60) or Crossup(wt1,-53)) && C>O && A1>=C && A<=C && (A3<=C OR A4<=C)
-지표조건설정
기간1 : 10
기간2 : 21
PH : 0.85
2024-05-16
905
글번호 179618
답변완료
종목검색식 요청드립니다.
아래 조건을 만족하는 종목을 검색하는 검색기를 만들고 싶습니다. 도움 부탁드리며 항상 감사합니다.^^
키움수식 1. 라인
M=Trix(12);
ValueWhen(1,CrossUp(M,0),h)
키움수식 2. TSF(20)라인
키움수식 3. 보조지표 (Period : 10)
(eavg(eavg(eavg(v,period),period),period) -
eavg(eavg(eavg(v(1),period),period),period)) /
eavg(eavg(eavg(v(1),period),period),period)*100
키움수식 4. 매수/매도체결 보조지표
4-1) 매수체결수식
A=IF(C>O,V,0);
B=SUM(A);
D=ValueWhen(1,Date(1)!=Date,B(1));
B-D;
4-2) 매도체결수식
A=IF(C<O,V,0);
B=SUM(A);
D=ValueWhen(1,Date(1)!=Date,B(1));
B-D;
만들고 싶은 종목검색식은 아래 3가지 조건을 모두 만족하는 종목을 검색하는 검색식을 만들고 싶습니다.
1. 키움수식1 라인을 키움수식2 라인이 상향돌파 (Period 수치 변경가능하도록 요청)
2. 키움수식3 보조지표의 값이 0 이상 (수치값 변경 가능하도록 요청)
3. 키움수식4 매수체결수식값 > 매도체결수식값
2024-05-16
816
글번호 179616
답변완료
돌파 조건 검색식 부탁 합니다
변동성라
A=PREDAYHIGH()-PREDAYLOW();
B=DAYOPEN()+A*0.5;
B1=RSI(2);
A1= LinearRegressionValue(C,기간,0);
A2= LinearRegressionValue(A1,기간,0);
eq=A1-A2;
VL=A1+eq;
지표조건
기간 25
H연장라인
조건=Highest(H,L기간+R기간+1)==H(R기간);
valuewhen(1,조건,H(R기간),1)
지표조건
L기간 15
R기간 12
H 연장라인을 변동성라인이 돌파하는 검색식 부탁드립니다
감사 합니다
2024-05-17
898
글번호 179615