커뮤니티
예스랭귀지 Q&A
답변완료
[공지] 예스랭귀지 AI 어시스턴트, '예스나 AI' 출시 및 무료 체험 안내
안녕하세요, 예스스탁 입니다.복잡한 수식 공부 없이 여러분의 아이디어를 말하면 시스템 트레이딩 언어 예스랭귀지로 작성해주는 서비스예스나 AI(YesNa AI)가 출시되었습니다.지금 예스나 AI를 직접 경험해 보실 수 있도록 20크레딧(질문권 20회)를 무료로 증정해 드리고 있습니다.바로 여러분의 아이디어를 코드로 변환해보세요.--------------------------------------------------🚀 YesNa AI 핵심 기능- 지표식/전략식/종목검색식 생성: 자연어로 요청하면 예스랭귀지 문법에 맞는 코드를 작성합니다.- 종목검색식 변환 지원: K증권의 종목 검색식을 예스랭귀지로 변환 지원합니다.- 컴파일 검증: 작성된 코드가 실행 가능한지 컴파일러를 통해 문법 검증을 거쳐 결과물을 제공합니다.상세한 서비스 개요 및 활용 방법은 [서비스 소개 페이지]에서 확인하실 수 있습니다.▶ 서비스 소개 페이지: 바로가기서비스 사용 유의사항 및 결제 환불정책은 [이용약관]을 참고 부탁드립니다.▶ 서비스 이용약관: 바로가기💬 이용 문의사용 중 문의사항은 [프로그램 사용법 Q&A] 게시판에서 [예스나 AI] 카테고리를 설정 후 문의해 주시면 상세히 안내해 드리겠습니다.--------------------------------------------------앞으로도 AI를 활용한 다양한 트레이딩 기능들을 지속적으로 선보일 예정입니다.많은 관심과 기대 부탁드립니다.
2026-02-27
3515
글번호 230811
답변완료
시작시간 문의
늘 감사합니다.
아래 수식이 안되네요 . 검토좀 해주세요.
input : 시작시간(090000),ntime(30);
var : S1(0),D1(0),TM(0),TF(0),TL(0);
if data1((sDate != sDate[1] and sTime >= 시작시간) or
(sDate == sDate and sTime >= 시작시간 and sTime[1] < 시작시간)) Then
{
S1 = data1(TimeToMinutes(시작시간));
D1 = data1(sdate);
}
if D1 > 0 then
{
if data1(sdate) == D1 Then
TM = data1(TimeToMinutes(stime))-S1;
Else
TM = data1(TimeToMinutes(stime))+1440-S1;
TF = TM%ntime;
if Bdate != Bdate[1] or
(Bdate == Bdate[1] and ntime > 1 and TF < TF[1]) or
(Bdate == Bdate[1] and ntime > 1 and TM >= TM[1]+ntime) or
(Bdate == Bdate[1] and ntime == 1 and TM > TM[1]) Then
{
TL = TL_New_Self(sDate,sTime,-999999999,sDate,sTime,999999999);
TL_SetColor(TL,Black);
TL_SetSize(TL,0);
}
}
Plot1(data1(HighD(0)), "고가",Red);
Plot2(data1(lowD(0)), "저가",Blue);
Plot3(data1(OpenD(0)), "시가");
Plot4(data1(CloseD(0)), "현재");
감사합니다.
2025-05-22
276
글번호 191097
회원 님에 의해서 삭제되었습니다.
2025-05-22
12
글번호 191095
답변완료
지표 변환 부탁드립니다.
//@version=6
indicator(title="Price Oscillator", shorttitle="PPO", format=format.price, precision=2, timeframe="", timeframe_gaps=true)
shortlen = input.int(12, "Short Length", minval=1)
longlen = input.int(26, "Long Length", minval=1)
signallen = input.int(9, "Signal Length", minval=1)
src = input.source(close, title="Source")
exp = input.bool(true, "Use exponential MA")
esma(source, length)=>
s = ta.sma(source, length)
e = ta.ema(source, length)
exp ? e : s
short = esma(src, shortlen)
long = esma(src, longlen)
po = (short - long) / long * 100
sl = esma(po, signallen)
hist = po - sl
plot(hist, title = "Histogram", style = plot.style_columns, color = (hist >= 0 ? (hist[1] < hist ? #26A69A : #B2DFDB) : (hist[1] < hist ? #FFCDD2 : #FF5252)))
plot(po, color=color.teal, title="PPO")
plot(sl, color=color.orange, title="Signal Line")
hline(0, "Zero Line", color=#787B86)
2025-05-22
313
글번호 191093
답변완료
다시 문의드립니다.
문의드린 이전 수식변환에서 아래와 같이 답을 주셨습니다.
1분봉 차트에, 같은 기간(50)과 승수(5)를 적용해서 트레이딩뷰와 비교했더니
첨부된 그림처럼 다르게 나옵니다.
heikinashi supertrend 라기보다 그냥 supertrend 처럼 구현됩니다.
왜 다르게 나오는지
번거로우시겠지만 다시한번 검토부탁드립니다.
그리고 녹색선과 빨강선의 바뀌는 부분을 연결부탁드립니다.
감사합니다.
=========================
안녕하세요
예스스탁입니다.
input : upertrendAtrPeriod(10);
input : supertrendAtrMultiplier(2.7);
var : haClose(0),haOpen(0),haHigh(0),haLow(0),haTR(0),alpha(0),haTrueRange(0);
var : haSupertrendUp(0),haSupertrendDown(0),trendingUp(Nan),trendingDown(Nan);
var : direction(0),supertrend(0),supertrendUp(False),supertrendDown(False);
if index == 0 then
{
haClose = (O+H+L+C)/4;
haOpen = open;
haHigh = MaxList( high, haOpen, haClose);
haLow = MinList( low, haOpen,haClose);
}
else
{
haClose = (O+H+L+C)/4;
haOpen = (haOpen [1] + haClose [1])/2 ;
haHigh = MaxList(High, haOpen, haClose) ;
haLow = MinList(Low, haOpen, haClose) ;
}
haTR = iff(IsNan(haOpen[1]) == true, haOpen-haLow, max(max(haOpen - haLow, abs(haOpen - haClose[1])), abs(haLow - haClose[1])));
alpha = 1 / upertrendAtrPeriod ;
haTrueRange = IFf(IsNan(haTrueRange[1]) == true, ma(haTR,upertrendAtrPeriod) , alpha * haTR + (1 - alpha) * IFf(isnan(haTrueRange[1])==true,0,haTrueRange[1]));
haSupertrendUp =((haHigh +haLow )/2 )-(supertrendAtrMultiplier *haTrueRange );
haSupertrendDown =((haHigh +haLow )/2 )+(supertrendAtrMultiplier *haTrueRange );
direction = 0;
trendingUp = iff(haClose[1]>trendingUp[1] , max (haSupertrendUp ,trendingUp[1]) , haSupertrendUp);
trendingDown = iff(haClose[1]<trendingDown[1] , min (haSupertrendDown ,trendingDown[1]) , haSupertrendDown);
direction = iff(haClose > trendingDown[1] , 1 , iff(haClose < trendingUp[1], -1 , IFf(IsNan(direction[1]) == true,1,direction[1])));
supertrend = iff(direction == 1 , trendingUp , trendingDown);
if direction == 1 Then
{
plot1(supertrend,"supertrendUp", Green);
NoPlot(2);
}
Else
{
plot2(supertrend,"supertrendDow", Red);
NoPlot(1);
}
=========================
2025-05-22
352
글번호 191084
사공하늘 님에 의해서 삭제되었습니다.
2025-05-22
82
글번호 191083
답변완료
문의드립니다,
수고많으십니다.
아래수식중 증액을할때 진입할때마다라고 했는데 시스템에서 정한기준안에서
예를들면 시스템진입식에 10번진입 실제진입5번일때 실제진입한것만
증액으로 진입식부탁드립니다.
1.
inputs : P1(5),P2(20),RSILength(10), OverSold(30),OverBought(70);
input : 첫진입금액(1000000),A(10);
var : m1(0,Data2),m2(0,Data2), R(0,Data1);
var : TT(0,Data1),T1(0,Data1),entry(0,Data1),mm(0,data1),vol(0,Data1);
m1 = Data2(ma(C,P1));
m2 = Data2(ma(C,P2));
R = data1(RSI(RSILength));
If Data2(m1 > m2) and Crossup(R, OverSold) Then
{
if TotalTrades == 0 Then
mm = 첫진입금액;
Else
mm = mm*(1+A/100);
Buy("B",OnClose,Def,Floor(Floor(mm/C)/10)*10);
}
if Data2(CrossDown(m1,m2)) or Crossup(R, OverBought) Then
Sell("S");
2
inputs : P1(5),P2(20),RSILength(10), OverSold(30),OverBought(70);
input : 첫진입금액(1000000),A(10),B(20);
var : m1(0,Data2),m2(0,Data2), R(0,Data1),LP(0,Data1);
var : TT(0,Data1),T1(0,Data1),entry(0,Data1),mm(0,data1),vol(0,Data1);
m1 = Data2(ma(C,P1));
m2 = Data2(ma(C,P2));
R = data1(RSI(RSILength));
if MarketPosition == 1 Then
LP = LatestEntryPrice(0);
Else
LP = LatestEntryPrice(1);
If Data2(m1 > m2) and Crossup(R, OverSold) Then
{
if TotalTrades == 0 Then
mm = 첫진입금액;
Else
{
if LP > C Then
mm = mm*(1+B/100);
Else
mm = mm*(1+A/100);
}
Buy("B",OnClose,Def,Floor(Floor(mm/C)/10)*10);
}
if Data2(CrossDown(m1,m2)) or Crossup(R, OverBought) Then
Sell("S");
2025-05-22
250
글번호 191081
답변완료
문의 드립니다.
아래 식에서 기준가 2.50을 첫 돌파 후 5번째에 매수 진입하도록 가능할까요?
그리고 익절은 직접 입력할 수 있도록 추가해 주시면 감사하겠습니다.
부탁드립니다.
input : Price(2.50);
if crossup(C,price) Then
buy();
if CrossDown(C,price) Then
ExitLong();
2025-05-22
294
글번호 191077
답변완료
문의 드립니다.
안녕하세요 항상 감사드립니다.
아래의 서식에서 추가적인 서식을 부탁드립니다.
*추가사항
1.연결선물 기준 5분봉에서 이평선 50일선 아래 위치시 매도만 진입, 50일선 위에 위치시 매수 만 진입
(50일선은 최적화를 할 수 있게 input으로 넣어주시기 바랍니다.)
# KOSPI 선물 5분봉
input: tt(150000),당일진입횟수(3);
var: chkP(10), reChkP(20), stopChk(25);
var: HH(0), LL(0), BS(0), SS(0);
var: dayChk(0);
var : TotalCount(0),PreDay(0),DayEntry(0);
TotalCount = TotalTrades;
if Bdate != Bdate[1] Then
PreDay = TotalCount[1];
DayEntry = (TotalCount-PreDay)+IFF(MarketPosition != 0,1,0);
if BarIndex == 0 then ClearDebug();
if dayindex == chkP then
{
HH = Highest(Max(C,O), chkP+1);
LL = Lowest(Min(C,O), chkP+1);
#if date == 20240612 then messageLog("--HH %.2f, LL: %.2f", HH, LL);
}
#if High >= HH and MarketPosition == 0 and ExitDate(1) < Date and time > 93000 then messageLog("HH %.2f, High: %.2f", HH, High);
if DayIndex >= chkP
# and Time < 95000
and sDate == NextBarSdate
and EntryDate(0) < Date
and EntryDate(1) < Date
and DayEntry < 당일진입횟수
Then {
Buy("B1", AtStop, HH);
Sell("S1", AtStop, LL);
}
//if dayChk == 0 and High >= HH and MarketPosition == 0 and ExitDate(1) < Date and time > 93000 then {
// messageLog("HH %.2f, High: %.2f", HH, High);
// dayChk = 1;
//}
if ExitDate(1) == Date
and Time < 150000
// and LatestEntryName(1) != "B2"
// and LatestEntryName(1) != "S2"
// and LatestEntryName(0) != "B2"
// and LatestEntryName(0) != "S2"
Then
{
if DayIndex < reChkP Then
{
HH = Highest(Max(C,O), DayIndex+1);
LL = Lowest(Min(C,O), DayIndex+1);
}
Else
{
HH = Highest(Max(C,O), reChkP);
LL = Lowest(Min(C,O), reChkP);
}
if DayEntry < 당일진입횟수 Then
{
Buy("B2", AtStop, HH);
Sell("S2", AtStop, LL);
}
}
if (MarketPosition == 1) Then {
if DayIndex < stopChk Then {
BS = Lowest(Min(C,O), DayIndex+1);
}
Else {
BS = Lowest(Min(C,O), stopChk);
}
ExitLong("EL", AtStop, BS);
}
if (MarketPosition == -1) Then {
if DayIndex < stopChk Then {
SS = Highest(Max(C,O), DayIndex+1);
}
Else {
SS = Highest(Max(C,O), stopChk);
}
#messageLog(" SS %.2f", SS);
ExitShort("ES", AtStop, SS);
}
var : month(0),nday(0),week(0),X(False);
month = int(date/100)-int(date/10000)*100;
nday = date - int(date/100)*100;
Week = DayOfWeek(date);
#만기일
if (month%3 == 0 and nday >= 8 and nday <= 14 and week == 4) then
{
X = true;
SetStopEndofday(151500);
}
Else#만기일아닐때
{
X = False;
SetStopEndofday(152000);
}
2025-05-22
350
글번호 191074
답변완료
문의드립니다.
시스템을 복리계산하기 위해서 ㅇ
초기자본을 100,000$ 설정하고
수익금이 30,000$이 싸일때마다 1계약씩 늘어나게 하는 수식이 가능할까요?
최대 계약수는 10계약으로...
가능하면 위 3개를 변수로 지정해서 부탁드리겠습니다
2025-05-22
239
글번호 191072