커뮤니티
예스랭귀지 Q&A
답변완료
[공지] 예스랭귀지 AI 어시스턴트, '예스나 AI' 출시 및 무료 체험 안내
안녕하세요, 예스스탁 입니다.복잡한 수식 공부 없이 여러분의 아이디어를 말하면 시스템 트레이딩 언어 예스랭귀지로 작성해주는 서비스예스나 AI(YesNa AI)가 출시되었습니다.지금 예스나 AI를 직접 경험해 보실 수 있도록 20크레딧(질문권 20회)를 무료로 증정해 드리고 있습니다.바로 여러분의 아이디어를 코드로 변환해보세요.--------------------------------------------------🚀 YesNa AI 핵심 기능- 지표식/전략식/종목검색식 생성: 자연어로 요청하면 예스랭귀지 문법에 맞는 코드를 작성합니다.- 종목검색식 변환 지원: K증권의 종목 검색식을 예스랭귀지로 변환 지원합니다.- 컴파일 검증: 작성된 코드가 실행 가능한지 컴파일러를 통해 문법 검증을 거쳐 결과물을 제공합니다.상세한 서비스 개요 및 활용 방법은 [서비스 소개 페이지]에서 확인하실 수 있습니다.▶ 서비스 소개 페이지: 바로가기서비스 사용 유의사항 및 결제 환불정책은 [이용약관]을 참고 부탁드립니다.▶ 서비스 이용약관: 바로가기💬 이용 문의사용 중 문의사항은 [프로그램 사용법 Q&A] 게시판에서 [예스나 AI] 카테고리를 설정 후 문의해 주시면 상세히 안내해 드리겠습니다.--------------------------------------------------앞으로도 AI를 활용한 다양한 트레이딩 기능들을 지속적으로 선보일 예정입니다.많은 관심과 기대 부탁드립니다.
2026-02-27
1536
글번호 230811
답변완료
코딩 해결 부탁드립니다!
담당자님 안녕하세요! 예스트레이더 슈퍼트렌드랑 12,26ema 교차를 합치고 싶습니다
롱 진입: 12,26 ema가 골든크로스 나면서 슈퍼트렌드도 롱 신호가 나올때
롱 청산: 12,26 ema가 데드크로스 나면서 슈퍼트렌드도 숏 신호가 나왔을때
숏 진입: 12,26 ema가 데드크로스 나면서 슈퍼트렌드도 숏 신호가 나올때
숏 청산: 12,26 ema가 골든크로스 나면서 슈퍼트렌드도 롱 신호가 나올때
감사합니다.
Inputs:
factor (3), // SuperTrend ATR 배수
AtrPeriod (10), // SuperTrend ATR 기간
shortLen (12), // EMA 단기 기간
longLen (26); // EMA 장기 기간
Vars:
// SuperTrend용
src (0),
trv (0),
atrv (0),
upperBand (0),
lowerBand (0),
prevUB (0),
prevLB (0),
dir (0),
// EMA용
emaShort (0),
emaLong (0),
// 실제 SuperTrend 신호
supertrend (0);
// === 1) SuperTrend 계산 ===
If CurrentBar > 1 Then
Begin
// ATR 계산
src = (High + Low) / 2;
trv = MaxList( High - Low,
MaxList( Abs(High - Close[1]),
Abs(Low - Close[1]) ) );
atrv = EMA(trv, AtrPeriod);
// 밴드 산출
upperBand = src + factor * atrv;
lowerBand = src - factor * atrv;
prevUB = upperBand[1];
prevLB = lowerBand[1];
// 밴드 스무딩
If (lowerBand <= prevLB) And (Close[1] >= prevLB) Then
lowerBand = prevLB;
If (upperBand >= prevUB) And (Close[1] <= prevUB) Then
upperBand = prevUB;
// 추세 방향 판정
If Close > upperBand Then
dir = 1
ElseIf Close < lowerBand Then
dir = -1;
// supertrend 값 결정
If dir = 1 Then
supertrend = lowerBand
Else
supertrend = upperBand;
End;
// === 2) EMA 계산 ===
emaShort = EMA(Close, shortLen);
emaLong = EMA(Close, longLen);
// === 3) 롱/숏 진입·청산 ===
// 롱 진입: EMA 골든크로스 + price > supertrend
If MarketPosition = 0
And CrossUp(emaShort, emaLong)
And CrossUp(Close, supertrend)
Then
Buy("LongEntry");
// 롱 청산: EMA 데드크로스 + price < supertrend
If MarketPosition > 0
And CrossDown(emaShort, emaLong)
And CrossDown(Close, supertrend)
Then
ExitLong("LongExit");
// 숏 진입: EMA 데드크로스 + price < supertrend
If MarketPosition = 0
And CrossDown(emaShort, emaLong)
And CrossDown(Close, supertrend)
Then
SellShort("ShortEntry");
// 숏 청산: EMA 골든크로스 + price > supertrend
If MarketPosition < 0
And CrossUp(emaShort, emaLong)
And CrossUp(Close, supertrend)
Then
ExitShort("ShortExit");
2025-07-19
284
글번호 192601
답변완료
수식 문의 드립니다.
예스 스탁_질의(250719)
안녕하세요.
수식 문의 드립니다.
켈트너 Band
켈트너 상한선
TR = max(abs(H-L), abs(H-C(1)), abs(L-C(1)));
eavg(C, Period) + eavg(TR, PeriodTR)*D1
.하한선
TR = max(abs(H-L), abs(H-C(1)), abs(L-C(1)));
eavg(C, Period) - eavg(TR, PeriodTR) * D1
중심선
eavg(C, Period)
Period = 20
D1 = 2.0
PeriodTR = 10
----------------------------------------
1. 상단 이탈 하는선
2. 하단 돌파 하는선
==========================
부탁드립니다.
감사 합니다
2025-07-19
245
글번호 192600
답변완료
시스템식 부탁합니다
당일 첫봉이 양봉이고, 당일 고가에서 하락하여 당일 (고가의 1/2+0.3틱)에 도달(atlimit)
하면 매수
2025-07-19
194
글번호 192599
답변완료
수식 문의 드립니다.
안녕하세요.
수식 문의 드립니다.
A. 상단_(가중)선택적_그물망
1.
M = ma(C, 기간, 종류);
if(중심 < M, M, 중심)
기간 = 1
중심 = ma(C, 20)
종류 = 가중
2
M = ma(C, 기간+1, 종류);
if(중심 < M, M, 중심)
3
M = ma(C, 기간+2, 종류);
if(중심 < M, M, 중심)
4.
M = ma(C, 기간+3, 종류);
if(중심 < M, M, 중심)
5
M = ma(C, 기간+4, 종류);
if(중심 < M, M, 중심)
--------------------------------------------
B_. 하단__(가중)선택적_그물망
1.
M = ma(C, 기간, 종류);
if(중심 > M, M, 중심)
기간 = 1
중심 = ma(C, 20)
종류 = 가중
2
M = ma(C, 기간+1, 종류);
if(중심 > M, M, 중심)
3
M = ma(C, 기간+2, 종류);
if(중심 > M, M, 중심)
4.
M = ma(C, 기간+3, 종류);
if(중심 > M, M, 중심)
5
M = ma(C, 기간+4, 종류);
if(중심 > M, M, 중심)
--------------------------------------------
C_. 5 가중이평+ 20 가중이평-G/C
1. ma(C, 기간1, 종류) // 가중
2. ma(C, 기간2, 종류) // 가중
3. G/C
A = MA(C, 기간1, 종류);
B = MA(C, 기간2, 종류);
조건 = CrossUp(A, B) or CrossDown(A, B);
S = Valuewhen(1, 조건, 위치); // 위치=B
----------------------------------------
D. 강조+20 가중이평
1
M = ma(C, 기간, 종류);
2.강조
M(두께) // 두께 = 2
==========================
부탁드립니다.
감사 합니다
2025-07-19
292
글번호 192598
s1017051 님에 의해서 삭제되었습니다.
2025-07-19
1
글번호 192597
답변완료
변환 부탁드립니다
다음의 pine editor용 코드를
1. supertrend 함수
2. kalman Filter 함수
3. 이 함수들을 사용한 지표로 변환 부탁 드립니다. 감사합니다.
(색깔은 Green, Red, Gray로만 표시하고 입력 변수 설명 등 불요)
//@version=6
indicator("Range Filtered Trend Signals [AlgoAlpha]", "AlgoAlpha - Range Filtered", true)
groupKalman = "Kalman Filter"
kalmanAlpha = input.float(0.01, title="Kalman Alpha", tooltip="The Alpha parameter controls the smoothing factor of the Kalman filter. A smaller value results in more smoothing, while a larger value makes the filter more responsive to price changes.", group=groupKalman)
kalmanBeta = input.float(0.1, title="Kalman Beta", tooltip="The Beta parameter influences the rate of change in the Kalman filter. It adjusts the filter's sensitivity to trend changes.", group=groupKalman)
kalmanPeriod = input.int(77, title="Kalman Period", tooltip="The Period defines the number of bars used in the Kalman filter calculation, affecting the filter's responsiveness to market movements.", group=groupKalman)
dev = input.float(1.2, title="Deviation", tooltip="The Deviation parameter sets the multiplier for the deviation from the trend line, affecting the width of the trend band.", group=groupKalman)
groupSupertrend = "Supertrend"
supertrendFactor = input.float(0.7, title="Supertrend Factor", tooltip="This Factor determines the multiplier for the ATR in the Supertrend calculation, affecting the distance of the trend line from the price.", group=groupSupertrend)
supertrendAtrPeriod = input.int(7, title="ATR Period", tooltip="The ATR Period specifies the number of bars used to calculate the Average True Range, which is a component of the Supertrend indicator.", group=groupSupertrend)
groupColors = "Colors"
green = input.color(#00ffbb, title="Bullish Color", tooltip="This color is used to indicate a bullish trend in the chart.", group=groupColors)
red = input.color(#ff1100, title="Bearish Color", tooltip="This color is used to indicate a bearish trend in the chart.", group=groupColors)
kalman(a, b, alpha, beta) =>
var float v1 = na
var float v2 = 1.0
var float v3 = alpha * b
var float v4 = 0.0
var float v5 = na
if na(v1)
v1 := a[1]
v5 := v1
v4 := v2 / (v2 + v3)
v1 := v5 + v4 * (a - v5)
v2 := (1 - v4) * v2 + beta / b
v1
pine_supertrend(k, factor, atrPeriod) =>
src = k
atr = ta.atr(atrPeriod)
upperBand = src + factor * atr
lowerBand = src - factor * atr
prevLowerBand = nz(lowerBand[1])
prevUpperBand = nz(upperBand[1])
lowerBand := lowerBand > prevLowerBand or k[1] < prevLowerBand ? lowerBand : prevLowerBand
upperBand := upperBand < prevUpperBand or k[1] > prevUpperBand ? upperBand : prevUpperBand
int _direction = na
float superTrend = na
prevSuperTrend = superTrend[1]
if na(atr[1])
_direction := 1
else if prevSuperTrend == prevUpperBand
_direction := k > upperBand ? -1 : 1
else
_direction := k < lowerBand ? 1 : -1
superTrend := _direction == -1 ? lowerBand : upperBand
[superTrend, _direction]
k = kalman(close, kalmanPeriod, kalmanAlpha, kalmanBeta)
[supertrend, direction] = pine_supertrend(k, supertrendFactor, supertrendAtrPeriod)
vola = ta.wma(high-low, 200)
upper = k+vola*dev
lower = k-vola*dev
midbody = math.avg(close, open)
var trend = 0
if close > upper
trend := 1
else if close < lower
trend := -1
ktrend = 0
if direction < 0
ktrend := 1
else if direction > 0
ktrend := -1
t = 70
t_ = 20
p1 = plot(ktrend * trend == 1 ? k : na, color=color.gray, style = plot.style_linebr, linewidth = 3)
m = plot(midbody, color=color.gray, display = display.none)
up = plot(trend == -1 or ktrend * trend == -1 ? upper : na, color=ktrend * trend == -1 ? color.gray : ktrend == -1 ? color.new(red, t) : color.gray, style = plot.style_circles)
lo = plot(trend == 1 or ktrend * trend == -1 ? lower : na, color=ktrend * trend == -1 ? color.gray : ktrend == 1 ? color.new(green, t) : color.gray, style = plot.style_circles)
2025-07-19
454
글번호 192596
답변완료
여러 이평선중 3개이상 돌파 종목
안녕하세요.
5,10,20,60,120 이평 중 3개 이평을 종가가 아래와 같이 동시 돌파하는 종목 검색
1. 특정 이평이나 순서에 관계없이 종가가 3개 이평 동시돌파하는 종목 검색식
2. 특정 이평을 골라서 예컨대 5,20,120 3개 이평을 순서에 관계없이 돌파하는 종목 검색식
3. 특정 이평을 골라서 예컨대 120, 5, 20 이평순으로 돌파하는 종목 검색식을
부탁드립니다.
항상 감사드리며 건강과 행복을 기원합니다.
2025-07-18
289
글번호 192595
목마와숙녀 님에 의해서 삭제되었습니다.
2025-07-18
0
글번호 192588
답변완료
문의
아래 답변 수식을 검토했더니
요청대로 b1 익절 이후 b2 진입은 막았으나,
익절이 발생하지 않은 경우의 b2 진입도 막는 결과가 발생하였습니다
(b1 익절이 없는 경우, b2 진입이 20번 발생했다면 답변수식으로는 10번 정도 진입함)
다시 부탁드립니다.
항상 고맙습니다.
***************************************************************************************
안녕하세요
예스스탁입니다.
Input : 최대(99999),최소(0),거래횟수(2);
input : lock1(103000),b1(9),진입눌림1(4),진입돌파1(2);
input : lock2(113000),b2(18),진입눌림2(3),진입돌파2(1);
input : als(50),atr1(0),atr2(32),agl(128);
input : bls(38),btr1(0),btr2(90),bgl(108);
var : T1(0,data1),entry(0,data1);
var : LL(0,data2),EH(0,data2),E1(0,data2),H1(0,data2);
var : i1(0,data2),S1(0,data2),L1(0,data2);
var : DH2(0,data2),DL2(0,data2);
var : Trade(true,Data1);
if data1(Bdate != Bdate[1]) Then
{
T1 = TotalTrades;
E1 = 0;
DH2 = data2(H);
DL2 = data2(L);
Trade = true;
}
if data2(H > DH2) Then
DH2 = data2(H);
if data2(L < DL2) Then
DL2 = data2(L);
if MarketPosition == 0 Then
entry = TotalTrades-T1;
Else
entry = (TotalTrades-T1)+1;
if TotalTrades > TotalTrades[1] and
IsEntryName("b1",1) == true and
IsExitName("StopProfitTarget",1) == true Then
Trade = False;
if MarketPosition == 0 and entry == 0 Then
{
if data2(E1 == 0 and C >= DL2+PriceScale*B1) Then
{
E1 = 1;
H1 = data2(H);
i1 = data2(index);
}
if data2(E1 == 1 and index > i1) then
{
if data2(H > H1) Then
H1 = data2(H);
if data2(L <= H1-PriceScale*진입눌림1) Then
{
E1 = 2;
i1 = data2(index);
S1 = H1;
}
}
if stime<lock1 and 최대 >= C and C >= 최소 and data2(E1 == 2 and index > i1 and C >= S1+PriceScale*진입돌파1) and Trade == true Then
{
buy("b1");
}
}
if TotalTrades > TotalTrades[1] Then
LL = data2(L);
if data2(L < LL) Then
LL = data2(L);
if MarketPosition == 0 and entry >= 1 and entry < 거래횟수 Then
{
if data2(E1 == 0 and C >= LL+PriceScale*B2 and C[1] < LL+PriceScale*B2) Then
{
E1 = 1;
H1 = data2(H);
i1 = data2(index);
}
if data2(E1 == 1 and index > i1) then
{
if data2(H > H1) Then
H1 = data2(H);
if data2(L <= H1-PriceScale*진입눌림2) Then
{
E1 = 2;
i1 = data2(index);
S1 = H1;
}
}
if stime<lock2 and data2(E1 == 2 and index > i1 and C >= S1+PriceScale*진입돌파2) and Trade == true Then
{
buy("b2");
}
}
if MarketPosition== 1 Then
{
if IsEntryName("b1") == true Then
{
SetStopLoss(PriceScale*als,PointStop);
SetStopTrailing(PriceScale*atr2,PriceScale*atr1,PointStop,1);
SetStopProfittarget(PriceScale*agl,PointStop);
}
Else if IsEntryName("b2") == true Then
{
SetStopLoss(PriceScale*bls,PointStop);
SetStopTrailing(PriceScale*btr2,PriceScale*btr1,PointStop,1);
SetStopProfittarget(PriceScale*bgl,PointStop);
}
Else
{
SetStopLoss(0);
SetStopTrailing(0,0);
SetStopProfittarget(0);
}
}
즐거운 하루되세요
> 목마와숙녀 님이 쓴 글입니다.
> 제목 : 문의
> 아래 수식은
국내 데이트레이딩
하루 2회 거래하는 수식입니다.
첫번째 진입(b1)에서 익절로 포지션을 청산했을 경우
거래를 중지하는 수식을 추가해주십시요.
b1 익절 이후 b2 진입은 성공율이 낮기 때문입니다.
항상 고맙습니다.
**************************************************************************************
Input : 최대(99999),최소(0),거래횟수(2);
input : lock1(103000),b1(9),진입눌림1(4),진입돌파1(2);
input : lock2(113000),b2(18),진입눌림2(3),진입돌파2(1);
input : als(50),atr1(0),atr2(32),agl(128);
input : bls(38),btr1(0),btr2(90),bgl(108);
var : T1(0,data1),entry(0,data1);
var : LL(0,data2),EH(0,data2),E1(0,data2),H1(0,data2);
var : i1(0,data2),S1(0,data2),L1(0,data2);
var : DH2(0,data2),DL2(0,data2);
if data1(Bdate != Bdate[1]) Then
T1 = TotalTrades;
if data2(Bdate != Bdate[1]) Then{
E1 = 0;
DH2 = data2(H);
DL2 = data2(L);
}
if data2(H > DH2) Then
DH2 = data2(H);
if data2(L < DL2) Then
DL2 = data2(L);
if MarketPosition == 0 Then
entry = TotalTrades-T1;
Else
entry = (TotalTrades-T1)+1;
if MarketPosition == 0 and entry == 0 Then{
if data2(E1 == 0 and C >= DL2+PriceScale*B1) Then{
E1 = 1;
H1 = data2(H);
i1 = data2(index);
}
if data2(E1 == 1 and index > i1) then{
if data2(H > H1) Then
H1 = data2(H);
if data2(L <= H1-PriceScale*진입눌림1) Then{
E1 = 2;
i1 = data2(index);
S1 = H1;
}
}
if stime<lock1 and 최대 >= C and C >= 최소 and data2(E1 == 2 and index > i1 and C >= S1+PriceScale*진입돌파1) Then{
buy("b1");
}
}
if TotalTrades > TotalTrades[1] Then
LL = data2(L);
if data2(L < LL) Then
LL = data2(L);
if MarketPosition == 0 and entry >= 1 and entry < 거래횟수 Then{
if data2(E1 == 0 and C >= LL+PriceScale*B2 and C[1] < LL+PriceScale*B2) Then{
E1 = 1;
H1 = data2(H);
i1 = data2(index);
}
if data2(E1 == 1 and index > i1) then{
if data2(H > H1) Then
H1 = data2(H);
if data2(L <= H1-PriceScale*진입눌림2) Then{
E1 = 2;
i1 = data2(index);
S1 = H1;
}
}
if stime<lock2 and data2(E1 == 2 and index > i1 and C >= S1+PriceScale*진입돌파2) Then{
buy("b2");
}
}
if MarketPosition== 1 Then
{
if IsEntryName("b1") == true Then
{
SetStopLoss(PriceScale*als,PointStop);
SetStopTrailing(PriceScale*atr2,PriceScale*atr1,PointStop,1);
SetStopProfittarget(PriceScale*agl,PointStop);
}
Else if IsEntryName("b2") == true Then
{
SetStopLoss(PriceScale*bls,PointStop);
SetStopTrailing(PriceScale*btr2,PriceScale*btr1,PointStop,1);
SetStopProfittarget(PriceScale*bgl,PointStop);
}
Else
{
SetStopLoss(0);
SetStopTrailing(0,0);
SetStopProfittarget(0);
}
}
2025-07-18
285
글번호 192587