커뮤니티
예스랭귀지 Q&A
답변완료
[공지] 예스랭귀지 AI 어시스턴트, '예스나 AI' 출시 및 무료 체험 안내
안녕하세요, 예스스탁 입니다.복잡한 수식 공부 없이 여러분의 아이디어를 말하면 시스템 트레이딩 언어 예스랭귀지로 작성해주는 서비스예스나 AI(YesNa AI)가 출시되었습니다.지금 예스나 AI를 직접 경험해 보실 수 있도록 20크레딧(질문권 20회)를 무료로 증정해 드리고 있습니다.바로 여러분의 아이디어를 코드로 변환해보세요.--------------------------------------------------🚀 YesNa AI 핵심 기능- 지표식/전략식/종목검색식 생성: 자연어로 요청하면 예스랭귀지 문법에 맞는 코드를 작성합니다.- 종목검색식 변환 지원: K증권의 종목 검색식을 예스랭귀지로 변환 지원합니다.- 컴파일 검증: 작성된 코드가 실행 가능한지 컴파일러를 통해 문법 검증을 거쳐 결과물을 제공합니다.상세한 서비스 개요 및 활용 방법은 [서비스 소개 페이지]에서 확인하실 수 있습니다.▶ 서비스 소개 페이지: 바로가기서비스 사용 유의사항 및 결제 환불정책은 [이용약관]을 참고 부탁드립니다.▶ 서비스 이용약관: 바로가기💬 이용 문의사용 중 문의사항은 [프로그램 사용법 Q&A] 게시판에서 [예스나 AI] 카테고리를 설정 후 문의해 주시면 상세히 안내해 드리겠습니다.--------------------------------------------------앞으로도 AI를 활용한 다양한 트레이딩 기능들을 지속적으로 선보일 예정입니다.많은 관심과 기대 부탁드립니다.
2026-02-27
1706
글번호 230811
2wnwn 님에 의해서 삭제되었습니다.
2024-09-13
113
글번호 183450
답변완료
6중4 두번째 진입변수 제어
아래수식은 진입변수를 사용하여 2번 거래하는 수식입니다.
요청내용)
두번째 거래할 때는 진입변수를 달리하여 진입하고 싶습니다.
input : d1(0),d2(200),d3(0),d4(12),d5(15000),d6(5000);//첫번째 진입변수
input : dd1(0),dd2(200),dd3(0),dd4(12),dd5(15000),dd6(5000);//두번째 진입변수
이런식으로 첫번째 진입과 두번째 진입의 변수를 제어하는 수식을 추가해 주십시요.
항상 고맙습니다.
***********************************************************************************
input : 횟수(2);
input : d1(0),d2(200),d3(0),d4(12),d5(15000),d6(5000);//진입변수
input : n(6);
var : T1(0),entry(0);
if Bdate != Bdate[1] Then
T1 = TotalTrades;
if MarketPosition == 0 Then
entry = TotalTrades-T1;
Else
entry = (TotalTrades-T1)+1;
var : Cond1(False),Cond2(False),Cond3(False),Cond4(False),Cond5(False),Cond6(False);
var : count(0);
Cond1 = data1(c>lowd(0)+d1); //매수조건1
Cond2 = data2(c>lowd(0)+d2); //매수조건2
Cond3 = data3(c>lowd(0)+d3); //매수조건3
Cond4 = data4(c>lowd(0)+d4); //매수조건4
Cond5 = data5(c>lowd(0)+d5); //매수조건5
Cond6 = data6(c<highd(0)-d6); //매수조건6
count = 0;
if cond1 == true Then
count = count+1;
if cond2 == true Then
count = count+1;
if cond3 == true Then
count = count+1;
if cond4 == true Then
count = count+1;
if cond5 == true Then
count = count+1;
if cond6 == true Then
count = count+1;
if count >= n and entry<횟수 then
Buy("b");
2024-11-06
617
글번호 183449
답변완료
검색식 부탁드립니다.
안녕하세요
오늘의 주가가 선행스팬1의 선행된 25일중의 최저점을 돌파하는 종목검색
오늘의 주가가 선행스팬1의 선행된 25일중의 최고점을 돌파하는 종목검색
현재봉기준 과거 100봉중에 52번째봉이 최저점인 졸목검색 (저가기준, 종가기준)
(과거 100봉--------------52번째봉(최저점,저가기준과 종가기준)-----------현재봉)
검색식부탁드립니다.
2024-09-16
858
글번호 183448
답변완료
부탁드립니다.
트레이딩 뷰 수식입니다.
적용가능하도록 부탁 드립니다.
indicator("Sentiment Range MA [ChartPrime]", overlay = true, timeframe = "", timeframe_gaps = false)
simple_filter(float source, int length, bool duel_filter)=>
switch duel_filter
false => ta.wma(source, length)
true => ta.wma(ta.sma(source, length), length)
sr_ma(float source = close, int output_smoothing = 3, int trigger_smoothing = 1, int atr_length = 50, float multiplier = 1, string range_switch = "Body", bool duel_filter = false)=>
candle_top = range_switch != "Body" ? high : math.max(open, close)
candle_bottom = range_switch != "Body" ? low : math.min(open, close)
smooth_top = ta.sma(candle_top, trigger_smoothing)
smooth_bottom = ta.sma(candle_bottom, trigger_smoothing)
tr = candle_top - candle_bottom
atr = ta.sma(tr, atr_length)
var float sr_ma = na
var float current_range = na
var float top_range = na
var float bottom_range = na
flag = smooth_top > top_range or smooth_bottom < bottom_range or na(current_range)
if flag
sr_ma := source
current_range := atr * multiplier
top_range := sr_ma + current_range
bottom_range := sr_ma - current_range
out = simple_filter(sr_ma, output_smoothing, duel_filter)
smooth_top_range = simple_filter(top_range, output_smoothing, duel_filter)
smooth_bottom_range = simple_filter(bottom_range, output_smoothing, duel_filter)
[out, smooth_top_range, smooth_bottom_range]
source = input.source(close, "Source", group = "Settings")
output_smoothing = input.int(20, "Length", minval = 0, group = "Settings") + 1
use_double = input.bool(true, "Double Filter", group = "Settings")
smoothing = input.int(4, "Trigger Smoothing", minval = 0, group = "Settings") + 1
atr_length = input.int(200, "ATR Length", minval = 1, group = "Settings")
multiplier = input.float(6, "Range Multiplier", minval = 0, step = 0.125, group = "Settings")
range_switch = input.string("Body", "Range Style", ["Body", "Wick"], group = "Settings")
style = input.string("MA Direction", "Color Style", ["MA Direction", "MA Cross", "Solid"], group = "Color")
bullish_color = input.color(color.rgb(33, 255, 120), "Bullish Color", group = "Color")
bearish_color = input.color(color.rgb(255, 33, 33), "Bearish Color", group = "Color")
neutral_color = input.color(color.rgb(137, 137, 137), "Neutral Color", "This doubles as the solid color.", group = "Color")
[sr_ma, top_range, bottom_range] = sr_ma(source, output_smoothing, smoothing, atr_length, multiplier, range_switch, use_double)
var color ma_delta = na
var color ma_cross = na
plot_neutral = high > sr_ma and low < sr_ma
plot_bullish = low > sr_ma
plot_bearish = high < sr_ma
if plot_bullish
ma_cross := bullish_color
if plot_bearish
ma_cross := bearish_color
if plot_neutral
ma_cross := neutral_color
ma_delta_neutral = sr_ma - nz(sr_ma[1]) == 0
ma_delta_bullish = sr_ma - nz(sr_ma[1]) > 0
ma_delta_bearish = sr_ma - nz(sr_ma[1]) < 0
if ma_delta_bullish
ma_delta := bullish_color
if ma_delta_bearish
ma_delta := bearish_color
if ma_delta_neutral
ma_delta := neutral_color
ma_color = style == "MA Cross"? ma_cross : style == "MA Direction" ? ma_delta : neutral_color
alpha = color.new(color.red, 100)
ma = plot(sr_ma, "SR MA", ma_color, 3)
top = plot(top_range, "Top Range", alpha)
bottom = plot(bottom_range, "Bottom Range", alpha)
fill(ma, top, top_value = top_range, bottom_value = sr_ma, bottom_color = color.new(ma_color, 82), top_color = alpha)
fill(ma, bottom, top_value = sr_ma, bottom_value = bottom_range, top_color = color.new(ma_color, 82), bottom_color = alpha)
2024-09-12
817
글번호 183447
답변완료
N봉 이후 진입식
조건 발생후 N봉차 진입식 부탁드립니다
2024-09-12
634
글번호 183446
도움 부탁드립니다
안녕하세요
한가위 명절은 잘 보내셨는지요?
다름이 아니라 아래 수식의 칼라를 정확한 rgb 칼라로 구현하고 싶습니다.
감사합니다.
Box_SetBegin(box,date1,time1,hh);
Box_SetEnd(box,NextBarSdate,NextBarStime,ll);
if c > oo Then
Box_SetColor(box,Red);
Else if c < oo Then
Box_SetColor(box,Blue);
Else
Box_SetColor(box,Green);
}
2024-09-12
731
글번호 183445
답변완료
안녕하세요 수식 검토 부탁드립니다~
안녕하세요 수식 작성 감사드립니다.
아래 1번, 2번, 3번 수식이 작동되지 않아 검토를 부탁드립니다.
1번, 3번 종목검색식은 데이터가 존재하지 않는다고 나오고요.
(검색에 필요한 최소기간 500봉, 1분봉에서 작동해 봤습니다.)
2번 강조수식을 작성하여 차트에 적용했으나 캔들에 색깔이 표시안되고요.
수식검증은 모두 성공이었습니다.
오늘 13일 금요일 장중에 작동시켜 봤는데 3개 모두 어제 밤과 같은 상황입니다.
도움주셔서 늘 감사드립니다.
고맙습니다~
*******************************************************
안녕하세요
예스스탁입니다.
1
var : sumPL(0),T(0),b(0),count(0),ii(0);
if sdate != sdate[1] Then
{
sumPL = 0;
T = 0;
b = 0;
count = 0;
}
b = b+1;
sumPL = sumPL + (Upvol-DownVol);
if T == 1 Then
{
if sumPL < 0 Then
T = 0;
if sumPL < sumPL[1] Then
T = 0;
}
if sdate == sdate[5] and sumPL[5] > 0 and CountIf(sumPL>sumPL[1],5) == 5 Then
{
count = count+1;
ii = b;
}
if T == 1 and
count >= 1 and
Index <= ii+20 and
C > DayHigh(0)[1] Then
{
Find(1);
}
2
var : sumPL(0),T(0),b(0),count(0),ii(0);
if sdate != sdate[1] Then
{
sumPL = 0;
T = 0;
b = 0;
count = 0;
}
b = b+1;
sumPL = sumPL + (Upvol-DownVol);
if T == 1 Then
{
if sumPL < 0 Then
T = 0;
if sumPL < sumPL[1] Then
T = 0;
}
if sdate == sdate[5] and sumPL[5] > 0 and CountIf(sumPL>sumPL[1],5) == 5 Then
{
count = count+1;
ii = b;
}
if T == 1 and
count >= 1 and
Index <= ii+20 and
C > DayHigh(0)[1] Then
{
plotPaintBar(H,L,"강조",magenta);
}
3
var : sumPL(0),T(0),b(0),count(0),ii(0);
if sdate != sdate[1] Then
{
sumPL = 0;
T = 0;
b = 0;
count = 0;
}
b = b+1;
sumPL = sumPL + (Upvol-DownVol);
if T == 1 Then
{
if sumPL < 0 Then
T = 0;
if sumPL < sumPL[1] Then
T = 0;
}
if sdate == sdate[5] and sumPL[5] > 0 and CountIf(sumPL>sumPL[1],5) == 5 Then
{
count = count+1;
ii = b;
}
if T == 1 and
count >= 1 and
Index <= ii+20 and
C > DayHigh(0)[1] and
C >= DayOpen*1.01 and
C >= DayClose(1)*1.02 and
C <= DayClose(1)*1.15 Then
{
Find(1);
}
풍성한 한가위 되시길 바랍니다.
> 소나기 님이 쓴 글입니다.
> 제목 : 안녕하세요 수식 검토 부탁드립니다~
> 안녕하세요 그 동안 알려주신 여러가지 수식들을 조합해서
제가 만들어봤는데 잘 안되네요...
수식 검토 좀 부탁드리겠습니다.
조건1. 전일데이터는 제외, 당일 09시부터 데이터만 적용.
조건2. 당일 순매수체결량이 0이상.
조건3. N(20)봉 이내에 순매수체결량이 5봉연속 증가.
조건4. 당일 고가 돌파.
1. 당일 순매수체결량이 0이상이고,
N(20)봉 이내에 5봉연속 순매수체결량이 증가하면서
당일 고가를 돌파한 종목검색식.
(당일 n개봉 이내에서는 당일 n개봉 내에서 카운트 하고
n개봉 이후에는 최근 n개봉을 대상으로 카운트해서
1회이상 만족한 종목을 찾게해 주십시오.)
2. 위의 조건을 만족하는 캔들에 표시할 강조 수식.
3. 현재가가 시가대비 +1%이상 상승이고 전일대비 +2% ~ +15%상승한 종목검색식
위 3개의 수식을 부탁드립니다.
아래는 제가 조합해본 수식입니다.
var : sumPL(0),T(0);
if Bdate != Bdate[1] Then
{
sumPL = 0;
T = 0;
}
sumPL = sumPL + (Upvol-DownVol);
if T == 0 and sumPL > sumPL[1] Then
T = 1;
if T == 1 Then
{
if sumPL < 0 Then
T = 0;
if sumPL < sumPL[1] Then
T = 0;
}
if CountIf(T == 1 and (sumPL > 0 and sumPL[1] > 0 and sumPL[2] > 0
and sumPL[3] > 0 and sumPL[4] > 0 and sumPL[5] > 0) and
(sumPL > sumPL[1] and sumPL[1] > sumPL[2]
and sumPL[2] > sumPL[3]
and sumPL[3] > sumPL[4] and sumPL[4] > sumPL[5]),20) >=1 Then
{
Find(1);
}
수고에 감사드립니다.
고맙습니다~~
2024-09-13
747
글번호 183444
답변완료
예스트레이더 종목검색으로 요청합니다...
수고가 많습니다..
아래 첨부파일은 키움에서 작성한 조건검색 입니다..
예스트레이더 종목검색으로 변환부탁드립니다..
2024-09-12
699
글번호 183443
답변완료
수식추가
input : BBP(20),dv(2),ntime1(60),P1(10);
var : S1(0),D1(0),TM(0),TF(0),cnt(0);
var : sum1(0),mav1(0),bbup(0);
Array : CC[70](0);
var1 = ma(C,BBP);
bbup = BollBandUp(BBP,dv);
if Bdate != Bdate[1] Then
{
S1 = TimeToMinutes(stime);
D1 = sdate;
}
if D1 > 0 then
{
if sdate == D1 Then
TM = TimeToMinutes(stime)-S1;
Else
TM = TimeToMinutes(stime)+1440-S1;
TF = TM%ntime1;
if Bdate != Bdate[1] or
(Bdate == Bdate[1] and ntime1 > 1 and TF < TF[1]) or
(Bdate == Bdate[1] and ntime1 > 1 and TM >= TM[1]+ntime1) or
(Bdate == Bdate[1] and ntime1 == 1 and TM > TM[1]) Then
{
for cnt = 99 downto 1
{
CC[cnt] = CC[cnt-1];
}
}
CC[0] = C;
if CC[P1-1] > 0 then
{
sum1 = 0;
for cnt = 0 to P1-1
{
sum1 = sum1+CC[cnt];
}
mav1 = sum1/P1;
if CrossUp(c,var1) and CountIf(CrossDown(c,var1),30) >= 1 and
C > O and C > mav1 Then
Buy();
if MarketPosition == 1 and CountIf(H>=bbup,BarsSinceEntry) >= 1 and CrossDown(c,ma(C,10)) Then
ExitLong();
}
}
안녕하세요
Date 2 30분봉 추가
매수 기존식+30분봉 양보밀때
매도 기존식+ 30분봉 음보밀때
손절기능 추가
진입후 손절 매수 이평선 10선 하락돌파시
매도 이평10선 상승돌파시
2024-09-13
793
글번호 183442