커뮤니티
예스랭귀지 Q&A
답변완료
[공지] 예스랭귀지 AI 어시스턴트, '예스나 AI' 출시 및 무료 체험 안내
안녕하세요, 예스스탁 입니다.복잡한 수식 공부 없이 여러분의 아이디어를 말하면 시스템 트레이딩 언어 예스랭귀지로 작성해주는 서비스예스나 AI(YesNa AI)가 출시되었습니다.지금 예스나 AI를 직접 경험해 보실 수 있도록 20크레딧(질문권 20회)를 무료로 증정해 드리고 있습니다.바로 여러분의 아이디어를 코드로 변환해보세요.--------------------------------------------------🚀 YesNa AI 핵심 기능- 지표식/전략식/종목검색식 생성: 자연어로 요청하면 예스랭귀지 문법에 맞는 코드를 작성합니다.- 종목검색식 변환 지원: K증권의 종목 검색식을 예스랭귀지로 변환 지원합니다.- 컴파일 검증: 작성된 코드가 실행 가능한지 컴파일러를 통해 문법 검증을 거쳐 결과물을 제공합니다.상세한 서비스 개요 및 활용 방법은 [서비스 소개 페이지]에서 확인하실 수 있습니다.▶ 서비스 소개 페이지: 바로가기서비스 사용 유의사항 및 결제 환불정책은 [이용약관]을 참고 부탁드립니다.▶ 서비스 이용약관: 바로가기💬 이용 문의사용 중 문의사항은 [프로그램 사용법 Q&A] 게시판에서 [예스나 AI] 카테고리를 설정 후 문의해 주시면 상세히 안내해 드리겠습니다.--------------------------------------------------앞으로도 AI를 활용한 다양한 트레이딩 기능들을 지속적으로 선보일 예정입니다.많은 관심과 기대 부탁드립니다.
2026-02-27
6135
글번호 230811
답변완료
검색식 부탁드립니다.
A=H-L;
B=Max(C,O)-L;
조건=A/B>배수 && H/C(1)>(1+상승률/100);
Valuewhen(1, 조건, H);
배수 : 2
상승률 : 10
위의 조건을 돌파하는 종목 검색
A=H-L;
B=Max(C,O)-L;
조건=A/B>배수 && H/C(1)>(1+상승률/100);
Valuewhen(1, 조건, Max(C,O));
배수 : 2
상승률 : 10
위조건위에서 70% 이상의 종가 종목 검색
부탁드립니다 너무너무 감사드립니다.
2022-02-14
1109
글번호 156245
답변완료
종목검색
일목균형표(9,26,52) 후행스팬이 볼린져밴드(10,2)상한선 골든크로스종목검색식을
만들고 싶어요ㅡ비슷한검색식 부탁드려요
2022-02-14
1043
글번호 156230
답변완료
문의드립니다
안녕하세요?
아래수식에서 현재 매수매도 신호가발생하는 다음봉에서 신호가발생하게되면 합니다
감사합니다
var : sindex1(0), sindex2(0), Lindex1(0), Lindex2(0);
value1 = stochasticsD(12,5,5);
Condition1 = value1 > value1[1] and value1[1] <= value1[2];
Condition2 = L > L[1] and L[1] <= L[2];
sindex1 = MRO(Condition1,15,1);
sindex2 = MRO(Condition1,15,2);
Lindex1 = MRO(Condition2,15,1);
Lindex2 = MRO(Condition2,15,2);
if value1[sindex1+1] > value1[sindex2+1] and
L[Lindex1+1] < L[Lindex2+1] and
Condition1 and
lowest(L,5) == lowest(L,15)
then
buy();
////
var : sindex3(0), sindex4(0), Hindex1(0), Hindex2(0);
Condition11 = value1 < value1[1] and value1[1] >= value1[2];
Condition12 = H < H[1] and H[1] >= H[2];
sindex3 = MRO(Condition11,15,1);
sindex4 = MRO(Condition11,15,2);
Hindex1 = MRO(Condition12,15,1);
Hindex2 = MRO(Condition12,15,2);
if value1[sindex3+1] < value1[sindex4+1] and
H[Hindex1+1] > H[Hindex2+1] and
Condition11 and
Highest(H,5) == Highest(H,15)
then
sell();
2022-02-14
1114
글번호 156225
답변완료
수식추가 부탁드립니다.
안녕하세요?
현재 진입부분에서,
전음봉 종가보다 진입음봉 종가가 작을때 매도
전양봉 종가보다 진입양봉 종가가 클떄 매수
이렇게 되어있는데,
전봉 종가와 진입봉 종가의 차이를 외부변수를 넣고싶습니다.
부탁드립니다.
감사합니다.
input : 전음봉(2),전양봉(2),진입음봉(5),진입양봉(5);
input : 익절틱수(50),손절틱수(50),진입횟수(3);
var : entry(0);
if Bdate != Bdate[1] Then
entry = 0;
if (MarketPosition != 0 and MarketPosition != MarketPosition[1]) or
(MarketPosition == MarketPosition[1] and TotalTrades > TotalTrades[1]) Then
entry = entry+1;
if MarketPosition == 0 and
entry < 진입횟수 and
C[1] == O[1]-전음봉*PriceScale and
C == O-진입음봉*PriceScale and
C < C[1] Then
Sell();
if MarketPosition == 0 and
entry < 진입횟수 and
C[1] == O[1]+전양봉*PriceScale and
C == O+진입양봉*PriceScale and
C > C[1] Then
Buy();
SetStopProfittarget(PriceScale*익절틱수,PointStop);
SetStopLoss(PriceScale*손절틱수,PointStop);
2022-02-14
1174
글번호 156224
답변완료
75815 수식 관련 질문 드립니다
안녕하세요
이전에 120틱봉 차트를 사용할 때
직전 600틱봉 3개가 양봉이고, 현재봉의 현재가가 HB 상향돌파시 매수
직전 600틱봉 3개가 음봉이고, 현재봉의 현재가가 LB 하향돌파시 매도
이걸 어떻게 만들지를 문의해 만들어주신 수식이 있는데
어떻게 작동하는지를 보다 이해가 안되 질문을 드리게 되었습니다
당시 답변주신 수식은 아래와 같고 이해 안되는 부분을 노트해 두었습니다
input : nbars(5),N(3);
input : HB(14620), LB(14530) ;
var : e60(0);
var : D1(0),idx(0),TF(0),Po(0),Ne(0),cnt(0);
Array : OO[20](0),CC[20](0);
e60 = Ema(C,60);
if Bdate != Bdate[1] Then
{
D1 = sdate;
idx = 0;
}
Else
idx = idx+1;
=> 오늘 00시부터 지금까지의 120틱봉 개수 카운트
=> idx = 봉 개수
if D1 > 0 then
{
TF = idx%nbars;
=> 봉을 5개 단위로 자름 1,2,3,4,5/1,2,3,4,5
if Bdate != Bdate[1] or (Bdate == Bdate[1] and TF < TF[1]) Then
=> 120틱봉 5개 묶음의 첫번째 봉인 경우
{
OO[0] = O;
for cnt = 1 to 19
{
OO[cnt] = OO[cnt-1][1];
CC[cnt] = CC[cnt-1][1];
}
}
CC[0] = C;
=> 조건 이후 실행부 전반이 무엇을 의미하는 것인지가 전체적으로 잘 모르겠고
=> 특히 OO[cnt] = OO[cnt-1][1]; 이걸 잘 모르겠습니다. cnt가 1이면 OO[1] = OO[0][1];인데 OO[0][1]이 의미하는게 뭔가요?
if OO[n] > 0 Then
{
Po = 0;
Ne = 0;
For cnt = 1 to n
{
if CC[cnt] > OO[cnt] Then
Po = po +1;
if CC[cnt] < OO[cnt] Then
Ne = Ne +1;
}
if Po == n then
Buy("L",AtStop,HB,2) ;
if Ne == n then
Sell("S",AtStop,LB,2) ;
}
}
if marketposition > 0 Then
{
if e60 < HB Then ExitLong("exitL1",AtStop,HB-5);
if e60 >= HB and CrossDown(close, e60) Then ExitLong("exitL2") ;
}
if marketposition < 0 Then
{
if e60 > LB Then ExitShort("exitS1",AtStop,HB+5);
if e60 <= LB and CrossUp(close, e60) Then ExitShort("exitS2");
}
답변부탁드리겠습니다
감사합니다!
2022-02-14
1168
글번호 156223
답변완료
시스템 이상 검토의뢰
수고 하십니다 !
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);
var:s(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);
var : T(0);
var3 = ma(C,Period3);
var4 = ma(C,Period4);
var5 = ma(C,Period5);
var6 = ma(C,Period6);
var7 = ma(C,Period7);
var8 = ma(C,Period8);
var9 = ma(C,Period9);
var10 = ma(C,Period10);
input:n4(0);
var1 = ma(C,30);
Var2 = ma(C,60);
if CrossUp(var1,Var2) and sma3 < sma4-PriceScale*1 and sma3 < sma6-PriceScale*6 Then
{
T = 1;
S = Var2;
if T[1] == -2 Then
Buy();
}
if CrossDown(var1,Var2) and sma3 > sma4+PriceScale*1 and sma3 > sma6 +PriceScale*20 Then
{
T = -1;
S = Var2;
if T[1] == 2 Then
Sell();
}
if T == 1 and C >= S+PriceScale*n4 Then
T = 2;
if T == -1 and C <= S-PriceScale*n4 Then
T = -2;
SetStopLoss(PriceScale*50,PointStop);
틱의 가격을 시스템에서 적용이 되지를 않아서 틱 가격을 여러숫자로
적용을 해봐도 안되네요!
그래서 0 으로 해봐도 안되어 다시 의뢰 드립니다.
정히 안되면 청산후 청산가격보다 10 틱 이상 상하로 가격차이가 나고 매매 신호가
적용이 될때 체결하는 것 으로 수식작성을 다시한번 부탁 드립니다 .
예를들면 이평선 3선과 4선이 크로즈업 하여 매수를 하고 10틱이 올라 수익이 났을때
청산을 하고 청산가격보다 상하로 10틱이상 차이가 나고 3선과 4선이 크로즈업을 할때는
매수를 3선과 4선이 크로즈다운 할때는 매도를 하고 10틱이상 수익이 날때 청산을 하는
수식으로 부탁 드립니다.
수고 하세요 !
2022-02-14
1115
글번호 156222
답변완료
늘 고맙습니다
늘 고맙습니다
data2 를 사용하는데
현재가 >= 오늘 시가 <== 이것을 표현하고 싶습니다
closed(0) >= opend(0) 인가요
data2(closed(0)) >= data2(opend(0)) 인가요?
늘 고맙습니다 수고하세요
2022-02-14
982
글번호 156221
답변완료
수식
하기 수익에 대한 수정 부탁드립니다.
plot1,plot2 수평선이 당일 발생분은 당일 종가까지만 생성되고 다음날에는 연장 되지 않도록 부탁드립니다. (이전일에 발생한것은 삭제가 아닙니다)
감사합니다.
input : af(0.02), AFMAX(0.2);
var : T(0),HH(0),LL(0),HD(0),HT(0),LD(0),LT(0),TL1(0),TL2(0),cnt(0),count(0);
var : HH1(0),LL1(0),HD1(0),HT1(0),LD1(0),LT1(0),DarkGray(0);
var : ni(0),nP(0),nN(0),tx1(0),tx2(0),hi(0),li(0);
Var : Direction(0), SAR_Value(Close), AF_Value(.02), HighValue(High), LowValue(Low), EP(0),CSarv(0);
if Index == 0 or Bdate != Bdate[1] Then
{
Direction = 0;
SAR_Value = C;
AF_Value = 0.02;
HighValue = High;
LowValue = Low;
EP = 0;
}
if EP != 0 Then
{
if Direction == 1 then
{
EP = HighValue;
SAR_Value = SAR_Value + AF_Value * (EP - SAR_Value);
if High > HighValue then
{
HighValue = High;
AF_Value = AF_Value + AF;
if AF_Value >= AFMAX then AF_Value = AFMAX;
}
if Close < SAR_Value then
{
Direction = -1;
SAR_Value = EP;
AF_Value = 0;
EP = 0;
LowValue = low;
}
}
else
{
EP = LowValue;
SAR_Value = SAR_Value + AF_Value * (EP - SAR_Value);
if Low < LowValue then
{
LowValue = Low;
AF_Value = AF_Value + Af;
if AF_Value >= AFMAX then AF_Value = AFMAX;
}
if Close > SAR_Value then
{
Direction = 1;
SAR_Value = EP;
AF_Value = 0;
EP = 0;
HighValue = High;
}
}
CSarv = SAR_Value;
}
else
{
if SAR_Value != 0 && EP == 0 then
{
if Direction == 1 then
{
EP = HighValue;
AF_Value = AF;
SAR_Value = SAR_Value + AF_Value * (EP - SAR_Value);
if High > HighValue then
{
HighValue = High;
AF_Value = AF_Value + AF;
if AF_Value >= AFMAX then AF_Value = AFMAX;
}
}
else
{
EP = LowValue;
AF_Value = Af;
SAR_Value = SAR_Value + AF_Value * (EP - SAR_Value);
if Low < LowValue then
{
LowValue = Low;
AF_Value = AF_Value + AF;
if AF_Value >= AFMAX then AF_Value = AFMAX;
}
}
CSarv = SAR_Value;
}
else
{
if Direction == 0 then
{
if Close > Close[1] then Direction = 1;
else
if Close < Close[1] then Direction = -1;
}
else
{
if Direction == 1 then
{
if Close < Close[1] then
{
Direction = -1;
SAR_Value = HighValue;
CSarv = SAR_Value;
}
}
if Direction == -1 then
{
if Close > Close[1] then
{
Direction = 1;
SAR_Value = LowValue;
CSarv = SAR_Value;
}
}
}
LowValue = min(Low, LowValue);
HighValue = max(High, HighValue);
}
}
//Plot10(CSarv);
if (crossup(C,CSarv[1]) or crossup(C,CSarv[2]) or crossup(C,CSarv[3])) and (C >= CSarv or C >= CSarv[1]) Then
value1 = CSarv;
if (CrossDown(C,CSarv[1]) or CrossDown(C,CSarv[2]) or CrossDown(C,CSarv[3])) and (C <= CSarv or C <= CSarv[1]) Then
value2 = CSarv;
plot1(value1,"양수평");
plot2(value2,"음수평");
2022-02-13
1329
글번호 156220
답변완료
수식 수정 요청
안녕하세요.
true 라인이 먼저 생성 되었다가 고,저 라인이 만들어지면 바로 없어 지는데
반대 true라인이 생성 될때 까지 유지 될수 있도록 수식 수정 부탁 드립니다.
고,저 라인은 우측 끝까지 그려지지 않고 확정 캔들 까지만 그려지기 때문에
사용에 불편함이 있어서 입니다.
Input:length(12);
Var:j(0),lastHiVal(0),lastLoVal(0),sBar(0),eBar(0),TL1(0),TL2(0),TL3(0),
Text1(0),처리구분(""),T(0),TL21(0),TL31(0);
Array:고점[10,2](0),저점[10,2](0); //가격,위치
처리구분 = "";
If Highest(H,length) == H and lastHiVal <> H and
Lowest(L,length) == L and lastLoVal <> L Then
{
If 저점[1,1] > L Then 처리구분 = "저점처리";
If 고점[1,1] < H Then 처리구분 = "고점처리";
}
Else If Highest(H,length) == H and lastHiVal <> H Then
처리구분 = "고점처리";
Else If Lowest(L,length) == L and lastLoVal <> L Then
처리구분 = "저점처리";
If 처리구분 == "고점처리" Then
{
T = 1;
lastHiVal = H;
If 고점[1,2] < 저점[1,2] Then
{
For j = 10 DownTo 2
{
고점[j,1] = 고점[j-1,1];
고점[j,2] = 고점[j-1,2];
}
}
If 고점[1,2] < 저점[1,2] or 고점[1,1] < H Then
{
고점[1,1] = H;
고점[1,2] = Index;
sBar = Index - 저점[1,2];
eBar = 0;
If TL_GetBeginDate(TL1) == sDate[sBar] and
TL_GetBeginTime(TL1) == sTime[sBar] Then
{
TL_Delete(TL1);
TL_Delete(TL2);
TL_Delete(TL21);
Text_Delete(Text1);
}
TL1 = TL_New(sDate[sBar],sTime[sBar],저점[1,1],sDate[eBar],sTime[eBar],고점[1,1]);
TL2 = TL_New(sDate[sBar],sTime[sBar],저점[1,1],sDate[eBar],sTime[eBar],저점[1,1]);
// TL21 = TL_New(sDate[sBar],sTime[sBar],저점[1,1]+PriceScale*10,sDate[eBar],sTime[eBar],저점[1,1]+PriceScale*10);
Text1 = Text_New(sDate[eBar],sTime[eBar],고점[1,1], NumToStr(고점[1,1],2));
Text_SetStyle(Text1, 2, 1);
TL_SetSize(TL2,3);
TL_SetColor(TL2,REd); //저점
TL_SetSize(TL21,1);
TL_SetColor(TL21,YELLOw); //저점
}
}
If 처리구분 == "저점처리" Then
{
T = -1;
lastLoVal = L;
If 저점[1,2] < 고점[1,2] then
{
For j = 10 DownTo 2
{
저점[j,1] = 저점[j-1,1];
저점[j,2] = 저점[j-1,2];
}
}
If 저점[1,2] < 고점[1,2] or 저점[1,1] > L then
{
저점[1,1] = L;
저점[1,2] = Index;
sBar = Index - 고점[1,2];
eBar = 0;
If TL_GetBeginDate(TL1) == sDate[sBar] and
TL_GetBeginTime(TL1) == sTime[sBar] Then
{
TL_Delete(TL1);
TL_Delete(TL2);
TL_Delete(TL21);
Text_Delete(Text1);
}
TL1 = TL_New(sDate[sBar],sTime[sBar],고점[1,1],sDate[eBar],sTime[eBar],저점[1,1]);
TL2 = TL_New(sDate[sBar],sTime[sBar],고점[1,1],sDate[eBar],sTime[eBar],고점[1,1]);
// TL21 = TL_New(sDate[sBar],sTime[sBar],고점[1,1]-PriceScale*10,sDate[eBar],sTime[eBar],고점[1,1]-PriceScale*10);
Text1 = Text_New(sDate[eBar],sTime[eBar],저점[1,1],NumToStr(저점[1,1],1));
Text_SetStyle(Text1, 2, 10);
TL_SetSize(TL2,3);
TL_SetColor(TL2,BLUe);
TL_SetSize(TL21,1);
TL_SetColor(TL21,YELLOw);
}
}
TL_SetSize(TL1,1);
TL_SetColor(TL1,GRAy);
TL_Delete(TL3);
TL_Delete(TL31);
if T == 1 then
{
TL3 = TL_New(sDate[index-고점[1,2]],sTime[index-고점[1,2]],고점[1,1],sDate,sTime,고점[1,1]);
// TL31 = TL_New(sDate[index-고점[1,2]],sTime[index-고점[1,2]],고점[1,1]-PriceScale*10,sDate,sTime,고점[1,1]-PriceScale*10);
TL_SetColor(TL3,BLUe);
TL_SetSize(TL3,3);
TL_SetExtRight(TL3,true);
TL_SetColor(TL31,YELLOw);
TL_SetSize(TL31,1);
TL_SetExtRight(TL31,true);
}
if T == -1 then
{
TL3 = TL_New(sDate[index-저점[1,2]],sTime[index-저점[1,2]],저점[1,1],sDate,sTime,저점[1,1]);
// TL31 = TL_New(sDate[index-저점[1,2]],sTime[index-저점[1,2]],저점[1,1]+PriceScale*10,sDate,sTime,저점[1,1]+PriceScale*10);
TL_SetColor(TL3,REd); //저점
TL_SetSize(TL3,3);
TL_SetExtRight(TL3,true);
TL_SetColor(TL31,YELLOw); //저점
TL_SetSize(TL31,1);
TL_SetExtRight(TL31,true);
}
감사합니다.
2022-02-13
1100
글번호 156219