커뮤니티
예스랭귀지 Q&A
답변완료
[공지] 예스랭귀지 AI 어시스턴트, '예스나 AI' 출시 및 무료 체험 안내
안녕하세요, 예스스탁 입니다.복잡한 수식 공부 없이 여러분의 아이디어를 말하면 시스템 트레이딩 언어 예스랭귀지로 작성해주는 서비스예스나 AI(YesNa AI)가 출시되었습니다.지금 예스나 AI를 직접 경험해 보실 수 있도록 20크레딧(질문권 20회)를 무료로 증정해 드리고 있습니다.바로 여러분의 아이디어를 코드로 변환해보세요.--------------------------------------------------🚀 YesNa AI 핵심 기능- 지표식/전략식/종목검색식 생성: 자연어로 요청하면 예스랭귀지 문법에 맞는 코드를 작성합니다.- 종목검색식 변환 지원: K증권의 종목 검색식을 예스랭귀지로 변환 지원합니다.- 컴파일 검증: 작성된 코드가 실행 가능한지 컴파일러를 통해 문법 검증을 거쳐 결과물을 제공합니다.상세한 서비스 개요 및 활용 방법은 [서비스 소개 페이지]에서 확인하실 수 있습니다.▶ 서비스 소개 페이지: 바로가기서비스 사용 유의사항 및 결제 환불정책은 [이용약관]을 참고 부탁드립니다.▶ 서비스 이용약관: 바로가기💬 이용 문의사용 중 문의사항은 [프로그램 사용법 Q&A] 게시판에서 [예스나 AI] 카테고리를 설정 후 문의해 주시면 상세히 안내해 드리겠습니다.--------------------------------------------------앞으로도 AI를 활용한 다양한 트레이딩 기능들을 지속적으로 선보일 예정입니다.많은 관심과 기대 부탁드립니다.
2026-02-27
1526
글번호 230811
답변완료
문의 드립니다.~~~~
CME 해외선물 매매시
아래식에서 23시에서 03시 까지에서만 진입하도록
시간 설정하려면 어떻게 해야 하나요?
input : N(5)
input : 익절틱수(50),손절틱수(100);
var : ET(0);
if ET > 0 and sDate != sDate[1] Then
SetStopEndofday(ET);
if Bdate != Bdate[1] Then
{
SetStopEndofday(0);
if stime >= 80000 Then
ET = 060000;
else
ET = 050000;
}
if Bdate == Bdate[n-1] and c-l >= 0
Then
Buy();
SetStopProfittarget(PriceScale*익절틱수,PointStop);
SetStopLoss(PriceScale*손절틱수,PointStop);
2023-07-09
1152
글번호 170457
답변완료
부탁드립니다.
종가고점=최고값(종가, 30);
시가고점=최고값(시가, 30);
상단선=최대값(종가고점, 시가고점)
종가저점=최저값(종가, 30);
시가저점=최저값(시가, 30);
하단선=최소값(종가저점, 시가저점)
A = BBandsUp(120, 2);
하단선 < 상단선 < A &&
상단선 < A < 하단선*1.2 &&
CrossUp(C, A)
종목검색식으로 부탁드립니다.
2023-07-09
1139
글번호 170456
답변완료
지표식 부탁합니다
수고하십니다
먼저 지표식을 올립니다
If O>max(O[1],C[1]) && C>max(O[1],C[1]) && C>=O Then
var1 = O;
If O<=min(O[1],C[1]) && C>max(O[1],C[1]) && C>=O Then
var2 = O;
var : T1(0),T2(0);
If var1 > var1[1] Then T1 = 1; If var1 < var1[1] Then T1 = -1;
If var2 > var2[1] Then T2 = 1; If var2 < var2[1] Then T2 = -1;
plot1(var1, "W", White);
plot2(var2, "B", Black);
If var1[1]>var1 && C>=O && !(T2 == 1 && C<var2) Then
plot11(L, "Y", Yellow);
위 지표식에서 마지막 부분 !(T2 == 1 && C<var2)에
5% 이상 선이 올라가면이라는 수식을 추가하여 신호가 제외되도록 수식 변경 부탁합니다
첨부된 파일은 && !(T2 == 1 && C<var2)이 삭제된 NAVER 차트인데
6월 2일과 16일에 신호가 발생했습니다
5월17일에 올라간 검정선이 6월 30일까지 직선으로 이어졌는데
5월 4일 시작한 검정선이 5월 16일까지 진행되다가 5월 17일에 올라갑니다
결론은 5월17일에 시작한 검정선이 5월 4일 시작한 검정선보다 5% 이상 높다면
6월 2일과 16일 신호는 제외되도록 수식부탁합니다
그렇게 수식이 변경된다면 2월 23일과 3월 6일 신호도 제외되겠지요
2023-07-09
1181
글번호 170455
2wnwn 님에 의해서 삭제되었습니다.
2023-07-09
13
글번호 170454
답변완료
수식수정
Inputs : Period(20), CC_DN(Yellow);
var : 기준선기간(26);
Vars:
VLineUp(0),
VLineDn(0),
HHighest(0),
LLowest(0),
JustChanged(FALSE),
VLine(0), DBN(0),T(0);
Array:
Highs[35](0),
Lows[35](0),
RRange[35](0),
UpWave[1](FALSE),
DnWave[1](FALSE);
If STime == 180000 Then
DBN = 0;
DBN = DBN + 1;
Var1 = Period;
Var2 = Var1 - 1;
Var3 = Var1 - 2;
Var6 = H-L;
JustChanged = FALSE;
if CurrentBar <= Var2 then begin
Highs[CurrentBar] = Close;
Lows[CurrentBar] = Close;
RRange[CurrentBar] = (H-L) /2;
end;
if CurrentBar == Var1 then begin
if Highs[Var2] >= Highs[Var3] then begin
UpWave[1] = TRUE;
HHighest = Highs[Var2];
VLineUp = HHighest - (Var5 * MA(Var6,Var2));
#Plot1(VLineUp,"VLineUp");
end;
if Highs[Var2] < Highs[Var3] then begin
DnWave[1] = TRUE;
LLowest = Lows[Var2];
VLineDn = LLowest + (Var5 * MA(Var6,Var2));
#Plot2(VLineDn,"VLineDn");
end;
end;
if CurrentBar > Var1 then begin
if DnWave[1] and Close > VLineDn then begin
DnWave[1] = FALSE;
UpWave[1] = TRUE;
JustChanged = TRUE;
HHighest = Close;
LLowest = 0;
end;
if UpWave[1] and Close < VLineUp and JustChanged == FALSE then begin
UpWave[1] = FALSE;
DnWave[1] = TRUE;
JustChanged = TRUE;
LLowest = Close;
HHighest = 0;
end;
if JustChanged == FALSE then begin
if Close > HHighest then
HHighest = Close;
else if Close < LLowest then
LLowest = Close;
end;
VLineUp = HHighest - (Var5 * MA(Var6,Var2));
VLineDn = LLowest + (Var5 * MA(Var6,Var2));
if UpWave[1] then T = 1;
else if DnWave[1] then T = -1;
end;
Input : 당일수익틱수(100);
input : StartTime(70000),EndTime(55000);
Var : N1(0),dayPl(0),당일수익(0),Xcond(false);
var : Tcond(False);
IF Endtime > starttime 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
{
Tcond = true;
Xcond = false;
N1 = NetProfit;
IF Endtime <= starttime Then
{
SetStopEndofday(0);
}
}
당일수익 = 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;
}
if Tcond == true and Xcond == False Then
{
if t == 1 and C > DayClose(1) Then
Buy();
if t == -1 and C < DayClose(1) Then
Sell();
if MarketPosition == 1 then
{
ExitLong("dbp",atlimit,EntryPrice+((당일수익-daypl)/CurrentContracts));
}
if MarketPosition == -1 then
{
ExitShort("dsp",atlimit,EntryPrice-((당일수익-daypl)/CurrentContracts));
}
}
안녕하세요
위식을 일봉에 적용결과 일봉상 신호가
매일 나오지 않고 건너뜀
수정
Date 2 추가 30분봉
일봉상 전일 종가 기준선 중심으로
Date2 양봉이고
date 1 시가가 전일종가 보다5틱이상 상승시 매수진입
Date2음봉이고
Dste1
시가가 전일종가 보다 5틱이상 하락시 매도진입.
매수후 장중에 기준선 중심으로
등락시 매수.매도 반복함.
2023-07-09
1515
글번호 170453
답변완료
현재 사용 수식에 매수 조건 추가 부탁드림니다.
기존 사용 수식
국내주식(삼성전자)
60분봉적용
매수 일봉에서 일정 하락하면 분할 매수 및 수익시 분할 청산하는 수식임
추가로 넣어야할 기능은 다음과 같습니다.
매수 조건
1.일정하락시 분할매수 ( 유지 ) --> 현재 수식 적용중
2.최초 진입한 값에서 10% 15% 20% 25% 30% 35% ..... 등등 일정 하락했을때
각각 10주씩 매수하는 수식을 첨가하고 싶습니다.
(1회성 매수 ) --> 추가로 요청하는 조건
그외 조건은 동일합니다.
수식 추가 부탁드림니다.
-------------기존 사용 수식-------------
input : 시작일(10200216);
input : 이평1(240),이평2(2880);
input : 최대투자금액(2000);
input : 수익퍼센트(8);
var : cond(False),XV(0),vol(0);
var1 = ma(C,이평1);
Var2 = ma(C,이평2);
if Data1(sDate) >= 시작일 Then
{
if
sTime == 140000 and AvgEntryPrice*CurrentContracts < 최대투자금액*10000 Then
{
if c < var1 or c < Var2 Then # 분봉 이하일때 매수 진입
{
if C <= DayClose(1)*0.98 and C > DayClose(1)*0.975 Then
Buy("b1",OnClose,Def,1);
if C <= DayClose(1)*0.975 and C > DayClose(1)*0.970 Then
Buy("b2",OnClose,Def,2);
if C <= DayClose(1)*0.970 and C > DayClose(1)*0.965 Then
Buy("b3",OnClose,Def,3);
if C <= DayClose(1)*0.965 and C > DayClose(1)*0.960 Then
Buy("b4",OnClose,Def,4);
if C <= DayClose(1)*0.960 and C > DayClose(1)*0.955 Then
Buy("b5",OnClose,Def,5);
if C <= DayClose(1)*0.955 and C > DayClose(1)*0.95 Then
Buy("b6",OnClose,Def,6);
if C <= DayClose(1)*0.95 and C > DayClose(1)*0.945 Then
Buy("b7",OnClose,Def,7);
if C <= DayClose(1)*0.945 and C > DayClose(1)*0.94 Then
Buy("b8",OnClose,Def,8);
if C <= DayClose(1)*0.94 Then
Buy("b9",OnClose,Def,9);
}
}
}
if MarketPosition == 1 Then
{
if CurrentContracts > CurrentContracts[1] Then
{
XV = CurrentContracts;
cond = False;
}
if C >= AvgEntryPrice*(1+수익퍼센트*0.01) and sTime == 140000 and c > var1 and c > var2 Then
{
if XV >= 100 Then
vol = Floor(XV*0.01); # 계약수가 100개 이상일때 1% 분할매도
else if XV < 100 and XV >= 50 Then
vol = Floor(XV*0.02); # 계약수가 50개~100 일때 2% 분할매도
else if XV < 50 and XV >= 20 Then
vol = Floor(XV*0.05); # 계약수가 20개~50 일때 5% 분할매도
else if XV < 20 and XV >= 10 Then
vol = Floor(XV*0.10); # 계약수가 10개~20 일때 10% 분할매도
Else
vol = Floor(XV*0.50); # 계약수가 10개이하 일때 50% 분할매도
ExitLong("bx",OnClose,Def,"",vol,2);
}
}
Else
cond = False;
2023-07-09
982
글번호 170452
답변완료
부탁드립니다.
적용가능하도록 부탁 드립니다.
indicator('Laguerre RSI', shorttitle='LaRSI', overlay=false, timeframe = "")
src = input(title='Source', defval=close)
alpha = input.float(title='Alpha', minval=0, maxval=1, step=0.1, defval=0.2)
colorchange = input(title='Change Color ?', defval=false)
gamma = 1 - alpha
L0 = 0.0
L0 := (1 - gamma) * src + gamma * nz(L0[1])
L1 = 0.0
L1 := -gamma * L0 + nz(L0[1]) + gamma * nz(L1[1])
L2 = 0.0
L2 := -gamma * L1 + nz(L1[1]) + gamma * nz(L2[1])
L3 = 0.0
L3 := -gamma * L2 + nz(L2[1]) + gamma * nz(L3[1])
cu = (L0 > L1 ? L0 - L1 : 0) + (L1 > L2 ? L1 - L2 : 0) + (L2 > L3 ? L2 - L3 : 0)
cd = (L0 < L1 ? L1 - L0 : 0) + (L1 < L2 ? L2 - L1 : 0) + (L2 < L3 ? L3 - L2 : 0)
temp = cu + cd == 0 ? -1 : cu + cd
LaRSI = temp == -1 ? 0 : cu / temp
Color = colorchange ? LaRSI > LaRSI[1] ? color.green : color.red : color.blue
plot(100 * LaRSI, title='LaRSI', linewidth=2, color=Color, transp=0)
plot(20, linewidth=1, color=color.new(color.maroon, 0))
plot(80, linewidth=1, color=color.new(color.maroon, 0))
alertcondition(ta.crossover(100 * LaRSI, 20), title='LaRSI Crossover Alarm', message='Laguerre RSI crosses OVER 20 - BUY SIGNAL!')
alertcondition(ta.crossunder(100 * LaRSI, 80), title='Price Crossunder Alarm', message='Laguerre RSI crosses UNDER 80 - SELL SIGNAL!')
2023-07-09
976
글번호 170451
답변완료
부탁드립니다.
적용가능하도록 부탁드립니다.
indicator("SuperTrend+", overlay = true, format=format.price, precision=2)
import Electrified/SupportResitanceAndTrend/4 as SRT
ATR = "Average True Range", CONFIRM = "Confirmation", DISPLAY = "Display"
WMA = "WMA", EMA = "EMA", SMA = "SMA", VWMA = "VWMA", VAWMA = "VAWMA"
mode = input.string(VAWMA, "Mode", options=[SMA,EMA,WMA,VWMA,VAWMA], group=ATR, tooltip=" which averaging function will be used to determine the ATR value.")
atrPeriod = input.int(120, "Period", group=ATR, tooltip="The number of bars to use in calculating the ATR value.")
atrM = input.float(3.0, title="Multiplier", step=0.5, group=ATR, tooltip="The multiplier used when defining the super trend limits.")
maxDeviation = input.float(0, title="Max Deviation", minval=0, step=0.5, group=ATR, tooltip="The maximum deviation of the true range before being considered and outlier.₩nA value of zero (default) results in no filtering.")
closeBars = input.int(2, "Closed Bars", minval = 0, group=CONFIRM, tooltip="The number of closed bars that have to exceed the super-trend value before the trend reversal is confirmed.")
showsignals = input(false, title="Show Buy/Sell Signals ?", group=DISPLAY)
highlighting = input(true, "Highlighter On/Off ?", group=DISPLAY)
[trend, up, dn, unconfirmed, warn, reversal] =
SRT.superTrend(atrM, atrPeriod, mode, closeBars, maxDeviation)
upPlot = plot(trend==1 ? up : na, title="Up Trend", style=plot.style_linebr, linewidth=2, color=unconfirmed==0?color.green:color.yellow)
buySignal = trend == 1 and trend[1] == -1
plotshape(buySignal ? up : na, title="UpTrend Begins", location=location.absolute, style=shape.circle, size=size.tiny, color=color.green)
plotshape(buySignal and showsignals ? up : na, title="Buy", text="Buy", location=location.absolute, style=shape.labelup, size=size.tiny, color=color.green, textcolor=color.white)
dnPlot = plot(trend==1 ? na : dn, title="Down Trend", style=plot.style_linebr, linewidth=2, color=unconfirmed==0?color.red:color.yellow)
sellSignal = trend == -1 and trend[1] == 1
plotshape(sellSignal ? dn : na, title="DownTrend Begins", location=location.absolute, style=shape.circle, size=size.tiny, color=color.red)
plotshape(sellSignal and showsignals ? dn : na, title="Sell", text="Sell", location=location.absolute, style=shape.labeldown, size=size.tiny, color=color.red, textcolor=color.white)
mPlot = plot(ohlc4, title="", style=plot.style_circles, linewidth=0)
longFillColor = color.new(highlighting ? (trend == 1 ? color.green : color.white) : color.white, 75)
shortFillColor = color.new(highlighting ? (trend == -1 ? color.red : color.white) : color.white, 75)
fill(mPlot, upPlot, title="UpTrend Highligter", color=longFillColor)
fill(mPlot, dnPlot, title="DownTrend Highligter", color=shortFillColor)
alertcondition(warn or reversal,
"1) Warning", message="SuperTrend+ Warning ({{ticker}} {{interval}})")
alertcondition(reversal,
"2) Reversal", message="SuperTrend+ Reversal ({{ticker}} {{interval}})")
alertcondition(buySignal,
"3) Up (+)", message="SuperTrend+ Up (+) ({{ticker}} {{interval}})")
alertcondition(sellSignal,
"4) Down (-)", message="SuperTrend+ Down (-) ({{ticker}} {{interval}})")
2023-07-09
841
글번호 170450
답변완료
문의 드립니다.
수고가 많으십니다.
N일전 상한가 종목 수식을 따라 작성해서 실행해 봤는데 종목검색이 되질 않습니다.
3201화면 설정도 이상없고요.
답변해 주시면 감사합겠습니다.
input : N(1);
var : 상한가(0), UpLimit(0);
var : up1(0), up2(0), up3(0), up4(0), up5(0),up6(0),Up7(0);
if date >= 19981207 then {
if date < 20050328 && CodeCategory() == 2 then
UpLimit = (BP[0] * 1.12);
Else if date >= 20050328 and date < 20150615 Then
UpLimit = (BP[0] * 1.15);
Else
UpLimit = (BP[0] * 1.30);
if CodeCategory() == 2 then {
if date >= 20030721 then {
up1 = int(UpLimit/100+0.00001)*100;
up2 = int(UpLimit/100+0.00001)*100;
up3 = int(UpLimit/100+0.00001)*100;
up4 = int(UpLimit/50+0.00001)*50;
up5 = int(UpLimit/10+0.00001)*10;
up6 = int(UpLimit/5+0.00001)*5;
up7 = int(UpLimit/1+0.00001)*1;
}
else {
up1 = int(UpLimit/1000+0.00001)*1000;
up2 = int(UpLimit/500+0.00001)*500;
up3 = int(UpLimit/100+0.00001)*100;
up4 = int(UpLimit/50+0.00001)*50;
up5 = int(UpLimit/10+0.00001)*10;
up6 = int(UpLimit/10+0.00001)*10;
up7 = int(UpLimit/1+0.00001)*1;
}
}
Else {
up1 = int(UpLimit/1000+0.00001)*1000;
up2 = int(UpLimit/500+0.00001)*500;
up3 = int(UpLimit/100+0.00001)*100;
up4 = int(UpLimit/50+0.00001)*50;
up5 = int(UpLimit/10+0.00001)*10;
up6 = int(UpLimit/5+0.00001)*5;
up7 = int(UpLimit/1+0.00001)*1;
}
if CodeCategory() == 1 || CodeCategory() == 2 then {
if sdate < 20101004 Then{
If BP >= 500000 Then
상한가 = up1;
Else If BP >= 100000 Then
상한가 = iff(up2>=500000, up1, up2);
Else If BP >= 50000 Then
상한가 = iff(up3>=100000, up2, up3);
Else If BP >= 10000 Then
상한가 = iff(up4>=50000, up3, up4);
Else If BP >= 5000 Then
상한가 = iff(up5>=10000, up4, up5);
Else If BP >= 1000 Then
상한가 = iff(up5>=5000, up5, up6);
Else
상한가 = iff(up6>=1000, up6, up6);
}
Else{
If BP >= 500000 Then
상한가 = up1;
Else If BP >= 100000 Then
상한가 = iff(up2>=500000, up1, up2);
Else If BP >= 50000 Then
상한가 = iff(up3>=100000, up2, up3);
Else If BP >= 10000 Then
상한가 = iff(up4>=50000, up3, up4);
Else If BP >= 5000 Then
상한가 = iff(up5>=10000, up4, up5);
Else If BP >= 1000 Then
상한가 = iff(up5>=5000, up5, up6);
Else
상한가 = iff(up6>=1000, up6, up7);
}
}
else if CodeCategory() == 8 || CodeCategory() == 9 then { // ETF
상한가 = up6;
}
}
if H[N] >= 상한가[N] Then
find(1);
2023-07-09
1176
글번호 170449