커뮤니티
예스랭귀지 Q&A
답변완료
[공지] 예스랭귀지 AI 어시스턴트, '예스나 AI' 출시 및 무료 체험 안내
안녕하세요, 예스스탁 입니다.복잡한 수식 공부 없이 여러분의 아이디어를 말하면 시스템 트레이딩 언어 예스랭귀지로 작성해주는 서비스예스나 AI(YesNa AI)가 출시되었습니다.지금 예스나 AI를 직접 경험해 보실 수 있도록 20크레딧(질문권 20회)를 무료로 증정해 드리고 있습니다.바로 여러분의 아이디어를 코드로 변환해보세요.--------------------------------------------------🚀 YesNa AI 핵심 기능- 지표식/전략식/종목검색식 생성: 자연어로 요청하면 예스랭귀지 문법에 맞는 코드를 작성합니다.- 종목검색식 변환 지원: K증권의 종목 검색식을 예스랭귀지로 변환 지원합니다.- 컴파일 검증: 작성된 코드가 실행 가능한지 컴파일러를 통해 문법 검증을 거쳐 결과물을 제공합니다.상세한 서비스 개요 및 활용 방법은 [서비스 소개 페이지]에서 확인하실 수 있습니다.▶ 서비스 소개 페이지: 바로가기서비스 사용 유의사항 및 결제 환불정책은 [이용약관]을 참고 부탁드립니다.▶ 서비스 이용약관: 바로가기💬 이용 문의사용 중 문의사항은 [프로그램 사용법 Q&A] 게시판에서 [예스나 AI] 카테고리를 설정 후 문의해 주시면 상세히 안내해 드리겠습니다.--------------------------------------------------앞으로도 AI를 활용한 다양한 트레이딩 기능들을 지속적으로 선보일 예정입니다.많은 관심과 기대 부탁드립니다.
2026-02-27
3643
글번호 230811
답변완료
시스템
안녕하세요
아래시스템식 해석 부탁드립니다 감사합니다
input : Period(50),Multiplier(3);
var : dAtr(0),UpperLevel(0),LowerLevel(0),Direction(0);
dAtr=ATR(Period);
UpperLevel=(High+Low)/2+Multiplier*dAtr;
LowerLevel=(High+Low)/2-Multiplier*dAtr;
Direction = Direction[1];
if close > UpperLevel[1] then Direction = 1;
if close < LowerLevel[1] then Direction = -1;
if Direction > 0 then
{
LowerLevel = Max(LowerLevel,LowerLevel[1]);
#plot1(LowerLevel,"SuperTrend",rgb(65,105,225));
}
else
{
UpperLevel = Min(UpperLevel,UpperLevel[1]);
#plot1(UpperLevel,"SuperTrend",rgb(255,99,71));
}
# 매수/매도청산
if Direction > 0 then
{
Buy("매수");
}
2019-07-26
170
글번호 130659
답변완료
시스템 수식 질문입니다
매도신호가 발생하면 매도신호가 발생한 음봉 시가에 매도하고, 매수신호가 발생하면 매수신호가 발생한 양봉 시가에 매수하는시스템 수식을 알고 싶습니다
2019-07-26
148
글번호 130658
답변완료
부탁 드립니다.
WAVG를 어떻게 변환하는지요?
미리 감사 드립니다.
2019-07-26
162
글번호 130655
답변완료
기준라인 수식과 피라미딩
별첨파일은 아래수식을 시뮬레이션한 결과들 입니다.
피라미딩시 20개까지 진입하는 수식이고
Array : EP[30](0); 이고
피라미딩설정창에서 다른진입신호만허용입니다.
질문1) 첨부파일 첫번째
2019년 1월 28일 첫번째 진입의 손절(미니선물 50틱 ,1.00)이 적용되지 않고 end of day로 청산되었습니다.
2017년 3월 24일 첫번째 진입 손절은 정상처리됨.
질문2) 첨부파일 두번째
EP[1], EP[5], EP[30]순으로 방배열을 조정해 보았음
3가지 경우 모두 2019.4.19 MAX16개 진입이 발생했습니다.(년간 진입횟수와 수익은 서로 다름)
방배열 숫자가 작으면 피라미딩MAX도 작아지는 것 아닌지요
질문3)
피라미딩설정창에서 다른진입신호만허용과 모든진입신호허용이 있는데
buy만 진입하는 수식에서 위 구분은 어떤 차이를 발생시키나요.
항상 고맙습니다.
***********************************************************************************
input : 기준(283),상승(0.10);
input : 손절1(50),익절1(300),TR1(150);
input : 손절2(50),익절2(300),TR2(150);
input : 손절3(50),익절3(300),TR3(150);
input : 손절4(50),익절4(300),TR4(150);
input : 손절5(50),익절5(300),TR5(150);
input : 손절6(50),익절6(300),TR6(150);
input : 손절7(50),익절7(300),TR7(150);
input : 손절8(50),익절8(300),TR8(150);
input : 손절9(50),익절9(300),TR9(150);
input : 손절10(50),익절10(300),TR10(150);
input : 손절11(50),익절11(300),TR11(150);
input : 손절12(50),익절12(300),TR12(150);
input : 손절13(50),익절13(300),TR13(150);
input : 손절14(50),익절14(300),TR14(150);
input : 손절15(50),익절15(300),TR15(150);
input : 손절16(50),익절16(300),TR16(150);
input : 손절17(50),익절17(300),TR17(150);
input : 손절18(50),익절18(300),TR18(150);
input : 손절19(50),익절19(300),TR19(150);
input : 손절20(50),익절20(300),TR20(150);
Array : EP[30](0);
if MarketPosition == 0 and NextBarOpen < 기준+상승 and ExitDate(1) != sdate Then
buy("b1",AtStop,기준+상승);
if MarketPosition == 1 Then
{
var1 = (기준+상승) + 상승*MaxEntries;
EP[MaxEntries] = LatestEntryPrice(0);
if MaxEntries == 1 and NextBarOpen < var1 Then
buy("b2",AtStop,var1);
if MaxEntries == 2 and NextBarOpen < var1 Then
buy("b3",AtStop,var1);
if MaxEntries == 3 and NextBarOpen < var1 Then
buy("b4",AtStop,var1);
if MaxEntries == 4 and NextBarOpen < var1 Then
buy("b5",AtStop,var1);
if MaxEntries == 5 and NextBarOpen < var1 Then
buy("b6",AtStop,var1);
if MaxEntries == 6 and NextBarOpen < var1 Then
buy("b7",AtStop,var1);
if MaxEntries == 7 and NextBarOpen < var1 Then
buy("b8",AtStop,var1);
if MaxEntries == 8 and NextBarOpen < var1 Then
buy("b9",AtStop,var1);
if MaxEntries == 9 and NextBarOpen < var1 Then
buy("b10",AtStop,var1);
if MaxEntries == 10 and NextBarOpen < var1 Then
buy("b11",AtStop,var1);
if MaxEntries == 11 and NextBarOpen < var1 Then
buy("b12",AtStop,var1);
if MaxEntries == 12 and NextBarOpen < var1 Then
buy("b13",AtStop,var1);
if MaxEntries == 13 and NextBarOpen < var1 Then
buy("b14",AtStop,var1);
if MaxEntries == 14 and NextBarOpen < var1 Then
buy("b15",AtStop,var1);
if MaxEntries == 15 and NextBarOpen < var1 Then
buy("b16",AtStop,var1);
if MaxEntries == 16 and NextBarOpen < var1 Then
buy("b17",AtStop,var1);
if MaxEntries == 17 and NextBarOpen < var1 Then
buy("b18",AtStop,var1);
if MaxEntries == 18 and NextBarOpen < var1 Then
buy("b19",AtStop,var1);
if MaxEntries == 19 and NextBarOpen < var1 Then
buy("b20",AtStop,var1);
if MaxEntries >= 1 and EP[1] > 0 Then
{
ExitLong("bl1",AtStop,EP[1]-PriceScale*손절1,"b1");
ExitLong("bp1",Atlimit,EP[1]+PriceScale*익절1,"b1");
ExitLong("btr1",AtStop,highest(h,BarsSinceEntry)-PriceScale*TR1,"b1");
}
if MaxEntries >= 2 and EP[2] > 0 Then
{
ExitLong("bl2",AtStop,EP[2]-PriceScale*손절2,"b2");
ExitLong("bp2",Atlimit,EP[2]+PriceScale*익절2,"b2");
ExitLong("btr2",AtStop,highest(h,BarsSinceEntry)-PriceScale*TR2,"b2");
}
if MaxEntries >= 3 and EP[3] > 0 Then
{
ExitLong("bl3",AtStop,EP[3]-PriceScale*손절3,"b3");
ExitLong("bp3",Atlimit,EP[3]+PriceScale*익절3,"b3");
ExitLong("btr3",AtStop,highest(h,BarsSinceEntry)-PriceScale*TR3,"b3");
}
if MaxEntries >= 4 and EP[4] > 0 Then
{
ExitLong("bl4",AtStop,EP[4]-PriceScale*손절4,"b4");
ExitLong("bp4",Atlimit,EP[4]+PriceScale*익절4,"b4");
ExitLong("btr4",AtStop,highest(h,BarsSinceEntry)-PriceScale*TR4,"b4");
}
if MaxEntries >= 5 and EP[5] > 0 Then
{
ExitLong("bl5",AtStop,EP[5]-PriceScale*손절5,"b5");
ExitLong("bp5",Atlimit,EP[5]+PriceScale*익절5,"b5");
ExitLong("btr5",AtStop,highest(h,BarsSinceEntry)-PriceScale*TR5,"b5");
}
if MaxEntries >= 6 and EP[6] > 0 Then
{
ExitLong("bl6",AtStop,EP[6]-PriceScale*손절6,"b6");
ExitLong("bp6",Atlimit,EP[6]+PriceScale*익절6,"b6");
ExitLong("btr6",AtStop,highest(h,BarsSinceEntry)-PriceScale*TR6,"b6");
}
if MaxEntries >= 7 and EP[7] > 0 Then
{
ExitLong("bl7",AtStop,EP[7]-PriceScale*손절7,"b7");
ExitLong("bp7",Atlimit,EP[7]+PriceScale*익절7,"b7");
ExitLong("btr7",AtStop,highest(h,BarsSinceEntry)-PriceScale*TR7,"b7");
}
if MaxEntries >= 8 and EP[8] > 0 Then
{
ExitLong("bl8",AtStop,EP[8]-PriceScale*손절8,"b8");
ExitLong("bp8",Atlimit,EP[8]+PriceScale*익절8,"b8");
ExitLong("btr8",AtStop,highest(h,BarsSinceEntry)-PriceScale*TR8,"b8");
}
if MaxEntries >= 9 and EP[9] > 0 Then
{
ExitLong("bl9",AtStop,EP[9]-PriceScale*손절9,"b9");
ExitLong("bp9",Atlimit,EP[9]+PriceScale*익절9,"b9");
ExitLong("btr9",AtStop,highest(h,BarsSinceEntry)-PriceScale*TR9,"b9");
}
if MaxEntries >= 10 and EP[10] > 0 Then
{
ExitLong("bl10",AtStop,EP[10]-PriceScale*손절10,"b10");
ExitLong("bp10",Atlimit,EP[10]+PriceScale*익절10,"b10");
ExitLong("btr10",AtStop,highest(h,BarsSinceEntry)-PriceScale*TR10,"b10");
}
if MaxEntries >= 11 and EP[11] > 0 Then
{
ExitLong("bl11",AtStop,EP[11]-PriceScale*손절11,"b11");
ExitLong("bp11",Atlimit,EP[11]+PriceScale*익절11,"b11");
ExitLong("btr11",AtStop,highest(h,BarsSinceEntry)-PriceScale*TR11,"b11");
}
if MaxEntries >= 12 and EP[12] > 0 Then
{
ExitLong("bl12",AtStop,EP[12]-PriceScale*손절12,"b12");
ExitLong("bp12",Atlimit,EP[12]+PriceScale*익절12,"b12");
ExitLong("btr12",AtStop,highest(h,BarsSinceEntry)-PriceScale*TR12,"b12");
}
if MaxEntries >= 13 and EP[13] > 0 Then
{
ExitLong("bl13",AtStop,EP[13]-PriceScale*손절13,"b13");
ExitLong("bp13",Atlimit,EP[13]+PriceScale*익절13,"b13");
ExitLong("btr13",AtStop,highest(h,BarsSinceEntry)-PriceScale*TR13,"b13");
}
if MaxEntries >= 14 and EP[14] > 0 Then
{
ExitLong("bl14",AtStop,EP[14]-PriceScale*손절14,"b14");
ExitLong("bp14",Atlimit,EP[14]+PriceScale*익절14,"b14");
ExitLong("btr14",AtStop,highest(h,BarsSinceEntry)-PriceScale*TR14,"b14");
}
if MaxEntries >= 15 and EP[15] > 0 Then
{
ExitLong("bl15",AtStop,EP[15]-PriceScale*손절15,"b15");
ExitLong("bp15",Atlimit,EP[15]+PriceScale*익절15,"b15");
ExitLong("btr15",AtStop,highest(h,BarsSinceEntry)-PriceScale*TR15,"b15");
}
if MaxEntries >= 16 and EP[16] > 0 Then
{
ExitLong("bl16",AtStop,EP[16]-PriceScale*손절16,"b16");
ExitLong("bp16",Atlimit,EP[16]+PriceScale*익절16,"b16");
ExitLong("btr16",AtStop,highest(h,BarsSinceEntry)-PriceScale*TR16,"b16");
}
if MaxEntries >= 17 and EP[17] > 0 Then
{
ExitLong("bl17",AtStop,EP[17]-PriceScale*손절17,"b17");
ExitLong("bp17",Atlimit,EP[17]+PriceScale*익절17,"b17");
ExitLong("btr17",AtStop,highest(h,BarsSinceEntry)-PriceScale*TR17,"b17");
}
if MaxEntries >= 18 and EP[18] > 0 Then
{
ExitLong("bl18",AtStop,EP[18]-PriceScale*손절18,"b18");
ExitLong("bp18",Atlimit,EP[18]+PriceScale*익절18,"b18");
ExitLong("btr18",AtStop,highest(h,BarsSinceEntry)-PriceScale*TR18,"b18");
}
if MaxEntries >= 19 and EP[19] > 0 Then
{
ExitLong("bl19",AtStop,EP[19]-PriceScale*손절19,"b19");
ExitLong("bp19",Atlimit,EP[19]+PriceScale*익절19,"b19");
ExitLong("btr19",AtStop,highest(h,BarsSinceEntry)-PriceScale*TR19,"b19");
}
if MaxEntries >= 20 and EP[20] > 0 Then
{
ExitLong("bl20",AtStop,EP[20]-PriceScale*손절20,"b20");
ExitLong("bp20",Atlimit,EP[20]+PriceScale*익절20,"b20");
ExitLong("btr20",AtStop,highest(h,BarsSinceEntry)-PriceScale*TR20,"b20");
}
}
2020-01-20
240
글번호 130654
답변완료
수식문의
안녕하세요 수식 문의드리며 답변 미리 감사하다는 말씀 올립니다
아래지표는 주챠트 보조챠트를 차례로 선물, 콜옵션, 풋옵션으로 설정하고 양합을 구하는 수식입니다.
input : P1(10), P2(45);
var : AA(0,data2), BB(0,data2), CC(0,data2), ma1(0,data2), ma2(0,data3);
AA = data2(c)+data3(c);
ma1 = data2(ma(AA,P1));
ma2 = data2(ma(AA,P2));
if date != date[1] Then
{
CC = data2(C)+data3(C);
}
plot1(ma1,"양합이평1",RED);
plot2(ma2,"양합이평2",BLUE);
plot3(AA,"양합",BLACK);
plot5(CC,"첫봉양합",GREEN);
여기의 양합챠트(AA)에서 10이평이 45이평을 상향돌파하면 주챠트에 매수신호 발생
반대로 양합챠트에서 10이평이 45이평 하향돌파하면 주챠트에서 매도신호 발생
감사합니다.
2019-07-26
211
글번호 130653
답변완료
문의드립니다
Input:length(5);
Var:j(0),lastHiVal(0),lastLoVal(0),sBar(0),eBar(0),TL1(0),TL2(0),TL3(0),Text1(0),처리구분(""),
TL_Val1(0),TL_Val2(0);
Var:TL11(0),TL12(0),TL13(0),TL14(0),TL15(0),TL16(0),TL17(0),TL18(0),TL19(0),TL20(0),tx(0);
Var:TL21(0),TL22(0),TL23(0),TL24(0),TL25(0),TL26(0),TL27(0),TL28(0),TL29(0),TL30(0),mav(0),T(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
{
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(TL11);
Text_Delete(Text1);
If 고점[3,1][1] < 고점[2,1][1] and 고점[2,1][1] > 고점[1,1][1] and 저점[2,1][1] < 저점[1,1][1] Then
TL_Delete(TL2);
}
TL1 = TL_New(sDate[sBar],sTime[sBar],저점[1,1],sDate[eBar],sTime[eBar],고점[1,1]);
//TL11 = TL_New(sDate[index-고점[2,2]],sTime[index-고점[2,2]],고점[2,1],sDate[1],sTime[1],고점[2,1]);
//Text1 = Text_New(sDate[eBar],sTime[eBar],고점[1,1],NumToStr(고점[1,1],2));
TL_SetColor(TL1,BLACK);
//TL_SetColor(TL11,BLACK);
TL_SetSize(TL1,1);
//TL_SetSize(TL11,2);
If 고점[3,1] < 고점[2,1] and 고점[2,1] > 고점[1,1] and 저점[2,1] < 저점[1,1] Then
{
sBar = Index - 저점[2,2];
eBar = Index - 저점[1,2];
}
}
}
If 처리구분 == "저점처리" Then
{
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(TL11);
Text_Delete(Text1);
If 저점[2,1][1] < 저점[1,1][1] and 저점[2,1][1] < 저점[3,1][1] and 고점[2,1][1] > 고점[1,1][1] Then
TL_Delete(TL3);
}
TL1 = TL_New(sDate[sBar],sTime[sBar],고점[1,1],sDate[eBar],sTime[eBar],저점[1,1]);
//TL11 = TL_New(sDate[index-저점[2,2]],sTime[index-저점[2,2]],저점[2,1],sDate[1],sTime[1],저점[2,1]);
//Text1 = Text_New(sDate[eBar],sTime[eBar],저점[1,1],NumToStr(저점[1,1],2));
TL_SetColor(TL1,BLACK);
//TL_SetColor(TL11,BLACK);
TL_SetSize(TL1,1);
//TL_SetSize(TL11,2);
If 저점[2,1] < 저점[1,1] and 저점[2,1] < 저점[3,1] and 고점[2,1] > 고점[1,1] Then
{
sBar = Index - 고점[2,2];
eBar = Index - 고점[1,2];
}
}
}
mav = ma(C,20);
고점과저점을찍은마지막파동선에만 고점과저점을기준으로피보나치100.76.4.23.6.0프로로 수평선이4개나오게 하고십습니다(ture) 각선마다 색갈을넣어주시고 두께도 조정하게끔부탁드립니다~~매번감사드립니다
2019-07-26
194
글번호 130652
답변완료
문의드립니다.
키움에서 보조지표를 가져왔는데 그 보조지표가
당일 시작할때 시작점을 별도로 수평선으로 나타나게 하고 싶습니다.
아래는 키움에서 해당 보조지표의 시작가를 수평선으로 표현했던 수식입니다.
보조지표는 macd나 스톡으로 가정해도 됩니다.
9시 개장하면 보조지표의 시작점이 수평선으로 그어지면 됩니다.
a1= A;
valuewhen(1, date<>date(1), a1)
노고에 늘 감사드립니다.
2019-07-25
202
글번호 130651
답변완료
문의드립니다
안녕하세요 초보수식 문의드립니다
키움수식을 예스로 변경 부탁드려요
수식1
M = ma(C, 기간, 종류);
HH = Highest(M, 봉수);
Valuewhen(1, HH>HH(1), HH)
수식2
M = ma(C, 기간, 종류);
LL = Lowest(M, 봉수);
Valuewhen(1, LL<LL(1), LL)
지표조건설정
기간 20
종류 단순
봉수 20
스케일
가격
감사합니다
2019-07-25
173
글번호 130650
요타 님에 의해서 삭제되었습니다.
2019-07-25
2
글번호 130649