커뮤니티

예스랭귀지 Q&A

글쓰기

[공지] 예스랭귀지 AI 어시스턴트, '예스나 AI' 출시 및 무료 체험 안내

안녕하세요, 예스스탁 입니다.복잡한 수식 공부 없이 여러분의 아이디어를 말하면 시스템 트레이딩 언어 예스랭귀지로 작성해주는 서비스예스나 AI(YesNa AI)가 출시되었습니다.지금 예스나 AI를 직접 경험해 보실 수 있도록 20크레딧(질문권 20회)를 무료로 증정해 드리고 있습니다.바로 여러분의 아이디어를 코드로 변환해보세요.--------------------------------------------------🚀 YesNa AI 핵심 기능- 지표식/전략식/종목검색식 생성: 자연어로 요청하면 예스랭귀지 문법에 맞는 코드를 작성합니다.- 종목검색식 변환 지원: K증권의 종목 검색식을 예스랭귀지로 변환 지원합니다.- 컴파일 검증: 작성된 코드가 실행 가능한지 컴파일러를 통해 문법 검증을 거쳐 결과물을 제공합니다.상세한 서비스 개요 및 활용 방법은 [서비스 소개 페이지]에서 확인하실 수 있습니다.▶ 서비스 소개 페이지: 바로가기서비스 사용 유의사항 및 결제 환불정책은 [이용약관]을 참고 부탁드립니다.▶ 서비스 이용약관: 바로가기💬 이용 문의사용 중 문의사항은 [프로그램 사용법 Q&A] 게시판에서 [예스나 AI] 카테고리를 설정 후 문의해 주시면 상세히 안내해 드리겠습니다.--------------------------------------------------앞으로도 AI를 활용한 다양한 트레이딩 기능들을 지속적으로 선보일 예정입니다.많은 관심과 기대 부탁드립니다.
프로필 이미지
예스스탁
2026-02-27
1281
글번호 230811
지표
답변완료

수식 부탁드립니다.

아래는 이전질문코드에 답을 주신건데 1분봉이나 5분봉에서 length값을 240으로 늘리면 값이 0으로 나오는데 length값을 늘렸을 경우에도 값이 제대로 나오게 할 수 있는 방법이 있을까요? Inputs: length(55); var : x(0),y(0),halfLength(0),sqrtLength(0),ii(0); var : sum(0),Csum(0),sum1(0),csum1(0),sum2(0),csum2(0); var : WMA1(0),WMA2(0),diff1(0),hma1(0); var : sum5(0),Csum5(0),sum51(0),csum51(0),sum52(0),csum52(0); var : WMA51(0),WMA52(0),diff5(0),hma2(0); var : prev_hma1(0),prev_hma2(0),vol_sum(0),level(0),shift_col(0); var : reversal_dn_signal(0),reversal_up_signal(0);; halfLength = IntPortion(length / 2); sqrtLength = IntPortion(Sqrt(length)); if Bdate != Bdate[1] Then { prev_hma1 = hma1[1]; prev_hma2 = hma2[1]; } Sum = 0; CSum = 0; Sum5 = 0; CSum5 = 0; For x = 0 to sqrtLength-1 { Sum1 = 0; CSum1 = 0; Sum2 = 0; CSum2 = 0; Sum51 = 0; CSum51 = 0; Sum52 = 0; CSum52 = 0; ii = 0; For y = x+0 to x+length-1 { if ii < halfLength Then { Sum1= Sum1 + DayClose(y) * (halfLength - ii); CSum1 = CSum1 + halfLength - ii; Sum51 = Sum51 + DayClose(y+5) * (halfLength - ii); CSum51 = CSum51 + halfLength - ii; } if ii < Length Then { Sum2= Sum2 + DayClose(y) * (Length - ii); CSum2 = CSum2 + Length - ii; Sum52 = Sum52 + DayClose(y+5) * (Length - ii); CSum52 = CSum52 + Length - ii; } ii = ii+1; } WMA1 = Sum1 / CSum1; WMA2 = Sum2 / CSum2; diff1 = 2 * wma1 - wma2; Sum = Sum + diff1 * (sqrtLength - x); CSum = CSum + sqrtLength - x; WMA51 = Sum51 / CSum51; WMA52 = Sum52 / CSum52; diff5 = 2 * wma51 - wma52; Sum5 = Sum5 + diff5 * (sqrtLength - x); CSum5 = CSum5 + sqrtLength - x; } hma1 = sum/Csum; hma2 = sum5/Csum5; vol_sum = DayVolume(2) + dayVolume(0) + DayVolume(0); IF NextBarBdate != Bdate Then { if (prev_hma1 <= prev_hma2) and (hma1 > hma2) then begin level = DayLow; end else if (prev_hma1 >= prev_hma2) and (hma1 < hma2) then begin level = DayHigh; end else begin level = level[1]; end; // 바 색상 숫자 (1=Up, 0=Down) if DayClose < level then begin shift_col = 0; end else begin shift_col = 1; end; // 반전 신호 조건 reversal_dn_signal = 0; reversal_up_signal = 0; if (dayHigh(2) < level) and (DayHigh < level) and (DayHigh(1) > level) then reversal_dn_signal = 1; if (dayLow(2) > level) and (dayLow(1) < level) and (DayLow > level) then reversal_up_signal = 1; } // 결과 플롯 Plot1(level, "Market Level");
프로필 이미지
허밍스타
2025-07-20
253
글번호 192604
지표

딸바보07 님에 의해서 삭제되었습니다.

프로필 이미지
딸바보07
2025-07-20
12
글번호 192603
종목검색
답변완료

종목검색 부탁드립니다.

수고 많으십니다. 총 4가지의 조건검색식을 각각 요청 드립니다. ---------------------------------------- 1. 3분봉에서 A 수식을 돌파할 때 검색 < 수식 A > 조건=crossup(c,((predayhigh()+ predaylow()+predayclose())/3) +(predayhigh()-predaylow())); Valuewhen(1,조건,C); ---------------------------------------- 2. 3분봉에서 수식 A을 돌파 후 데드크로스하여, 수식 B의 ±1% (당일 또는 며칠 후 라도) 구간에서 검색 < 수식 B > 구 = BBandsUp(240,3); 간 = BBandsUp(240,1.5); 단타 = countSince(date!= date(1), Crossup(C,구)); valuewhen(1,단타==1 && 단타(1) == 0, 구 * 1.97 - 간) ---------------------------------------- 3. 수식 B를 데드크로스하고, 당일 or 며칠 후 재돌파 할 때 검색 ---------------------------------------- 4. 60분봉에서 수식 C를 돌파할 때 검색 < 수식 C > 이동=ma(c,기간1); 평균=ma(c,기간2); 조건=crossup(이동,평균); valuewhen(1,조건,(h+l)/비율1) 기간1 : 20 기간2 : 120 비율1 : 2.1 비율2 : 2.23 ---------------------------------------- 감사합니다!!
프로필 이미지
kimsing
2025-07-20
387
글번호 192602
종목검색
답변완료

코딩 해결 부탁드립니다!

담당자님 안녕하세요! 예스트레이더 슈퍼트렌드랑 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
269
글번호 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. 하단 돌파 하는선 ========================== 부탁드립니다. 감사 합니다
프로필 이미지
s1017051
2025-07-19
224
글번호 192600
지표
답변완료

시스템식 부탁합니다

당일 첫봉이 양봉이고, 당일 고가에서 하락하여 당일 (고가의 1/2+0.3틱)에 도달(atlimit) 하면 매수
프로필 이미지
피카2
2025-07-19
182
글번호 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 ========================== 부탁드립니다. 감사 합니다
프로필 이미지
s1017051
2025-07-19
283
글번호 192598
지표

s1017051 님에 의해서 삭제되었습니다.

프로필 이미지
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
420
글번호 192596
지표