커뮤니티
예스랭귀지 Q&A
답변완료
[공지] 예스랭귀지 AI 어시스턴트, '예스나 AI' 출시 및 무료 체험 안내
안녕하세요, 예스스탁 입니다.복잡한 수식 공부 없이 여러분의 아이디어를 말하면 시스템 트레이딩 언어 예스랭귀지로 작성해주는 서비스예스나 AI(YesNa AI)가 출시되었습니다.지금 예스나 AI를 직접 경험해 보실 수 있도록 20크레딧(질문권 20회)를 무료로 증정해 드리고 있습니다.바로 여러분의 아이디어를 코드로 변환해보세요.--------------------------------------------------🚀 YesNa AI 핵심 기능- 지표식/전략식/종목검색식 생성: 자연어로 요청하면 예스랭귀지 문법에 맞는 코드를 작성합니다.- 종목검색식 변환 지원: K증권의 종목 검색식을 예스랭귀지로 변환 지원합니다.- 컴파일 검증: 작성된 코드가 실행 가능한지 컴파일러를 통해 문법 검증을 거쳐 결과물을 제공합니다.상세한 서비스 개요 및 활용 방법은 [서비스 소개 페이지]에서 확인하실 수 있습니다.▶ 서비스 소개 페이지: 바로가기서비스 사용 유의사항 및 결제 환불정책은 [이용약관]을 참고 부탁드립니다.▶ 서비스 이용약관: 바로가기💬 이용 문의사용 중 문의사항은 [프로그램 사용법 Q&A] 게시판에서 [예스나 AI] 카테고리를 설정 후 문의해 주시면 상세히 안내해 드리겠습니다.--------------------------------------------------앞으로도 AI를 활용한 다양한 트레이딩 기능들을 지속적으로 선보일 예정입니다.많은 관심과 기대 부탁드립니다.
2026-02-27
3255
글번호 230811
답변완료
종목 검색식 부탁 드립니다.
안녕하십니까
항상 도움 주셔서 감사합니다.
수식>>
M1=ma(C,기간1,종류);
M2=ma(C,기간2,종류);
M3=ma(C,기간3,종류);
M4=ma(C,기간4,종류);
조건=M1>M2 && M2>M3 && M3>M4;
조건 && !조건(1)
조건>>
기간1 = 5
기간2 = 25
기간3 = 73
기간4 = 225
종류 = 단순
키움에서 신호로 사용하고 있습니다.
이걸 종목검색으로 찾고 싶습니다.
부탁드립니다.
감사합니다.
2023-01-18
638
글번호 165542
답변완료
수식부탁드립니다
Input : Period(20), Period1(10), Period2(10);
var : StoK(0),StoD(0),tx1(0);
StoK = StochasticsK(Period,Period1);
StoD = StochasticsD(Period,Period1,Period2);
if crossup(stod,50) Then
Text_New(sdate,stime,H,"■");
if crossdown(stod,50) Then
Text_New(sdate,stime,H,"■");
위 식에서 crossup(stod,50)식의 ■은 빨간색 추가,
crossdown(stod,50)식의 ■은 녹색으로 표시가능할까요?
2023-01-18
637
글번호 165541
답변완료
수식 부탁드립니다
수고 하십니다.
아래 지표의 30분 지표값을 5분봉 차트에 표시하고 싶습니다.
수고 하세요...
#######
input : start(0.02),increment(0.02),maximum(0.2);
var : haopen(0),haclose(0),hahigh(0),halow(0),hacolor(0);
var : af(0),trend_dir(0),ep(0),trend_bars(0),psar(0);
var : sar_long_to_short(False),sar_short_to_long(False),trend_change(False);
// Calculation HA Values
if index == 0 then
{
haOpen = open;
haClose = (O+H+L+C)/4;
haHigh = MaxList( high, haOpen, haClose);
haLow = MinList( low, haOpen,haClose);
}
else
{
haClose = (O+H+L+C)/4;
haOpen = (haOpen [1] + haClose [1])/2 ;
haHigh = MaxList(High, haOpen, haClose) ;
haLow = MinList(Low, haOpen, haClose) ;
}
// HA colors
hacolor = iff(haclose > haopen , green ,red);
psar = 0.0; // PSAR
af = 0.0; // Acceleration Factor
trend_dir = 0; // Current direction of PSAR
ep = 0.0; // Extreme point
trend_bars = 0;
sar_long_to_short = trend_dir[1] == 1 and haclose <= psar[1]; // PSAR switches from long to short
sar_short_to_long = trend_dir[1] == -1 and haclose >= psar[1]; // PSAR switches from short to long
trend_change = IsNaN(psar[2]) == true or sar_long_to_short or sar_short_to_long;
// Calculate trend direction
trend_dir = iff(IsNaN(psar[2]) == true and haclose[1] > haopen[1] , 1 ,
IFf(IsNaN(psar[2]) == true and haclose[1] <= haopen[1] , -1 ,
iff(sar_long_to_short , -1 ,
iff(sar_short_to_long , 1 , trend_dir[1]))));
trend_bars = iff(sar_long_to_short , -1 ,
iff(sar_short_to_long , 1 ,
iff(trend_dir == 1 , trend_bars[1] + 1 ,
iff(trend_dir == -1 , trend_bars[1] - 1 ,trend_bars[1]))));
// Calculate Acceleration Factor
af = iff(trend_change , start ,
iff((trend_dir == 1 and hahigh > ep[1]) or (trend_dir == -1 and low < ep[1]) , min(maximum, af[1] + increment),af[1]));
// Calculate extreme point
ep = iff(trend_change and trend_dir == 1 , hahigh ,
iff(trend_change and trend_dir == -1 , halow ,
iff(trend_dir == 1 , max(ep[1], hahigh) ,min(ep[1], halow))));
// Calculate PSAR
psar = iff(IsNaN(psar[2]) == true and haclose[1] > haopen[1] , halow[1] ,
iff(IsNan(psar[2]) == true and haclose[1] <= haopen[1] , hahigh[1] ,
iff(trend_change , ep[1] ,
IFf(trend_dir == 1 , psar[1] + af * (ep - psar[1]) , psar[1] - af * (psar[1] - ep) ))));
input : 상승전환색(Black), 하락전환색(Black) ;
plot1(psar,"pSar",iff(trend_dir == 1 ,상승전환색,하락전환색));
2023-01-18
612
글번호 165540
답변완료
수식문의 드립니다,
아래수식은
전략차트에서는 정상작동을 하는데요.
시뮬레이션 차트에서 적용를 하면
1개씩 거래가 안되고 수천개씩 거래가 되고 있습니다.
시물레이션 차트 정상 적용이 왜 안될까요?
var : BH(0);
var : SL(0);
var: t(0);
input : period(11),period2(11),매수간격(190),매도간격(190) ;
input: 이익변수(1700),손절변수(290);
if C > highest(H,period)[1] Then{
t=1;
if MarketPosition() == 0 and t==1 Then
buy("매수");
}
if C < Lowest(L,period2)[1] Then {
t=-1 ;
if MarketPosition() ==0 and t==-1 Then
Sell("매도");
}
if MarketPosition == 1 Then
{
buy("bb",AtStop,LatestEntryPrice(0)+PriceScale*매수간격);
if CurrentContracts > CurrentContracts[1] Then
BH = H;
if H > BH Then
BH = H;
if MaxEntries == 1 Then
ExitLong("매수1손절",AtStop,EntryPrice-PriceScale*손절변수);
if MaxEntries >= 2 Then
ExitLong("bx",AtStop,AvgEntryPrice);
ExitLong("매수이익x",AtLimit,AvgEntryPrice+PriceScale*이익변수 );
if MaxContracts >= 5 Then
exitlong("btr1",AtStop,BH-(BH-AvgEntryPrice)*0.5);
}
if MarketPosition == -1 Then
{
Sell("ss",AtStop,LatestEntryPrice(0)-PriceScale*매도간격);
if CurrentContracts > CurrentContracts[1] Then
SL = L;
if L < SL Then
SL = L;
if MaxEntries == 1 Then
ExitShort("매도1손절",AtStop,EntryPrice+PriceScale*손절변수 );
if MaxEntries >= 2 Then
ExitShort("sx",AtStop,AvgEntryPrice);
ExitShort("매도이익",AtLimit,AvgEntryPrice-PriceScale*이익변수);
if MaxContracts >= 5 Then
ExitShort("str1",AtStop,SL+(AvgEntryPrice-SL)*0.5);
}
2023-01-18
560
글번호 165533
답변완료
지표식부탁드립니다.
수고하십니다.
일봉수치와 분수치가 같은 임의의 var1 지표가 있습니다.
이지표의 일간 이평수치를 분차트에서도 같은 수치로 볼수있도록
부탁드립니다.
감사합니다.
input : 일단기(5), 일장기(20);
var2 = ema(var1,일단기);
var3 = ema(var1,일장기);
plot1(var2 ,"단기", IFf(var2 >var2 [1],Red,Blue));
plot2(var3 ,"장기", IFf(var3 >var3 [1],Red,Blue));
2023-01-18
637
글번호 165532
답변완료
수식 작성 부탁드립니다
위의 챠트에서(지표, 시스템) value2 가 평평한 구간
즉 지표의 변화가 없는 수평선일때 매수진입.
(value2 가 평평한 구간에서 현재 가격이 value2 맞닿은후(또는 상향돌파후)
2틱 상승시 매수 진입 하도록 원합니다.)
(value1이 평평한 구간에서 현재 가격이 value1 맞닿은후(또는 하향돌파후)
3틱 하락시 매수청산 하도록 원합니다.)
input : Period(5);
Vars : oTEMA(0);
oTEMA = ma(ma(ma(c, Period), Period), Period);
if oTEMA > oTEMA[1] Then
value1 = oTEMA;
if value1 > 0 and oTEMA > oTEMA[1] Then
value1 = oTEMA;
if oTEMA < oTEMA[1] Then
value2 = oTEMA;
if value2 > 0 and oTEMA < oTEMA[1] Then
value2 = oTEMA;
#1. 현재 가격이 value2 맞닿은후(상향돌파후) 2틱 상승시 매수.
if MarketPosition == 0 and L <= value2 Then
{
Buy("Buy",AtStop,value2+PriceScale*2);
}
if MarketPosition == 1 Then
{
if CrossDown(c,value1) Then
ExitLong();
}
2023-01-18
787
글번호 165527
답변완료
수식 부탁드립니다
수고하십니다
해외선물 마이크로나스닥 5분봉 거래기준이고요
아래수식은 나스닥과 다우를 비교하여 일정비율 이상이면
매도,매수하는 수식 입니다.
문제는 전일종가대비 상승율비교인데 나스닥 해외선물 거래가 한국시간
아침7시쯤 종료되어서 잘 안맞는것 같습니다
아래수식을 아침8시 시가 시간기준 상승율 대비로 변경하고 익일종가 전 05시 50분에
일괄청산하는 수식 부탁드립니다.
input : 익절(0),손절(0),k(0.1),k1(0.1);
var : R1(0,Data1),R2(0,Data2);
R1 = Data1((C-CloseD(1))/CloseD(1)*100);
R2 = Data2((C-CloseD(1))/CloseD(1)*100);
if R2 > 0 and R1>0 and R1 >= R2+k Then
Buy("b");
if R2 < 0 and R1<0 and R1<= R2-k1 Then
Sell("s");
SetStopProfittarget(익절,PointStop);
SetStopLoss(손절,PointStop);
감사합니다
2023-01-18
556
글번호 165526
답변완료
수식 문의 드립니다.
안녕하세요
아래 수식에 다음 사항을 추가하려고 합니다.
부탁 드립니다.
1. 손절이 연속 2번이 되면 2번째 손절 후 다음 3분봉 시가에 반대로 진입힌다.
매수 2번 연속 손절이면 매도로 진입/ 매도 2번 연속 손절이면 매수로 진입
2. 매수 후 20 포인트 이상 상승 후 하락하여 진입가에 오면 스위칭.
매도 후 20 포인트 이상 하락 후 상승하여 진입가에 오면 스위칭
3. 매매 개시 후 총 이익이 200 포인트가 되면 당일 거래 종료
매매 개시 후 총 손실이 150 포인트가 되면 당일 거래 종료
항상 감사합니다.
nput : 타주기분(30),P(5);
input : 익절틱수(40),손절틱수(20);
var : S1(0),D1(0),TM(0),TF(0),cnt(0);
var : sum1(0),mav1(0),sum2(0),mav2(0),sum3(0),mav3(0);
Array : CC[100](0);
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%타주기분;
if Bdate != Bdate[1] or
(Bdate == Bdate[1] and 타주기분 > 1 and TF < TF[1]) or
(Bdate == Bdate[1] and 타주기분 > 1 and TM >= TM[1]+타주기분) or
(Bdate == Bdate[1] and 타주기분 == 1 and TM > TM[1]) Then
{
for cnt = 1 to 99
{
CC[cnt] = CC[cnt-1][1];
}
}
CC[0] = C;
if CC[P+2] > 0 then
{
sum1 = 0;
sum2 = 0;
sum3 = 0;
for cnt = 0 to P-1
{
sum1 = sum1 + CC[cnt];
sum2 = sum2 + CC[cnt+1];
sum3 = sum3 + CC[cnt+2];
}
mav1 = sum1/P;
mav2 = sum2/P;
mav3 = sum3/P;
if MarketPosition >= 0 and mav1 < mav2 and mav2 > mav3 Then
Sell("s",AtMarket,Def,1);
if MarketPosition <= 0 and mav1 > mav2 and mav2 < mav3 Then
Buy("b",AtMarket,Def,1);
}
}
SetStopProfittarget(PriceScale*익절틱수,PointStop);
SetStopLoss(PriceScale*손절틱수,PointStop);
2023-01-18
558
글번호 165522
답변완료
지표 질문입니다
20ma를 상향 돌파하는 양봉 시가를 표시한다
20ma를 하향 붕괴하는 음봉 시가를 표시한다
감사합니다
2023-01-18
526
글번호 165521