커뮤니티
예스랭귀지 Q&A
답변완료
[공지] 예스랭귀지 AI 어시스턴트, '예스나 AI' 출시 및 무료 체험 안내
안녕하세요, 예스스탁 입니다.복잡한 수식 공부 없이 여러분의 아이디어를 말하면 시스템 트레이딩 언어 예스랭귀지로 작성해주는 서비스예스나 AI(YesNa AI)가 출시되었습니다.지금 예스나 AI를 직접 경험해 보실 수 있도록 20크레딧(질문권 20회)를 무료로 증정해 드리고 있습니다.바로 여러분의 아이디어를 코드로 변환해보세요.--------------------------------------------------🚀 YesNa AI 핵심 기능- 지표식/전략식/종목검색식 생성: 자연어로 요청하면 예스랭귀지 문법에 맞는 코드를 작성합니다.- 종목검색식 변환 지원: K증권의 종목 검색식을 예스랭귀지로 변환 지원합니다.- 컴파일 검증: 작성된 코드가 실행 가능한지 컴파일러를 통해 문법 검증을 거쳐 결과물을 제공합니다.상세한 서비스 개요 및 활용 방법은 [서비스 소개 페이지]에서 확인하실 수 있습니다.▶ 서비스 소개 페이지: 바로가기서비스 사용 유의사항 및 결제 환불정책은 [이용약관]을 참고 부탁드립니다.▶ 서비스 이용약관: 바로가기💬 이용 문의사용 중 문의사항은 [프로그램 사용법 Q&A] 게시판에서 [예스나 AI] 카테고리를 설정 후 문의해 주시면 상세히 안내해 드리겠습니다.--------------------------------------------------앞으로도 AI를 활용한 다양한 트레이딩 기능들을 지속적으로 선보일 예정입니다.많은 관심과 기대 부탁드립니다.
2026-02-27
7689
글번호 230811
러블리 님에 의해서 삭제되었습니다.
2011-12-16
145
글번호 45827
답변완료
수식 문의
아래와 같이 시스템 수식을 얻었으나
차트에 뿌려지지가 않네요.
어찌된 영문인지도 모르겠고.
오류를 좀 잡아 주셨으면 감사하겠습니다.
메일로 부탁드립니다.
win8181@naver.com
감사합니다.
variables : v_i(0),state(0),v_close(0),rate(0.95),num(1),next_state(0);
arrays : av_price[20](0);
if(index >2 ) then {
state = next_state[1];
next_state = next_state[1];
}
print("state2.txt","index = %6.0f state %4.0f close:%2.2f",index,state,close);
if(time<90130) then {
state = 0;
next_state = 0;
}
if(state==0) then { /*initialization */
if( time > 90130 && date == 20070718 ) then { /* Transition to trading */
next_state = 1;
print("state.txt","state %4.0f",state);
av_price[0] = Close;
For v_i=1 to 19 {
av_price[v_i] = av_price[v_i-1]*rate;
}
For v_i=0 to 19 { /*소수점 두 째 짜리까지로 라운드 */
av_price[v_i] = round(av_price[v_i],2);
print("price222.txt","price:%2.2f %.0f %",av_price[v_i],state);
}
}
} else if(state == 1) then {
if(close<=av_price[state]) then { /*Transit to next state */
next_state = state+1;
print("state.txt","state %4.0f",next_state);
buy("b1",Onclose,DEF,num);
}
if(close>=av_price[state-1]) then {
next_state = 1001;
print("state.txt","state %4.0f",next_state);
}
} else if(state == 2) then {
if(close<=av_price[state]) then { /*Transit to next state */
next_state = state+1;
print("state.txt","state %4.0f",next_state);
buy("b2",Onclose,DEF,1);
}
if(close>=av_price[state-2]) then {
next_state = state-1;
print("state.txt","state %4.0f",next_state);
Exitlong("s2",Onclose,DEF,"b1",num,1);
}
} else if(state ==3) then {
if(close<=av_price[state]) then { /*Transit to next state */
next_state = state+1;
print("state.txt","state %4.0f",next_state);
buy("b3",Onclose,DEF,num);
}
if(close>=av_price[state-2]) then {
next_state = state-1;
print("state.txt","state %4.0f",next_state);
Exitlong("s3",Onclose,DEF,"b2",num,1);
}
} else if(state ==4) then {
if(close<=av_price[state]) then { /*Transit to next state */
next_state = state+1;
print("state.txt","state %4.0f",next_state);
buy("b4",Onclose,DEF,num);
}
if(close>=av_price[state-2]) then {
next_state = state-1;
print("state.txt","state %4.0f",next_state);
Exitlong("s4",Onclose,DEF,"b3",num,1);
}
} else if(state ==5) then {
if(close<=av_price[state]) then { /*Transit to next state */
next_state =state+1;
print("state.txt","state %4.0f",next_state);
buy("b5",Onclose,DEF,num);
}
if(close>=av_price[state-2]) then {
next_state =state-1;
print("state.txt","state %4.0f",next_state);
Exitlong("s5",Onclose,DEF,"b4",num,1);
}
}else if(state ==6) then {
if(close<=av_price[state]) then { /*Transit to next state */
next_state =state+1;
print("state.txt","state %4.0f",next_state);
buy("b6",Onclose,DEF,num);
}
if(close>=av_price[state-2]) then {
next_state =state-1;
print("state.txt","state %4.0f",next_state);
Exitlong("s6",Onclose,DEF,"b5",num,1);
}
}else if(state ==7) then {
if(close<=av_price[state]) then { /*Transit to next state */
next_state =state+1;
print("state.txt","state %4.0f",next_state);
buy("b7",Onclose,DEF,num);
}
if(close>=av_price[state-2]) then {
next_state =state-1;
print("state.txt","state %4.0f",next_state);
Exitlong("s7",Onclose,DEF,"b6",num,1);
}
}else if(state ==8) then {
if(close<=av_price[state]) then { /*Transit to next state */
next_state =state+1;
print("state.txt","state %4.0f",next_state);
buy("b8",Onclose,DEF,num);
}
if(close>=av_price[state-2]) then {
next_state =state-1;
print("state.txt","state %4.0f",next_state);
Exitlong("s8",Onclose,DEF,"b7",num,1);
}
}else if(state ==9) then {
if(close<=av_price[state]) then { /*Transit to next state */
next_state =state+1;
print("state.txt","state %4.0f",next_state);
buy("b9",Onclose,DEF,num);
}
if(close>=av_price[state-2]) then {
next_state =state-1;
print("state.txt","state %4.0f",next_state);
Exitlong("s9",Onclose,DEF,"b8",num,1);
}
}else if(state ==10) then {
if(close<=av_price[state]) then { /*Transit to next state */
next_state =state+1;
print("state.txt","state %4.0f",next_state);
buy("b10",Onclose,DEF,num);
}
if(close>=av_price[state-2]) then {
next_state =state-1;
print("state.txt","state %4.0f",next_state);
Exitlong("s10",Onclose,DEF,"b9",num,1);
}
} else if(state ==11) then {
if(close<=av_price[state]) then { /*Transit to next state */
next_state =state+1;
print("state.txt","state %4.0f",next_state);
buy("b11",Onclose,DEF,num);
}
if(close>=av_price[state-2]) then {
next_state =state-1;
print("state.txt","state %4.0f",next_state);
Exitlong("s11",Onclose,DEF,"b10",num,1);
}
} else if(state ==12) then {
if(close<=av_price[state]) then { /*Transit to next state */
next_state =state+1;
print("state.txt","state %4.0f",next_state);
buy("b12",Onclose,DEF,num);
}
if(close>=av_price[state-2]) then {
next_state =state-1;
print("state.txt","state %4.0f",next_state);
Exitlong("s12",Onclose,DEF,"b11",num,1);
}
} else if(state ==13) then {
if(close<=av_price[state]) then { /*Transit to next state */
next_state =state+1;
print("state.txt","state %4.0f",next_state);
buy("b13",Onclose,DEF,num);
}
if(close>=av_price[state-2]) then {
next_state =state-1;
print("state.txt","state %4.0f",next_state);
Exitlong("s13",Onclose,DEF,"b12",num,1);
}
} else if(state ==14) then {
if(close<=av_price[state]) then { /*Transit to next state */
next_state =state+1;
print("state.txt","state %4.0f",next_state);
buy("b14",Onclose,DEF,num);
}
if(close>=av_price[state-2]) then {
next_state =state-1;
print("state.txt","state %4.0f",next_state);
Exitlong("s14",Onclose,DEF,"b13",num,1);
}
} else if(state ==15) then {
if(close<=av_price[state]) then { /*Transit to next state */
next_state =state+1;
print("state.txt","state %4.0f",next_state);
buy("b15",Onclose,DEF,num);
}
if(close>=av_price[state-2]) then {
next_state =state-1;
print("state.txt","state %4.0f",next_state);
Exitlong("s15",Onclose,DEF,"b14",num,1);
}
} else if(state ==16) then {
if(close<=av_price[state]) then { /*Transit to next state */
next_state =state+1;
print("state.txt","state %4.0f",next_state);
buy("b16",Onclose,DEF,num);
}
if(close>=av_price[state-2]) then {
next_state =state-1;
print("state.txt","state %4.0f",next_state);
Exitlong("s16",Onclose,DEF,"b15",num,1);
}
} else if(state ==17) then {
if(close<=av_price[state]) then { /*Transit to next state */
next_state =state+1;
print("state.txt","state %4.0f",next_state);
buy("b17",Onclose,DEF,num);
}
if(close>=av_price[state-2]) then {
next_state =state-1;
print("state.txt","state %4.0f",next_state);
Exitlong("s17",Onclose,DEF,"b16",num,1);
}
} else if(state ==18) then {
if(close<=av_price[state]) then { /*Transit to next state */
next_state =state+1;
print("state.txt","state %4.0f",next_state);
buy("b18",Onclose,DEF,num);
}
if(close>=av_price[state-2]) then {
next_state =state-1;
print("state.txt","state %4.0f",next_state);
Exitlong("s18",Onclose,DEF,"b17",num,1);
}
} else if(state ==19) then {
/* if(close<=av_price[state]) then {
next_state = state+1;
print("state.txt","state %4.0f",next_state);
buy(1);
}*/
if(close>=av_price[state-2]) then {
next_state = state-1;
print("state.txt","state %4.0f",next_state);
Exitlong("s19",Onclose,DEF,"b18",num,1);
}
} else if(state == 1001) then {
if(close<=av_price[0]) then { /*Transit to next state */
next_state = 1;
print("state.txt","state %4.0f",next_state);
}
}
2011-12-16
536
글번호 45826
답변완료
수식문의
제가 0부터 100까지 움직이는 어떠한 지표를 만들어서
var1이라고 한다면
당일 var1이 0을 한번이상 찍은 이후에 50을 돌파하면 매수하는 식을 만들고 싶습니다.
2011-12-16
420
글번호 45825
답변완료
문의~~
일봉챠트에서 캔들 시가를 일괄적으로 전일종가로 해서 그려볼수는 없나요~~
이평선은 그대로 두고요~~
부탁드립니다~~~
2011-12-15
422
글번호 45824
무지개나날들 님에 의해서 삭제되었습니다.
2011-12-16
139
글번호 45823
답변완료
질문이요
예스트레이더 지표식에 현재 마켓포지션과연관된 지표를 사용하고 싶은데
예를 들어 현재 마켓포지션이 롱이거나 숏일때
손절라인을 지표식으로 나타내어 차트에 나타내구 싶은데
marketposition 함수는 시스템식에서만 사용할 수 있더라구요.
대신증권 CT에서 i_marketposition 함수처럼 지표나 시스템식에서 모두 사용가능한 함수가 있던데 다른 방법이 있나요??
2011-12-15
585
글번호 45822
답변완료
코드에서 여쭤볼게 있습니다.
nput: FastLen(10), SlowLen(500), ChLen(30), TrailBar(160), ReBars(2), stopPer(1.0);
Vars: FastMA(0), SlowMA(0),LEntryPrice(0), SEntryPrice(0), LCount(-999), SCount(-999), ReCnt(0), MP(0);
FastMA = ma(C , FastLen );
SlowMA = ma(C , SlowLen );
#이평선
If CrossUp(FastMA , SlowMA) and index > 1 then {
LEntryPrice = Highest(H , TrailBar )[1];
//단기 이평이 장기 이평을 상향 돌파하면 그 시점에서 최근 160봉 최고가를 구함
LCount = index;
}
If MarketPosition <> 1 AND index < LCount + ChLen then
Buy ("Cross Over Buy", atstop,LEntryPrice);
//골든 크로스 발생후 30봉 이내에 최근 160봉 최고가( LEntryPrice)에 도달하면 매수진입
If CrossDown(FastMA , SlowMA) and index > 1 then {
SEntryPrice = Lowest(L , TrailBar )[1];
//단기 이평이 장기 이평을 하향 돌파하면 그 시점에서 최근 160봉 최저가를 구함
SCount = index;
}
If MarketPosition <> -1 AND index < SCount + ChLen then
Sell ("Cross Under Sell", atstop,SEntryPrice );
//데드크로스 발생후 30봉 이내에 최근 160봉 최고가( LEntryPrice)에 도달하면 매수진입
If MarketPosition == 1 then {
LCount = -999;
ExitLong ("LongTStop", atstop, Lowest(L , TrailBar ));
//최근 160분봉의 최저가에 도달할 때 매수청산
}
If MarketPosition == -1 then {
SCount = -999;
ExitShort ("ShortTStop", atstop, Highest(H , TrailBar ));
//최근 160분봉의 최고가에 도달할 때 매수청산
}
SCount, LCount를 왜 -999로 셋팅해주는지 잘 모르겠습니다. 이부분 설명해주시겠습니까?
2011-12-15
472
글번호 45821
답변완료
수정바랍니다.
지정한 날부터 신호발생시 매수되게
사용사가 변수입력 가능하다면 수정바랍니다.. 그리고
1차매수뿐아니라 2차매수와 3차매수도 첫번째로 매수 진입이 가능하고
처음 매수된 매수조건의 금액보다 하락하는경우만 매수되게 해주세요.
예]
일단,매수(매수1.2.3차)와 중간청산(청산1차,청산2차)은 해당조건에서
각각 한번씩만 이루어져야 합니다
첫매수가 1차매수지점에서 되는경우
그 보다 하락한 2차와 3차매수조건에서 매수가 됩니다.
청산 1.2차는 동일 합니다.
첫매수가 2차매수에서 되는경우
그보다 하락한 3차매수에서만 매수가 되야하고
중간청산은 청산2차에서 되야 합니다.
첫매수가 3차에서되는경우
더이상의 매수와 중간청산은 없어야 합니다.
input : 최고점(20000),최저점(10000);
var : 중간값(0),매수1차(0),매수2차(0),매수3차(0),청산1차(0),청산2차(0);
중간값 = (최고점+최저점)/2;
매수1차 = (최고점+중간값)/2;
매수2차 = 중간값;
매수3차 = (중간값+최저점)/2;
청산1차 = (매수1차+중간값)/2;
청산2차 = (중간값+매수3차)/2;
if MarketPosition == 0 Then
buy("b1",AtStop,매수1차);
if MarketPosition == 1 Then{
if CurrentEntries == 1 Then
buy("b2",AtStop,매수2차);
if CurrentEntries == 1 Then
buy("b3",AtStop,매수3차);
}
if MarketPosition == 1 Then{
if CurrentEntries == MaxEntries and MaxEntries == 2 Then
exitlong("bx1",atlimit,청산1차,"B1");
if CurrentEntries == MaxEntries and MaxEntries == 3 Then
exitlong("bx2",atlimit,청산2차,"B1");
if CurrentEntries == MaxEntries and MaxEntries == 3 Then
exitlong("bx3",atlimit,청산2차,"B2");
}
if MarketPosition == 1 Then{
exitlong("bx4",atlimit,AvgEntryPrice*1.03,"",int(CurrentContracts*0.5),1);
exitlong("bx5",atlimit,AvgEntryPrice*1.05);
if crossup(C, AvgEntryPrice) Then{
Condition1 = true;
var1 = index;
}
if Condition1 == true Then{
exitlong("bx6",AtStop,highest(H,index-var1+1)*0.99,"",int(CurrentContracts*0.5),1);
exitlong("bx7",AtStop,highest(H,index-var1+1)*0.97);
}
exitlong("bx8",AtStop,최저점);
exitlong("bx9",AtStop,AvgEntryPrice*0.95);
}
2011-12-16
504
글번호 45820
필승0701 님에 의해서 삭제되었습니다.
2011-12-15
0
글번호 45819