커뮤니티
예스랭귀지 Q&A
답변완료
[공지] 예스랭귀지 AI 어시스턴트, '예스나 AI' 출시 및 무료 체험 안내
안녕하세요, 예스스탁 입니다.복잡한 수식 공부 없이 여러분의 아이디어를 말하면 시스템 트레이딩 언어 예스랭귀지로 작성해주는 서비스예스나 AI(YesNa AI)가 출시되었습니다.지금 예스나 AI를 직접 경험해 보실 수 있도록 20크레딧(질문권 20회)를 무료로 증정해 드리고 있습니다.바로 여러분의 아이디어를 코드로 변환해보세요.--------------------------------------------------🚀 YesNa AI 핵심 기능- 지표식/전략식/종목검색식 생성: 자연어로 요청하면 예스랭귀지 문법에 맞는 코드를 작성합니다.- 종목검색식 변환 지원: K증권의 종목 검색식을 예스랭귀지로 변환 지원합니다.- 컴파일 검증: 작성된 코드가 실행 가능한지 컴파일러를 통해 문법 검증을 거쳐 결과물을 제공합니다.상세한 서비스 개요 및 활용 방법은 [서비스 소개 페이지]에서 확인하실 수 있습니다.▶ 서비스 소개 페이지: 바로가기서비스 사용 유의사항 및 결제 환불정책은 [이용약관]을 참고 부탁드립니다.▶ 서비스 이용약관: 바로가기💬 이용 문의사용 중 문의사항은 [프로그램 사용법 Q&A] 게시판에서 [예스나 AI] 카테고리를 설정 후 문의해 주시면 상세히 안내해 드리겠습니다.--------------------------------------------------앞으로도 AI를 활용한 다양한 트레이딩 기능들을 지속적으로 선보일 예정입니다.많은 관심과 기대 부탁드립니다.
2026-02-27
1699
글번호 230811
답변완료
totaltrades
첨부파일과 같이 청산 신호가 나온 뒤 진입신호가 atmarket으로 진행되어 청산과 진입이 한 봉에서 조건을 만족하면 재진입신호가 안나오게 제어를 할 방법이 없네요.
totaltrades <= 3 이런식으로 총 진입신호가 3번까지만 나오라고 제어해도 안되고,
청산과 재진입신호가 한 봉에서 나올 경우 재진입신호를 막을 방법은 없을까요.
신호가격이 다르면 제어가 되어야 될 것 같은데 한 봉에서 발생하면 어떤식으로 해도 안되네요.
방법이 있으면 알려주세요.
2021-04-26
893
글번호 148384
답변완료
수식어 부탁드립니다
input : StartTime(150000),EndTime(055000),xtime(055500);
INPUTS: R(4), S(8), U(6), ZEROLINE(0), SMTHLEN(10);
var : Truestrength(0),Truestrengthsig(0);
Input : 당일수익틱수(200);
Var : N1(0),dayPl(0),당일수익(0),Xcond(false);
Var : value(0),Tcond(false);
if sDate != sDate[1] then
SetStopEndofday(xtime);
if (sdate != sdate[1] and stime >= EndTime) or
(sdate == sdate[1] and stime >= EndTime and stime[1] < EndTime) Then
Tcond = False;
if (sdate != sdate[1] and stime >= StartTime) or
(sdate == sdate[1] and stime >= StartTime and stime[1] < StartTime) Then
{
Tcond = true;
SetStopEndofday(0);
Xcond = false;
N1 = NetProfit;
}
당일수익 = PriceScale*당일수익틱수;
daypl = NetProfit-N1;
if TotalTrades > TotalTrades[1] then
{
if daypl >= 당일수익 Then
Xcond = true;
if (IsExitName("dbp",1) == true or IsExitName("dsp",1) == true ) then
Xcond = true;
}
Truestrength = TSI(C, R, S, U);
Truestrengthsig = Ema(TSI(C, R, S, U), SMTHLEN);
if crossup(Truestrength,Truestrengthsig) and Truestrength < 0 Then
buy();
if CrossDown(Truestrength,Truestrengthsig) and Truestrength > 0 Then
sell();
;
------------------------------
True Strength Index 지표를 이용한 수식어 변경입니다.
True Strength Index의 cross down 신호시 10분 이후 5,10선 1차 dead cross에서 진입하고
True Strength Index의 cross up 신호시 10분 이후 5,10선 1차 golden cross에서 sell청산하는
수식어와 그 반대되는 buy신호후 청산하는 수식어도 같이 부탁 드립니다.
2021-04-26
996
글번호 148374
답변완료
수식 수정 부탁드립니다
안녕하세요
아래 수식에 다음과 같은 내용을 추가부탁드립니다
1. 매수청산 후 매매정지, 매수조건이 다시 만족하면 매매
(sum이 '0' -> '+2'가 다시 될 때 매수해야하지만 현재 청산이후 연속 매수와 청산을 반복)
매도청산 후 매매정지, 매도조건이 다시 만족하면 매매
(sum이 '-2' -> '-2'가 다시 될 때 매도해야 하지만 현재 청산이후 연속 매도와 청산을 반복)
2. 3회 로스컷 후 매매정지, 다시 한번 손실나면 또 매매정지되는 문제점 해소
3회 로스컷 후 매매정지, 이후 손실 카운팅을 다시 시작으로 개선
항상 감사드립니다
--------------------
input : N(4),익절(0.03),손절(0),StartTime(070000),EndTime(070000),매매정지(20),lb(0),lp(2),sb(-2),sp(-2);
var : LL(0),HH(0),cnt(0),sum(0),CL(0),CS(0),Lss(0);
Array : VV[20](0);
var : Tcond(false),S1(0),D1(0),TM(0),b_vv(0),Condition4(False),최고점(0),최저점(0);
Condition1 = L[4]>L[3] and L[3] >L[2] and H>H[1] and H[1]>H[2];
Condition2 = H[4]<H[3] and H[3]<H[2] and L<L[1] and L[1]<L[2];
if ( ( var2 == 0 and C > CS and vv[0] == -1 ) or LL == 0 or C > CL ) and condition1 == true and Condition1[1] == False Then
{
var1 = var1+1;
LL = L[2];
CL = C;
VV[0] = 1;
For cnt = 1 to 19
{
VV[cnt] = VV[cnt-1][1];
}
if VV[N-1] != 0 Then
{
sum = 0;
For cnt = 0 to N-1
{
sum = sum + VV[cnt];
}
}
}
else
{
if L < LL Then
{
var1 = 0;
}
}
if (( var1 == 0 and C < CL and vv[0] ==1) or hh == 0 or C < CS) and condition2 == true and Condition2[1] == False Then
{
var2 = var2+1;
HH = H[2];
CS = C;
VV[0] = -1;
For cnt = 1 to 19
{
VV[cnt] = VV[cnt-1][1];
}
if VV[N-1] != 0 Then
{
sum = 0;
For cnt = 0 to N-1
{
sum = sum + VV[cnt];
}
}
}
Else
{
if H > HH Then
{
var2 = 0;
}
}
if Bdate != Bdate[1] Then
{
S1 = TimeToMinutes(stime);
D1 = sdate;
Condition4 = False;
}
if D1 > 0 then
{
if sdate == D1 Then
TM = TimeToMinutes(stime)-S1;
Else
TM = TimeToMinutes(stime)+1440-S1;
}
if TotalTrades > TotalTrades[1] Then
{
Condition4 = False;
if PositionProfit(1) < 0 Then
Lss = Lss+1;
Else
Lss= 0;
if lss == 3 Then
Condition4 = true;
}
b_vv = vv[4]+vv[3]+vv[2]+vv[1];
if (sTime > starttime or sTime < Endtime) and marketposition == 0 Then
{
if (b_vv == lb and sum == lp) Then
{
if condition4 == False Then
Buy("b");
if (condition4 == true and TM >= TM[BarsSinceExit(1)]+매매정지) Then
Buy("b1");
}
if (b_vv == sb and sum == sp) Then
{
if condition4 == False Then
Sell("s");
if (condition4 == true and TM >= TM[BarsSinceExit(1)]+매매정지) Then
Sell("s1");
}
}
if MarketPosition(0) > 0 Then
ExitLong("xl",atstop,ll);
if MarketPosition(0) < 0 Then
ExitShort("xs",atstop,hh);
#타겟청산
SetStopProfittarget(익절,pointstop);
SetStopLoss( 손절 ,PointStop);
2021-04-26
1060
글번호 148373
답변완료
문의 드립니다.
진입이나 청산 조건이 만족 되었을 때 일반적으로 봉 완성이 되고 난 후 다음 봉의 시가에 명령이 실행된다고 알고 있습니다. 그런데 명령 실행이 봉 완성이 아니고 지정한 시간, 예를 들어서 진입이나 청산 조건이 만족한 후 (5)초 뒤에 실행하라.... 이런 식이 가능한지 궁금합니다.
2021-04-26
943
글번호 148372
답변완료
수고 많습니다
60일 고가에 근접한 종목(10%이내) 찾고 싶습니다
부탁드립니다..
2021-04-26
958
글번호 148371
답변완료
문의 드립니다
input : StartTime(220000),EndTime(055000),진입횟수(10),익절틱수(100),손절틱수(30);
var : Tcond(false),entry(0);
if StartTime < EndTime Then
{
SetStopEndofday(EndTime);
}
Else
{
if sDate != sDate[1] Then
SetStopEndofday(EndTime);
}
if (sdate != sdate[1] and stime >= EndTime) or
(sdate == sdate[1] and stime >= EndTime and stime[1] < EndTime) Then
Tcond = False;
if (sdate != sdate[1] and stime >= StartTime) or
(sdate == sdate[1] and stime >= StartTime and stime[1] < StartTime) Then
{
if StartTime > EndTime Then
SetStopEndofday(0);
Tcond = true;
entry = 0;
}
if (MarketPosition != 0 and MarketPosition != MarketPosition[1]) or
(MarketPosition == MarketPosition[1] and TotalTrades > TotalTrades[1]) Then
entry = entry+1;
if Tcond == true Then
{
if MarketPosition == 0 and C > O and entry < 진입횟수 Then
{
Buy("b");
}
}
SetStopProfittarget(PriceScale*익절틱수,PointStop);
SetStopLoss(PriceScale*손절틱수,PointStop);
----------------------
sell 진입후 청산이 포함된 수식어를 부탁드립니다.
---------------------------------
sell만 별도로 진입후 청산의 수식어도 부탁드립니다.
미리 감사드립니다.
2021-04-26
823
글번호 148370
답변완료
문의 드립니다
그림에서 처럼 한개의 봉에서 손절과 진입이 되는데
청산(손절이나 익절 모두)이되면 조건이 만족해도 같은봉에서는 진입하지 않도록 하고싶습니다
if BarsSinceExit(1) >= 1 이렇게 조건식을 쓰면
그림에서 아예 첫번째 매수도 하지 않네요...
if BarsSinceExit(1) != 0 이것도 마친가지구요
2021-04-26
969
글번호 148369
답변완료
문의드립니다.
안녕하세요
예스랭귀지로 변환 문의드릴 수 있을까요
항상 도움 주셔서 감사드립니다
length = input(20, title="BB Length")
mult = input(2.0, title="BB MultFactor")
length2 = input(20, title="HMA Length")
source = input(open, title="Source")
lengthKC = input(20, title="KC Length")
multKC = input(1.5, title="KC MultFactor")
useTrueRange = input(true, title="Use TrueRange (KC)", type=input.bool)
// Calculate HMA
hullma = wma(2 * wma(source, length / 2) - wma(source, length), round(sqrt(length)))
// Calculate BB
basis = hullma
dev = mult * stdev(source, length)
upperBB = basis + dev
lowerBB = basis - dev
// Calculate KC
range = useTrueRange ? tr : high - low
rangema = wma(2 * wma(range, lengthKC / 2) - wma(range, lengthKC), round(sqrt(lengthKC)))
upperKC = hullma + rangema * multKC
lowerKC = hullma - rangema * multKC
sqzOn = lowerBB > lowerKC and upperBB < upperKC
sqzOff = lowerBB < lowerKC and upperBB > upperKC
noSqz = sqzOn == false and sqzOff == false
val = linreg(source - avg(avg(highest(high, lengthKC), lowest(low, lengthKC)), hma(close, lengthKC)), lengthKC, 0)
bcolor = iff(val > 0, iff(val > nz(val[1]), color.lime, color.green), iff(val < nz(val[1]), color.red, color.maroon))
scolor = noSqz ? color.blue : sqzOn ? color.black : color.gray
plot(val, color=bcolor, style=plot.style_histogram, linewidth=4)
plot(0, color=scolor, style=plot.style_cross, linewidth=2)
2021-04-26
984
글번호 148368
timeless 님에 의해서 삭제되었습니다.
2021-04-26
11
글번호 148367