커뮤니티
예스랭귀지 Q&A
[공지] 예스랭귀지 AI 어시스턴트, '예스나 AI' 출시 및 무료 체험 안내
안녕하세요, 예스스탁 입니다.복잡한 수식 공부 없이 여러분의 아이디어를 말하면 시스템 트레이딩 언어 예스랭귀지로 작성해주는 서비스예스나 AI(YesNa AI)가 출시되었습니다.지금 예스나 AI를 직접 경험해 보실 수 있도록 20크레딧(질문권 20회)를 무료로 증정해 드리고 있습니다.바로 여러분의 아이디어를 코드로 변환해보세요.--------------------------------------------------🚀 YesNa AI 핵심 기능- 지표식/전략식/종목검색식 생성: 자연어로 요청하면 예스랭귀지 문법에 맞는 코드를 작성합니다.- 종목검색식 변환 지원: K증권의 종목 검색식을 예스랭귀지로 변환 지원합니다.- 컴파일 검증: 작성된 코드가 실행 가능한지 컴파일러를 통해 문법 검증을 거쳐 결과물을 제공합니다.상세한 서비스 개요 및 활용 방법은 [서비스 소개 페이지]에서 확인하실 수 있습니다.▶ 서비스 소개 페이지: 바로가기서비스 사용 유의사항 및 결제 환불정책은 [이용약관]을 참고 부탁드립니다.▶ 서비스 이용약관: 바로가기💬 이용 문의사용 중 문의사항은 [프로그램 사용법 Q&A] 게시판에서 [예스나 AI] 카테고리를 설정 후 문의해 주시면 상세히 안내해 드리겠습니다.--------------------------------------------------앞으로도 AI를 활용한 다양한 트레이딩 기능들을 지속적으로 선보일 예정입니다.많은 관심과 기대 부탁드립니다.
2026-02-27
1359
글번호 230811
답변완료
수고하십니다. 키움수식을 파워종목 검색식 부탁드립니다
AA=(O+H+L+C)/4; //하이킨 종가
AA1=(C(1)+O(1))/2; //하이킨 시가
A=LinearRegressionValue(C,50,0);
A1=LinearRegressionValue(A,50,0);
eq= A-A1;
Z=A+eq; //ZLSMA 라인
SD=Lowest(L,22)+atr(22)*3; //샹들리에 저항
ap = (HIGH+LOW+CLOSE)/3;
esa = eavg(ap, 10);
d = eavg(abs(ap - esa), 10);
ci = (ap - esa) / (0.015 * d);
wt1 = eavg(ci, 21);
wt2 = avg(wt1,4);
WT=(wt1-wt2)*2; //웨이브트렌드 OSC
AA>AA1 && (CROSSUP(AA,SD) OR CROSSUP(AA,Z)) && WT>=0;
지표변수는 없습니다
2024-11-17
765
글번호 185347
답변완료
89674글 수정 좀 부탁 드림니다.
* 이래 수식에서 고가선은 고가선끼리 연결 하고 마지막은 H[1]에연결
저가선은 저가선끼리 연결 하고 마지막은 L[1]에연결
수식좀 부탁 드림니다.
## 아래 수식
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);
}
* 매번 고맙습니다 좋은 한주 되십시요.
2024-11-17
805
글번호 185345
답변완료
수고하십니다
추운데 수고많으십니다
아래식당일저고를
1 지정캔들100개나200개로 자유롭게설정식과
2 0.328돌파또는이탈시 캔들색강조부탁드립니다
첨부강조
항상 노고에 감사드립니다
input : 변수2(0.328);
var : AH(0),AL(0),B1(-1),B2(-1),B3(0);
var : 당일(0),P1(0), P2(0),p3(0),p4(0);
AH=dayhigh();
AL=daylow();
if AH == H Then
B1 = 0;
Else
{
if B1 >= 0 Then
B1 = B1+1;
}
if AL == L Then
B2 = 0;
Else
{
if B2 >= 0 Then
B2 = B2+1;
}
B3=AH-AL;
당일=iff(B1>B2,AH,AL);
P1=iff(B1>B2,AL+B3*변수2,AH-B3*변수2);
P2=iff(B1>B2,AL+B3*0.,AH-B3*0.50);
P3=iff(B1>B2,AL+B3*0.50,AH-B3*0.67);
P4=iff(B1>B2,AL+B3*0.67,AH-B3*0.77);
plot1(당일);
plot2(P1);
plot3(P2);
plot4(P3);
plot5(P4);
2024-11-17
670
글번호 185344
답변완료
문의 드립니다.
안녕하세요 아래지표를 예스로 변환부탁드립니다.
감사합니다.
=====================================
PRC_Volume SuperTrend AI
//PRC_Volume SuperTrend AI
//version = 0
//29.02.24
//Iván González @ www.prorealcode.com
//Sharing ProRealTime knowledge
///////////////////////////////////////////////////////////////////////
//inputs
// ~~ Input settings for K and N values
k = 3 // Neighbors 1 to 100
m = 10 // Data
n = max(k,m)
//// ~~ Input settings for prediction values
KNNPriceLen = 20 // Price Trend 2 - 500 step 10
KNNSTlen = 100 // Prediction Trend 2 - 500 step 10
aisignals = 1 // Boolean AI Trend Signals
//// ~~ Define SuperTrend parameters
len = 10 // Length
factor = 3.0 // step 0.1
maSrc = 0 // MaType
// ~~ Calculate the SuperTrend based on the user's choice
vwma = average[len,maSrc](close*volume)/average[len,maSrc](volume)
atr = averagetruerange[len](close)
upperband = vwma + factor*atr
lowerband = vwma - factor*atr
if barindex < len then
upperband = close
lowerband = close
direction = 1
else
//Redefine upperband
if upperband < upperband[1] or close[1] > upperband[1] then
upperband = upperband
else
upperband = upperband[1]
endif
//Redefine lowerband
if lowerband > lowerband[1] or close[1] < lowerband[1] then
lowerdband = lowerband
else
lowerband = lowerband[1]
endif
//Define upperband
prevSupertrend = mysuperTrend[1]
if prevSupertrend = upperband[1] then
if close > upperband then
direction = -1
else
direction = 1
endif
else
if close < lowerband then
direction = 1
else
directon = -1
endif
endif
endif
if direction = -1 then
mysupertrend = lowerband
else
mysupertrend = upperband
endif
// ~~ Collect data points and their corresponding labels
myprice = WeightedAverage[KNNPriceLen](close)
sT = WeightedAverage[kNNSTlen](mysupertrend)
for i=0 to n-1 do
$data[i]=mysupertrend[i]
if myprice[i] > sT[i] then
$labels[i] = 1
else
$labels[i] = 0
endif
next
// ~~ Classify the current data point
currentsuperTrend = mysuperTrend
//label = knn_weighted(data, labels, k, current_superTrend)
// Compute distances from the current point to all other points
n1 = lastset($data)
for i = 0 to n1-1 do
$distances[i] = abs(currentsuperTrend[i]-$data[i])
$indices[i] = i
next
// Sort distances and corresponding indices in ascending order
// Bubble sort method
for i=0 to n1-2 do
for j=0 to n1-i-2 do
if $distances[j]>$distances[j+1] then
tempDist = $distances[j]
$distances[j]=$distances[j+1]
$distances[j+1]=tempDist
tempindex = $indices[j]
$indices[j]=$indices[j+1]
$indices[j+1]=tempindex
endif
next
next
// Compute weighted sum of labels of the k nearest neighbors
weightedsum=0
totalweight=0
for i=0 to k-1 do
myindex = $indices[i]
labeli = $labels[i]
weighti = 1 / ($distances[i]+pow(10,-6) )
weightedsum = weighti*labeli+weightedsum
totalweight = weighti+totalweight
next
label = floor(weightedsum / totalweight,2)
// ~~ Plot
if label = 1 then
r=0
g=250
b=0
elsif label = 0 then
r=250
g=0
b=0
else
r=0
g=0
b=250
endif
middleprice = (open+close)/2
colorbetween(middleprice,mysupertrend,r,g,b,40)
// ~~ Ai Super Trend Signals
starttrendup = label = 1 and label[1]<>1 and aisignals
starttrenddn = label = 0 and label[1]<>0 and aisignals
TrendUp = direction = -1 and direction[1] = 1 and label = 1 and aisignals
TrendDn = direction = 1 and direction[1] = -1 and label = 0 and aisignals
if starttrendup or starttrenddn then
drawpoint(barindex,currentsuperTrend,2)coloured(r,g,b)
elsif Trendup then
drawtext("▲",barindex,currentsuperTrend)coloured(r,g,b)
elsif Trenddn then
drawtext("▼",barindex,currentsuperTrend)coloured(r,g,b)
endif
return currentsuperTrend as "SuperTrend" coloured(r,g,b)style(line,2)
2024-11-17
913
글번호 185343
답변완료
분봉에서 타종목(분봉)의 일봉 이동평균을 구하기
분봉에서 타종목(분봉,data2)의 일봉 이동평균을 구하는 방법을 알려주세요.
항상 감사드립니다.
2024-11-17
608
글번호 185342
답변완료
손익여부를 알고 싶습니다!!
안녕하세요 관리자님!!
날씨가 많이 추워졌습니다ㅜㅜ
아래 지표는 관리자님이 만들어 주신 지표로 실거래시 많이 사용하고 있습니다
다름이 아니오라
아래 지표를 차트에 구현하면 첨부한 그림과 같이
상,하단에 선이 각각 3개씩(plot15~plot20) 총6개의 선이 구현됩니다
각각의 선을 상향돌파/하향돌파시 역거래를 하려고 하는데요
거래에 대한 실익을 먼저 확인하려고 지표를 문의드립니다!!
질문이 부족하더라도 양해하시고 적절한 지표 부탁드립니다
#검색할조건#
거래시간: 08~20시
각각의 선을 돌파시: 일정랏으로 역방향 진입
수익목표: 50핍
손절제한은 없음
익절이 안되고 손실시 익일 아침에 장시작후 바로 청산조건
-아래-
input : nday(2);
var : OO(0),HH(0),LL(0),cnt(0);
OO = DayOpen(nday);
HH = DayHigh(1);
LL = DayLow(1);
for cnt = 1 to nday
{
if DayHigh(cnt) > hh Then
hh = DayHigh(cnt);
if DayLow(cnt) < ll Then
ll = DayLow(cnt);
}
if OO > 0 then
{
var1 = C/OO*100-100;
plot1(var1,"시가");
}
if HH > 0 then
{
var2 = (C/HH*100-100);
plot2(var2,"고가");
}
if LL > 0 then
{
var3 = C/LL*100-100;
plot3(var3,"저가");
plot4(0,"0선");
plot5(-var2,"-고가");
plot6(-var3,"-저가");
plot7(var3-var2,"저가-고가");
plot8(var2-var3,"고가-저가");
plot9(0.5,"0.5선");
plot10(-0.5,"-0.5선");
plot11(1.0,"1.0선");
plot12(-1.0,"-1.0선");
plot13(2.0,"2.0선");
plot14(-2.0,"-2.0선");
plot15(HH*1.005,"저0.5선");
plot16(HH*1.01,"저1.0선");
plot17(HH*1.02,"저2선");
plot18(LL*0.995,"고-0.5선");
plot19(LL*0.99,"고-1.0선");
plot20(LL*0.98,"고-2선");
}
2024-11-17
618
글번호 185341
답변완료
손절 기응 추가
1 아래 시스템 수식에서 손절값을 추가하고 싶습니다(물론 손절값 전에 반대 신호가 나오면 반대신호로 손절하고 진입합니다)
2. 손절값은 매도 경우 과거봉(일단 12개 봉으로 가정, 변수로 변경가능토록 설정)12개 값의 최대값에서 한틱위에(설정으로 값을 조정할 수 있게)로 매수 경우는 반대입니다.
아래는 시스템 식입니다.
Input: Period(42), D(2), period2(0.17);
Input : shortPeriod(12), longPeriod(26);
input : n1(3);//강조표시 없는 구간 진입횟수
input : n2(3);//동시조건 충족 후 진입횟수
Var : BBTop(0), BBMid(0), BBBot(0),Bwidth(0), BWidth2(0), BWidth3(0);
Var : value(0),cnt(0),T(0);
BBTop = BollBandUp(Period,D);
BBMid = ma(C,Period);
BBBot = BollBandDown(Period,D);
BWidth = ((BBTop - BBBot)/ BBMid)*100;
value = MACD(shortPeriod, longPeriod);
#강조조건 만족하면 true 아니면 False
if BWidth<period2 Then
Condition1 = true;
Else
Condition1 = False;
#강조조건 불만족 구간 시작
#T는 1
#cnt는 0으로 초기화
if (Condition1 == False and Condition1 != Condition1[1]) Then
{
T = 1;
cnt = 0;
}
#강조조건 만족 구간 시작
#T는 2
#cnt는 0으로 초기화
if (Condition1 == true and Condition1 != Condition1[1]) Then
{
T = 2;
cnt = 0;
}
If CrossUP(value, 0) Then
{
#횟수카운트
cnt = cnt+1;
#T가 1인구간에서 n1횟수까지만 신호발생, n1이 0이면 신호발생 없음
#T가 2인구간에서 n2횟수까지만 신호발생, n2가 0이면 신호발생 없음
if (n1 > 0 and T == 1 and cnt < n1) or
(n2 > 0 and T == 2 and cnt < n2) Then
Buy("b");
}
If CrossDown(value, 0) Then
{
#횟수카운트
cnt = cnt+1;
#T가 1인구간에서 n1횟수까지만 신호발생, n1이 0이면 신호발생 없음
#T가 2인구간에서 n2횟수까지만 신호발생, n2가 0이면 신호발생 없음
if (n1 > 0 and T == 1 and cnt < n1) or
(n2 > 0 and T == 2 and cnt < n2) Then
Sell("s");
}
2024-11-17
626
글번호 185340
답변완료
문의드립니다
Input:전환비율(5),Per(5);
Var:j(0),jj(0),HH(0),LL(0),hiBar(0),loBar(0),최종꼭지점(""),처리구분(""),TL1(0),Text1(0),ADXV1(0);
Array:고[10,4](0),저[10,4](0);
var : TL2(0),TL3(0);
HH=H;
LL=L;
If Index==0 Then
{
고[1,1]=HH;
고[1,2]=0;
고[1,3]=sDate;
고[1,4]=sTime;
저[1,1]=LL;
저[1,2]=0;
저[1,3]=sDate;
저[1,4]=sTime;
}
If Index>0 Then
{
hiBar=hiBar+1;
loBar=loBar+1;
}
If HH[hiBar]<HH Then hiBar=0;
If LL[loBar]>LL Then loBar=0;
Condition1=저[1,1]*(1+(전환비율/100))<HH and hiBar==0;
Condition2=고[1,1]*(1-(전환비율/100))>LL and loBar==0;
처리구분="";
If Condition1 and Condition2 Then//고점과저점조건동시만족
{
If 최종꼭지점=="저점" Then
{
If 저[1,1]>LL Then 처리구분="저점처리";
Else 처리구분="고점처리";
}
Else If 최종꼭지점=="고점" Then
{
If 고[1,1]<HH Then 처리구분="고점처리";
Else 처리구분="저점처리";
}
}
Else If Condition1 Then 처리구분="고점처리";
Else If Condition2 Then 처리구분="저점처리";
If 처리구분=="고점처리" Then
{
If 최종꼭지점=="저점" Then
{
For j=10 DownTo 2
{
For jj=1 To 4
{
고[j,jj]=고[j-1,jj];
}
}
고[1,1]=HH[hiBar];
고[1,2]=Index-hiBar;
고[1,3]=sDate[hiBar];
고[1,4]=sTime[hiBar];
hiBar=-1;
loBar=-1;
TL1=TL_New(저[1,3],저[1,4],저[1,1],고[1,3],고[1,4],고[1,1]);
TL_SetSize(TL1,1);
TL_SetColor(TL1,RED);
TL_Delete(TL2);
TL2=TL_New(고[1,3],고[1,4],고[1,1]*(1+per/100),NextBarSdate,NextBarStime,고[1,1]*(1+per/100));
TL_SetExtRight(TL2,true);
TL_SetColor(TL2,Red);
}
Else If 고[1,1]<HH[hiBar] Then//1번고점보다높은고가출현
{
고[1,1]=HH[hiBar];
고[1,2]=Index-hiBar;
고[1,3]=sDate[hiBar];
고[1,4]=sTime[hiBar];
hiBar=-1;
loBar=-1;
TL_SetEnd(TL1,고[1,3],고[1,4],고[1,1]);
TL_SetBegin(TL2,고[1,3],고[1,4],고[1,1]*(1+per/100));
TL_SetEnd(TL2,NextBarSdate,NextBarStime,고[1,1]*(1+per/100));
}
최종꼭지점="고점";
}
If 처리구분=="저점처리" Then
{
If 최종꼭지점=="고점" Then
{
For j=10 DownTo 2
{
For jj=1 To 4
{
저[j,jj]=저[j-1,jj];
}
}
저[1,1]=LL[loBar];
저[1,2]=Index-loBar;
저[1,3]=sDate[loBar];
저[1,4]=sTime[loBar];
hiBar=-1;
loBar=-1;
TL1=TL_New(고[1,3],고[1,4],고[1,1],저[1,3],저[1,4],저[1,1]);
TL_SetSize(TL1,1);
TL_SetColor(TL1,BLUE);
TL_Delete(TL3);
TL3=TL_New(저[1,3],저[1,4],저[1,1]*(1-per/100),NextBarSdate,NextBarStime,저[1,1]*(1-per/100));
TL_SetExtRight(TL3,true);
TL_SetColor(TL3,Blue);
}
Else If 저[1,1]>LL[loBar] Then
{
저[1,1]=LL[loBar];
저[1,2]=Index-loBar;
저[1,3]=sDate[loBar];
저[1,4]=sTime[loBar];
hiBar=-1;
loBar=-1;
TL_SetEnd(TL1,저[1,3],저[1,4],저[1,1]);
TL_SetBegin(TL3,저[1,3],저[1,4],저[1,1]*(1-per/100));
TL_SetEnd(TL3,NextBarSdate,NextBarStime,저[1,1]*(1-per/100));
}
최종꼭지점="저점";
}
-----------
위식을 활용한 시스템식 부탁드립니다 (코스피선물 거래)
매도신호: 최종고점이 나온 봉이 음봉으로 완성되는경우에만 음봉종가에 매도신호 발생
매도청산: 매도신호 가격에서 2p(포인트) 손실 발생하면 매도청산(손절)
매수신호: 최종저점이 나온 봉이 양봉으로 완성되는경우에만 양봉종가에 매수신호 발생
매수청산: 매수신호 가격에서 2p(포인트) 손실 발생하면 매수청산(손절)
감사합니다
2024-11-17
638
글번호 185339
답변완료
문의 드립니다.
RSI 5 기준선 30을 아래서 위로 돌파 시 매수 진입
손절은 RSI 5 기준선 30을 위에서 아래로 돌파 시 매도 청산
그리고 코인에서 사용할 수 있게 금액을 입력할 수 있도록 부탁드립니다.
같은 방식으로 선물에서 사용할 수 있도록
수량을 입력할 수 있도록 별도로 부탁드립니다.
2024-11-17
667
글번호 185338