커뮤니티
예스랭귀지 Q&A
답변완료
[공지] 예스랭귀지 AI 어시스턴트, '예스나 AI' 출시 및 무료 체험 안내
안녕하세요, 예스스탁 입니다.복잡한 수식 공부 없이 여러분의 아이디어를 말하면 시스템 트레이딩 언어 예스랭귀지로 작성해주는 서비스예스나 AI(YesNa AI)가 출시되었습니다.지금 예스나 AI를 직접 경험해 보실 수 있도록 20크레딧(질문권 20회)를 무료로 증정해 드리고 있습니다.바로 여러분의 아이디어를 코드로 변환해보세요.--------------------------------------------------🚀 YesNa AI 핵심 기능- 지표식/전략식/종목검색식 생성: 자연어로 요청하면 예스랭귀지 문법에 맞는 코드를 작성합니다.- 종목검색식 변환 지원: K증권의 종목 검색식을 예스랭귀지로 변환 지원합니다.- 컴파일 검증: 작성된 코드가 실행 가능한지 컴파일러를 통해 문법 검증을 거쳐 결과물을 제공합니다.상세한 서비스 개요 및 활용 방법은 [서비스 소개 페이지]에서 확인하실 수 있습니다.▶ 서비스 소개 페이지: 바로가기서비스 사용 유의사항 및 결제 환불정책은 [이용약관]을 참고 부탁드립니다.▶ 서비스 이용약관: 바로가기💬 이용 문의사용 중 문의사항은 [프로그램 사용법 Q&A] 게시판에서 [예스나 AI] 카테고리를 설정 후 문의해 주시면 상세히 안내해 드리겠습니다.--------------------------------------------------앞으로도 AI를 활용한 다양한 트레이딩 기능들을 지속적으로 선보일 예정입니다.많은 관심과 기대 부탁드립니다.
2026-02-27
3758
글번호 230811
답변완료
수식 작성 부탁 드립니다
예스스탁 참조데이타에서 KOSPI (KP 개인 순매수 금액, KP외국인 순매수 금액) 을
매수 진입 조건에 DATA2 로 사용 할수 있도록 작성 부탁 드립니다
KP 개인 순매수 금액 > 0, KP 외국인 순매수 금액 > 0 일 때 매수진입
아래 비슷한 수식 형태로 부탁 드립니다
input : Period1(5),Period2(20);
var1 = data2(KP 개인 순매수 금액);
var2 = data2(KP 외국인 순매수 금액);
if var1 > 0 and var2 > 0 and 진입조건 then buy("b");
2020-03-09
199
글번호 136694
답변완료
수정 부탁드립니다
안녕하세요?
아래의 두가지 수식이 하루 매매횟수가 맞질않습니다.
외부변수에서 1회로 설정해 놓아도 여러번 거래되는날이 많네요.
수정부탁드립니다.
감사합니다.
[1]
input : 매수음봉틱수(5),매수양봉틱수(5);
input : 매도양봉틱수(5),매도음봉틱수(5);
input : 진입횟수(5);
input : 익절틱수(50),손절틱수(50);
input : P1(5),P2(20);
var : entry(0),mav1(0),mav2(0);
mav1 = ma(C,P1);
mav2 = ma(C,P2);
#영업일 변경
if bdate != bdate[1] Then
entry = 0;
#포지션이 변경되어 새로운 진입포지션 발생시마다 1씩 증가
if MarketPosition != 0 and MarketPosition != MarketPosition[1] Then
entry = entry+1;
if mav1 > mav2 and #정배열
entry < 진입횟수 and #진입횟수가 지정한 값 이하
MarketPosition == 0 and #매수나 무포지션 상태
C[1] == O[1]+매도양봉틱수*PriceScale and #1봉전종가가 1봉전시가+매도양봉틱수 이상
C[0] == O[0]-매도음봉틱수*PriceScale Then #현재봉 종가가 1봉전시가-매도음봉틱수 이하
sell("s");
if mav1 < mav2 and #역배열
entry < 진입횟수 and #진입횟수가 지정한 값 이하
MarketPosition == 0 and #매도나 무포지션 상태
C[1] == O[1]-매수음봉틱수*PriceScale and #1봉전종가가 1봉전시가-매수음봉틱수 이하
C[0] == O[0]+매수양봉틱수*PriceScale Then #현재봉 종가가 1봉전시가+매수양봉틱수 이상
buy("b");
#매수진입 후 손절되면 매도로 스위칭
if MarketPosition == 1 Then
sell("bs",AtStop,EntryPrice-PriceScale*손절틱수);
#매도진입 후 손절되면 매수로 스위칭
if MarketPosition == -1 Then
buy("sb",AtStop,EntryPrice+PriceScale*손절틱수);
#목표수익 설정
SetStopProfittarget(PriceScale*익절틱수,PointStop);
[2]
input : 매수음봉틱수(5),매수양봉틱수(5);
input : 매도양봉틱수(5),매도음봉틱수(5);
input : 진입횟수(5);
input : 익절틱수(50),손절틱수(50);
var : entry(0);
#영업일 변경
if bdate != bdate[1] Then
entry = 0;
#포지션이 변경되어 새로운 진입포지션 발생시마다 1씩 증가
if MarketPosition != 0 and MarketPosition != MarketPosition[1] Then
entry = entry+1;
if entry < 진입횟수 and #진입횟수가 지정한 값 이하
MarketPosition == 0 and #매수나 무포지션 상태
C[1] == O[1]+매도양봉틱수*PriceScale and #1봉전종가가 1봉전시가+매도양봉틱수 이상
C[0] == O[0]-매도음봉틱수*PriceScale Then #현재봉 종가가 1봉전시가-매도음봉틱수 이하
sell("s");
if entry < 진입횟수 and #진입횟수가 지정한 값 이하
MarketPosition == 0 and #매도나 무포지션 상태
C[1] == O[1]-매수음봉틱수*PriceScale and #1봉전종가가 1봉전시가-매수음봉틱수 이하
C[0] == O[0]+매수양봉틱수*PriceScale Then #현재봉 종가가 1봉전시가+매수양봉틱수 이상
buy("b");
#매수진입 후 손절되면 매도로 스위칭
if MarketPosition == 1 Then
sell("bs",AtStop,EntryPrice-PriceScale*손절틱수);
#매도진입 후 손절되면 매수로 스위칭
if MarketPosition == -1 Then
buy("sb",AtStop,EntryPrice+PriceScale*손절틱수);
#목표수익 설정
SetStopProfittarget(PriceScale*익절틱수,PointStop);
2020-03-09
210
글번호 136693
답변완료
수식문의 드립니다.
1. 매수 조건 - 120이평선 아래서 5일 이평선이 20일 이평선을 상향 돌파시 매수
매도 조건 - 120이평선 위에서 5일 이평선이 20일 이평선을 하향 돌파시 매도
2. 매수 조건 - 5일 이평선이 60일 이평선을 상향 돌파시 매수
(단 1번 매도조건 다음에만 발동)
매도 조건 - 5일 이평선이 60일 이평선을 하향 돌파시 매도
(단 1번 매수조건 다음에만 발동)
3. 매수 조건 - 20일 이평선이 120일 이평선을 상향 돌파시 매수
(단 2번 매도조건 다음에만 발동)
매도 조건 - 20일 이평선이 120이 이평선을 하향 돌파시 매도
(단 2번 매수조건 다음에만 발동)
1번 조건 매수 후 다음 1번 매도 조건 전에 2번 조건 만족시 발동, 3번조건 만족시 발동 이런식으로 프로그램을 만들고 싶은데.. 도와주세요..
2020-03-09
245
글번호 136692
답변완료
수식문의
키움수식을 예스수식으로 변경 부탁드립니다.
MACD 0선 상향돌파
CrossUp(MACD(shortPeriod,longPeriod),0)
CrossDown(MACD(shortPeriod,longPeriod),0)
MACD-sig와 골든크로스
CrossUp(MACD(shortPeriod,longPeriod),eavg(MACD(shortPeriod,longPeriod),sigPeriod))
CrossDown(MACD(shortPeriod,longPeriod),eavg(MACD(shortPeriod,longPeriod),sigPeriod))
2020-03-09
308
글번호 136691
답변완료
문의드립니다.
// Inputs
mac = ma(close,2)
mal = ma(low,4)
mah = ma(high,5)
// Calculations
short = (mac - mah)>= (mal-mac)
long = (mac - mah)
neut = (mal- mac) > ( mac - mah)
// plot indicator
plot(mac-mah, color = red,linewidth = 2)
plot(mal-mac, color = red, linewidth = 2)
barcolor(long ? red :red)
barcolor(neut ? yellow :na)
수식 변환과 이 수식에 기준선 1.5 추가 부탁드릴 수 있을까요
감사합니다.
2020-03-09
319
글번호 136690
답변완료
66312 문의드립니다
안녕하세요?
만들어주신수식 2가지중 1번수식은 소리출력이 잘되는데
2번수식이 소리출력이되지않는데 검토한번만 부탁드립니다
감사합니다
2020-03-09
337
글번호 136689
답변완료
수식변형 부탁드립니다
예스트레어더에서 사용할수 있게 수식 변형좀 해주시면 감사하겠습니다.
//
// @author LonesomeTheBlue
//
//@version=3
study("Higher High Lower Low Strategy", overlay =true)
lb = input(2, title="Left Bars", minval = 1)
rb = input(2, title="Right Bars", minval = 1)
showsupres = input(true, title="Show Support/Resistance")
changebarcol = input(true, title="Change Bar Color")
mb = lb + rb + 1
ph = iff(not na(high[mb]), iff(highestbars(high, mb) == -lb, high[lb], na), na) // Pivot High
pl = iff(not na(low[mb]), iff(lowestbars(low, mb) == -lb, low[lb], na), na) // Pivot Low
hl = na
hl := iff(ph, 1, iff(pl, -1, na)) // Trend direction
zz = na
zz := iff(ph, ph, iff(pl, pl, na)) // similar to zigzag but may have multiple highs/lows
zz :=iff(pl and hl == -1 and valuewhen(hl, hl, 1) == -1 and pl > valuewhen(zz, zz, 1), na, zz)
zz :=iff(ph and hl == 1 and valuewhen(hl, hl, 1) == 1 and ph < valuewhen(zz, zz, 1), na, zz)
hl := iff(hl==-1 and valuewhen(hl, hl, 1)==1 and zz > valuewhen(zz, zz, 1), na, hl)
hl := iff(hl==1 and valuewhen(hl, hl, 1)==-1 and zz < valuewhen(zz, zz, 1), na, hl)
zz := iff(na(hl), na, zz)
findprevious()=> // finds previous three points (b, c, d, e)
ehl = iff(hl==1, -1, 1)
loc1 = 0.0, loc2 = 0.0, loc3 = 0.0, loc4 = 0.0
xx = 0
for x=1 to 1000
if hl[x]==ehl and not na(zz[x])
loc1 := zz[x]
xx := x + 1
break
ehl := hl
for x=xx to 1000
if hl[x]==ehl and not na(zz[x])
loc2 := zz[x]
xx := x + 1
break
ehl := iff(hl==1, -1, 1)
for x=xx to 1000
if hl[x]==ehl and not na(zz[x])
loc3 := zz[x]
xx := x + 1
break
ehl := hl
for x=xx to 1000
if hl[x]==ehl and not na(zz[x])
loc4 := zz[x]
break
[loc1, loc2, loc3, loc4]
a = na, b = na, c = na, d = na, e = na
if not na(hl)
[loc1, loc2, loc3, loc4] = findprevious()
a := zz
b := loc1
c := loc2
d := loc3
e := loc4
_hh = zz and (a > b and a > c and c > b and c > d)
_ll = zz and (a < b and a < c and c < b and c < d)
_hl = zz and ((a >= c and (b > c and b > d and d > c and d > e)) or (a < b and a > c and b < d))
_lh = zz and ((a <= c and (b < c and b < d and d < c and d < e)) or (a > b and a < c and b > d))
plotshape(_hl, text="HL", title="Higher Low", style=shape.labelup, color=lime, textcolor=black, location=location.belowbar, transp=0, offset = -lb)
plotshape(_hh, text="HH", title="Higher High", style=shape.labeldown, color=lime, textcolor=black, location=location.abovebar, transp=0, offset = -lb)
plotshape(_ll, text="LL", title="Lower Low", style=shape.labelup, color=red, textcolor=white, location=location.belowbar, transp=0, offset = -lb)
plotshape(_lh, text="LH", title="Lower High", style=shape.labeldown, color=red, textcolor=white, location=location.abovebar, transp=0, offset = -lb)
res = na, sup = na
res := iff(_lh, zz, res[1])
sup := iff(_hl, zz, sup[1])
trend = na
trend := iff(close > res, 1, iff(close < sup, -1, nz(trend[1])))
res := iff((trend == 1 and _hh) or (trend == -1 and _lh), zz, res)
sup := iff((trend == 1 and _hl) or (trend == -1 and _ll), zz, sup)
plot(showsupres ? res : na, title="Resistance", color= na(res) ? na : red, linewidth=2, style=circles, offset = -lb)
plot(showsupres ? sup : na, title="Support", color= na(sup) ? na : blue, linewidth=2, style=circles, offset = -lb)
barcolor(color = iff(changebarcol, iff(trend == 1, blue, black), na))
2020-03-09
473
글번호 136688
답변완료
부탁좀 드리겠습니다.
1. 아래수식 변환 부탁드립니다.
강세 PVI(c) >= eavg(PVI(c),period)
약세 PVI(c) < eavg(PVI(c),period)
period : 10
2. 아래수식 변환부탁드립니다
2-1 지표식
2-2 시스템
수식1
HighestSince(1, CrossUp(Trix(period),0),HIGH)
수식2
LowestSince(1, CrossDown(Trix(period),0),LOW)
period : 10
3. 아래수식 변환부탁드립니다
3-1 지표식
3-2 시스템
수식1
a=avg(c,20);
valuewhen(1,a>=a(1),a)
수식2
valuewhen(1,a<a(1),a)
2020-03-09
412
글번호 136687
답변완료
부탁드립니다.
-분봉차트에서 특정시간(예: @17:00:00)을 기준하여 이틀전 특정시간(예: d-2 @16:59:00)까지 즉 48시간내의 최고가와 최저가를 구하는 지표를 부탁드립니다.
2020-03-08
392
글번호 136686