커뮤니티
예스랭귀지 Q&A
답변완료
[공지] 예스랭귀지 AI 어시스턴트, '예스나 AI' 출시 및 무료 체험 안내
안녕하세요, 예스스탁 입니다.복잡한 수식 공부 없이 여러분의 아이디어를 말하면 시스템 트레이딩 언어 예스랭귀지로 작성해주는 서비스예스나 AI(YesNa AI)가 출시되었습니다.지금 예스나 AI를 직접 경험해 보실 수 있도록 20크레딧(질문권 20회)를 무료로 증정해 드리고 있습니다.바로 여러분의 아이디어를 코드로 변환해보세요.--------------------------------------------------🚀 YesNa AI 핵심 기능- 지표식/전략식/종목검색식 생성: 자연어로 요청하면 예스랭귀지 문법에 맞는 코드를 작성합니다.- 종목검색식 변환 지원: K증권의 종목 검색식을 예스랭귀지로 변환 지원합니다.- 컴파일 검증: 작성된 코드가 실행 가능한지 컴파일러를 통해 문법 검증을 거쳐 결과물을 제공합니다.상세한 서비스 개요 및 활용 방법은 [서비스 소개 페이지]에서 확인하실 수 있습니다.▶ 서비스 소개 페이지: 바로가기서비스 사용 유의사항 및 결제 환불정책은 [이용약관]을 참고 부탁드립니다.▶ 서비스 이용약관: 바로가기💬 이용 문의사용 중 문의사항은 [프로그램 사용법 Q&A] 게시판에서 [예스나 AI] 카테고리를 설정 후 문의해 주시면 상세히 안내해 드리겠습니다.--------------------------------------------------앞으로도 AI를 활용한 다양한 트레이딩 기능들을 지속적으로 선보일 예정입니다.많은 관심과 기대 부탁드립니다.
2026-02-27
7849
글번호 230811
답변완료
변환부탁드립니다.
src = input(close, "Price", type = input.source)
CMOlength = input(9, minval=1, title="Alpha Chande Momentum Length")
//CMO
momm = change(src)
f1(m) => m >= 0.0 ? m : 0.0
f2(m) => m >= 0.0 ? 0.0 : -m
m1 = f1(momm)
m2 = f2(momm)
sm1 = sum(m1, CMOlength)
sm2 = sum(m2, CMOlength)
percent(nom, div) => 100 * nom / div
chandeMO = percent(sm1-sm2, sm1+sm2)
plot(chandeMO, "Chande MO", color=color.blue)
//RMI
length3 = input(title="RMI Length", type=input.integer, minval=1, defval=30)
momentumLength3 = input(title="RMI Momentum ", type=input.integer, minval=1, defval=25)
up3 = rma(max(change(src, momentumLength3), 0), length3)
down3 = rma(-min(change(src, momentumLength3), 0), length3)
rmi3 = (down3 == 0 ? 100 : up3 == 0 ? 0 : 100 - (100 / (1 + up3 / down3)))-50
//
//
lengthMA = input(7)
lengthRSI = input(14)
thrsi = hma(hma(hma(rsi(src, lengthRSI), lengthMA), lengthMA), lengthMA)
thrsi1 = (thrsi-50)*10
lengthMA2 = input(7)
lengthRSI2 = input(14)
devwrsi = ((ema(ema(vwma(rsi(src, lengthRSI2), lengthMA2), lengthMA2), lengthMA2))-50)*5
lengthMA3 = input(7)
lengthRSI3 = input(14)
tersi = ((ema(ema(ema(rsi(src, lengthRSI3), lengthMA3), lengthMA3), lengthMA3))-50)*10
rmirsi = ((thrsi*rmi3/25))
//Boundary Lines
obLevel1 = input(0, title="Chande Sellline")
osLevel1 = input(0, title="Chande Buyline")
hline(obLevel1, color=#0bc4d9)
hline(osLevel1, color=#0bc4d9)
obLevel2 = input(0, title="Triple HMRSI Sellline")
osLevel2 = input(0, title="Triple HMRSI Buyline")
hline(obLevel2, color=#5a0bd9)
hline(osLevel2, color=#5a0bd9)
obLevel3 = input(0, title="DEVWRSI Sellline")
osLevel3 = input(0, title="DEVWRSI Buyline")
hline(obLevel3, color=#5a0bd9)
hline(osLevel3, color=#5a0bd9)
obLevel4 = input(0, title="TERSI Sellline")
osLevel4 = input(0, title="TERSI Buyline")
hline(obLevel4, color=#5a0bd9)
hline(osLevel4, color=#5a0bd9)
obLevel5 = input(0, title="RMI Sellline")
osLevel5 = input(0, title="RMI Buyline")
hline(obLevel5, color=#5a0bd9)
hline(osLevel5, color=#5a0bd9)
obLevel6 = input(0, title="RMI*RSI Sellline")
osLevel6 = input(0, title="RMI*RSI Buyline")
hline(obLevel6, color=#5a0bd9)
hline(osLevel6, color=#5a0bd9)
plot((thrsi1), title="THRSI")
plot(devwrsi, color=color.red, title="DEVWRSI")
plot(tersi, color=color.yellow, title="TERSI")
plot(rmirsi, color=color.purple, title="RMI*HMRSI")
plot(rmi3, color=color.orange, title="RMI")
longcondition1 = crossover(chandeMO, osLevel1)
shortcondition1 = crossunder(chandeMO, obLevel1)
longcondition2 = rmirsi<osLevel6 and rmi3<osLevel5 and tersi<osLevel4 and devwrsi<osLevel3 and thrsi1<osLevel2 and longcondition1
shortcondition2 = rmirsi>obLevel6 and rmi3>obLevel5 and tersi>obLevel4 and devwrsi>obLevel3 and thrsi1>obLevel2 and shortcondition1
if testPeriod()
if longcondition2
strategy.entry("Buy", strategy.long)
if shortcondition2
strategy.entry("Sell", strategy.short)
hline(0, color=#C0C0C0, linestyle=hline.style_dashed, title="Zero Line")
2021-09-30
895
글번호 152601
철판때기 님에 의해서 삭제되었습니다.
2021-09-30
4
글번호 152600
답변완료
부탁 드립니다~~^^
안녕 하세요~
20 이평과 60이평이 골든 크로스 된 후, 10 봉이내 에서 다시 5이평이 20 이평을 골든 크로스 되었거나, 5/20 이평의 이격이 12% 내로 가까워진 종목을 찾고 싶습니다.
단, 10봉 이내를 => 제가 수시로 수정을 해서 찾을 수 있도록 부탁 드립니다.
2021-09-30
947
글번호 152599
답변완료
수정 부탁드립니다
보내주신 수식 적용했는데
매수 신호가 2회가 나옵니다
제가 원하는 것은 bx, sx 청산이후에는
BH, SL 매수 매도가 1회만 나오게 하는 겁니다
수정 부탁드립니다
var : HC(0),HO(0),HI(0);
var : LC(0),LO(0),LI(0);
var : rebuy(0),resell(0);
if MarketPosition == 1 Then
{
if C > O and (HC == 0 or (HC > 0 and C > HC)) Then
{
HC = C;
HO = O;
HI = Index;
}
if Index <= HI+2 and C < O and HC > 0 and O > HC and C < HO Then
ExitLong("bx");
}
Else
{
HC = 0;
HO = 0;
}
if MarketPosition == -1 Then
{
if C < O and (LC == 0 or (LC > 0 and C < LC)) Then
{
LC = C;
LO = O;
LI = Index;
}
if Index <= LI+2 and C > O and LC > 0 and O < LC and C > LO Then
ExitShort("sx");
}
Else
{
LC = 0;
LO = 0;
}
if Bdate != Bdate[1] Then
{
reBuy = 0;
resell = 0;
}
if MarketPosition == 0 and IsExitName("bx",1) == true
and C > O[BarsSinceExit(1)] and rebuy < 1 Then
{
rebuy = rebuy+1;
Buy("BH");
}
if MarketPosition == 0 and IsExitName("sx",1) == true
and C < O[BarsSinceExit(1)] and resell < 1 Then
{
resell = resell+1;
Sell("SL");
}
2021-09-30
867
글번호 152598
답변완료
강제청산관련 질문드립니다.
안녕하세요
강제 청산 관련 질문 드립니다.
지수 선물에서 매수 매도 진입 후 , N개 봉 (60분봉 기준) 후 강제 청산 가능하게
하려면 어떻게 짜야 할까요?
매수 청산, 매도 청산 모두 확인이 필요합니다.
추가로 60분봉에서 매매 하려면 수식이 아닌 프로그램으로 세팅해야 하는 것인지도
답변 부탁드립니다.
감사합니다.
2021-09-30
919
글번호 152597
답변완료
시간설정
Input : af(0.02), maxAF(0.2);
Var : value(0);
value = sar(af,maxAF);
# 매수/매도청산
If C > value Then
{
Buy();
}
# 매도/매수청산
If C < value Then
{
Sell();
}
이 수식에 오후 4시부터 오전2시까지만 신호에 진입하도록 설정해주세요
2021-09-30
706
글번호 152596
답변완료
시초가 매매 수식 수정 부탁드립니다.
아래의 수식으로 항셍시장에 적용해 보았습니다.
포지션 진입을 하는 날과 하지 않는 날이 있는데요.
그 기준을 좀처럼 알기 어렵네요.
전일종가 대비 갭상승이면 매수, 갭하락이면 매도가 진행되게 할 방법이 없을까요?
점검 좀 부탁드리겠습니다.
1. 매수, 매도 포지션이 시초가에 정확하게 적용되었으면 좋겠습니다.
2. 봉 완성을 기다리지 않고 즉시 실행되길 바랍니다.
3. 손절 n틱 추가 바랍니다.
- 아 래 -
input : n1(10),n2(20);
var : DD(0),OO(0);
var : Year(0),V1(0),V2(0),V3(0),V4(0),summer(False);
var : StartTime(0);
if sdate != sdate[1] Then
{
DD = DayOfWeek(sdate);
if DD == 1 Then
OO = DayOpen;
Year = Floor(bdate/10000);
V1 = (10000 * Year) + (100 * 3) + 1;
V2 = 15 - dayofweek(v1);
v3 = (10000 * Year) + (100 * 11) + 1;
v4 = 8 - dayofweek(v3);
Summer = bdate > (10000 * Year) + (100 * 3) + v2
And bdate < (10000 * Year) + (100 * 11) + v4;
if summer == true Then
StartTime = 040000;
Else
StartTime = 101500;
}
if StartTime > 0 and
((NextBarSdate != sDate and NextBarStime >= StartTime) or
(NextBarSdate == sDate and NextBarStime >= StartTime and sTime < StartTime)) Then
{
if NextBarOpen > c Then
Buy("매수",AtMarket);
if NextBarOpen < c Then
Sell("매도",AtMarket);
}
if MarketPosition == 1 Then
ExitLong("매수청산",AtStop,Highest(H,BarsSinceEntry)-n1);
if MarketPosition == -1 Then
ExitShort("매도청산",AtStop,lowest(L,BarsSinceEntry)-n1);
SetStopProfittarget(n2*PriceScale,PointStop);
2021-09-30
1351
글번호 152595
답변완료
전고점, 전저점 돌파
안녕하세요,
당일 시가형성 후 당일 고점을 형성 후 하락이 발생하고, 다시 당일 형성된 고점을 돌파시 매수(N자형 가격흐름)_ 돌파시점은 시간추이에 따라 여러개 발생 가능(
당일 시가형성 후 당일 저점을 형성 후 반등이 발생하고, 다시 당일 형성되었던 저점을 돌파시 매도(M자형 가격흐름)_ 돌파시점은 시간추이에 따라 여러개 발생 가능
감사합니다.
2021-09-30
1315
글번호 152588
한국사람73 님에 의해서 삭제되었습니다.
2021-09-30
0
글번호 152587