커뮤니티

예스랭귀지 Q&A

글쓰기
답변완료

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

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

종목검색식의 결과값이 다르게 나옵니다.

안녕하세요... 종목검색 식 문의인데요... 아래 식을 완성하고, 파워종목검색에서 아래식으로 만든 조건검색을 등록하여 검색을 하였는데요. 파워종목검색에서 기준주기(일,주,월,분)를 바꿔가면서 조회를 하면 결과값이 다르게 나옵니다. 제가 원하는값은 당일의 현재시간까지의 거래량과 이전일별 현재시간까지의 거래량을 구한후 평균거래량을 구한후 당일의 거래량이 이전의 평균거래량보다 100%이상 거래된 종목만 검색하기를 원합니다. 어디가 잘못되었을까요? 그리고, 디버깅문을 넣으면 에라가 납니다. 사용법 부탁드립니다. 디버깅문 : MessageLog("종목명 : %s, 당일거래량 : %.2f, %s일평균거래량 : %.2f, 달성율 : %.2f", Find(1), DayVolume, Ilsu, AvgVolume, Per); 완성식 : input : Ilsu(20),MinPer(100); var : cnt(0),Per(0); var : sumVolume(0),AvgVolume(0); //array : sumVolume[5](0); for cnt = 1 to Ilsu { if sdate[cnt] < sdate and stime[cnt] <= stime then { sumVolume = sumVolume + DayVolume[cnt]; } } AvgVolume = sumVolume/Ilsu; Per = DayVolume / AvgVolume * 100; if MinPer < Per Then { Find(1); // MessageLog("종목명 : %s, 당일거래량 : %.2f, %s일평균거래량 : %.2f, 달성율 : %.2f", Find(1), DayVolume, Ilsu, AvgVolume, Per); }
프로필 이미지
와사비
2021-09-28
995
글번호 152512
종목검색
답변완료

추세선이 안그려지는경우가 있습니다.

추세선이 안그려지는 경우가 있는데 이건 어떻게 해결해야 하나요?
프로필 이미지
니짱난위
2021-09-28
1704
글번호 152511
지표
답변완료

조건이 만족 할때만 지표가 표현되게...

분봉 챠트에서 전일 고저선을 10일(변경가능) 치만 나타나게 할수있는지.. 가능하다면 수식을 좀 부탁드립니다. 감사합니다.
프로필 이미지
새가날아오를때
2021-09-28
1682
글번호 152504
지표

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

프로필 이미지
요타
2021-09-28
0
글번호 152503
지표
답변완료

시초가 매매 수식 부탁드립니다.

시초가 시간 지정 1. 갭상승 경우 시초가에 매수포지션 진입 2. 갭하락 경우 시초가에 매도포지션 진입 3. 최대 수익대비 n틱 하락시 청산 4. 목표 수익 n틱 실현시 청산
프로필 이미지
승부사1
2021-09-27
1861
글번호 152502
시스템
답변완료

print 함수에 대해 질문 입니다.

안녕하세요. print 문에서 date 와 time , close, 등을 작성을 아래와 같이 했습니다. print("min.csv","%.2f, %.2f", date, Time); 결과는 아래와 같습니다. 2021-09-23 23:54:00 20210923.00 235359 2021-09-23 23:55:00 20210923.00 235459 2021-09-23 23:56:00 20210923.00 235559 2021-09-23 23:57:00 20210923.00 235659 2021-09-23 23:58:00 20210923.00 235759 2021-09-23 23:59:00 20210923.00 235859 2021-09-24 : : 0 20210923.00 235959 2021-09-24 : 1:00 20210924.00 59 2021-09-24 : 2:00 20210924.00 159 2021-09-24 : 3:00 20210924.00 259 2021-09-24 : 4:00 20210924.00 359 2021-09-24 : 5:00 20210924.00 459 질문1. 0시~0시59분까지 공란처리말고 00 숫자로 표현가능한 방법 부탁드립니다. 예) : : 0 --> 00:00:00 : : 1 --> 00:00:01 질문2. date 시간과 time 시간이 1분단위로 어긋나보입니다. date와 time 출력방식이 다른 것 같습니다. 같이 맞출 수 있는 방법 부탁드립니다.
프로필 이미지
만들레영토
2021-09-28
1164
글번호 152501
지표
답변완료

변환부탁드립니다.

감사합니다. // This source code is subject to the terms of the Mozilla Public License 2.0 at https://mozilla.org/MPL/2.0/ // &#169; BobRivera990 //@version=4 study(title = "Trend Type Indicator by BobRivera990", overlay = false) //==========================================================================[Inputs]========================================================================== useAtr = input(true, title = "Use ATR to detect Sideways Movements") // Use Average True Range (ATR) to detect Sideways Movements atrLen = input(14, minval = 1, title = "ATR Length") // length of the Average True Range (ATR) used to detect Sideways Movements atrMaType = input("SMA", options = ["SMA", "EMA"], title = "ATR Moving Average Type") // Type of the moving average of the ATR used to detect Sideways Movements atrMaLen = input(20, minval = 1, title = "ATR MA Length") // length of the moving average of the ATR used to detect Sideways Movements useAdx = input(true, title = "Use ADX to detect Sideways Movements") // Use Average Directional Index (ADX) to detect Sideways Movements adxLen = input(14, minval = 1, maxval = 50, title = "ADX Smoothing") // length of the Average Directional Index (ADX) used to detect Sideways Movements diLen = input(14, minval = 1, title = "DI Length") // length of the Plus and Minus Directional Indicators (+DI & -DI) used to determine the direction of the trend adxLim = input(25, minval = 1, title = "ADX Limit") // A level of ADX used as the boundary between Trend Market and Sideways Market smooth = input(3, minval = 1, maxval = 5, title = "Smoothing Factor") // Factor used for smoothing the oscillator lag = input(8, minval = 0, maxval = 15, title = "Lag") // lag used to match indicator and chart //============================================================================================================================================================ //===================================================================[Initial Calculations]=================================================================== atr = atr(atrLen) // Calculate the Average True Range (ATR) atrMa = atrMaType == "EMA" ? ema(atr, atrMaLen) : sma(atr, atrMaLen) // Calculate the moving average of the ATR up = change(high) // Calculate parameter related to ADX, +DI and -DI down = -change(low) // Calculate parameter related to ADX, +DI and -DI plusDM = na(up) ? na : (up > down and up > 0 ? up : 0) // Calculate parameter related to ADX, +DI and -DI minusDM = na(down) ? na : (down > up and down > 0 ? down : 0) // Calculate parameter related to ADX, +DI and -DI trur = rma(tr, diLen) // Calculate parameter related to ADX, +DI and -DI plus = fixnan(100 * rma(plusDM, diLen) / trur) // Calculate Plus Directional Indicator (+DI) minus = fixnan(100 * rma(minusDM, diLen) / trur) // Calculate Minus Directional Indicator (-DI) sum = plus + minus // Calculate parameter related to ADX adx = 100 * rma(abs(plus - minus) / (sum == 0 ? 1 : sum), adxLen) // Calculate Average Directional Index (ADX) //============================================================================================================================================================ //========================================================================[Conditions]======================================================================== cndNa = na(atr) or na(adx) or na(plus) or na(minus) or na(atrMaLen) // Conditions for lack of sufficient data for calculations cndSidwayss1 = useAtr and atr <= atrMa // Sideways Movement condition (based on ATR) cndSidwayss2 = useAdx and adx <= adxLim // Sideways Movement condition (based on ADX) cndSidways = cndSidwayss1 or cndSidwayss2 // General Sideways Movement condition cndUp = plus > minus // uptrend condition cndDown = minus >= plus // downtrend condition trendType = cndNa ? na : cndSidways ? 0 : cndUp ? 2 : -2 // Determine the type of trend smoothType = na(trendType) ? na : round(sma(trendType, smooth) / 2) * 2 // Calculate the smoothed trend type oscillator //============================================================================================================================================================ //=========================================================================[Drawing]========================================================================== colGreen30 = color.new(color.green, 30) // Define the color used in the drawings colGreen90 = color.new(color.green, 90) // Define the color used in the drawings colGray = color.new(color.gray, 20) // Define the color used in the drawings colWhite90 = color.new(color.white, 90) // Define the color used in the drawings colRed30 = color.new(color.red, 30) // Define the color used in the drawings colRed90 = color.new(color.red, 90) // Define the color used in the drawings band3 = plot(+3, title = "Band_3", color=color.black) // Draw the upper limit of the uptrend area band2 = plot(+1, title = "Band_2", color=color.black) // Draw the boundary between Sideways and Uptrend areas band1 = plot(-1, title = "Band_1", color=color.black) // Draw the boundary between Sideways and Downtrend areas band0 = plot(-3, title = "Band_0", color=color.black) // Draw the lower limit of the downtrend area fill(band2, band3, title = "Uptrend area", color = colGreen90) // Highlight the Uptrend area fill(band1, band2, title = "Sideways area", color = colWhite90) // Highlight the Sideways area fill(band0, band1, title = "Downtrend area", color = colRed90) // Highlight the Downtrend area var label lblUp = na label.delete(lblUp) lblUp := label.new(x = time, y = 2, text = "UP", color = color.new(color.green, 100), textcolor = color.black, style = label.style_label_left, xloc = xloc.bar_time, yloc = yloc.price, size=size.normal, textalign = text.align_left) // Show Uptrend area label var label lblSideways = na label.delete(lblSideways) lblSideways := label.new(x = time, y = 0, text = "SIDEWAYS", color = color.new(color.green, 100), textcolor = color.black, style = label.style_label_left, xloc = xloc.bar_time, yloc = yloc.price, size = size.normal, textalign = text.align_left) // Show Sideways area label var label lblDown = na label.delete(lblDown) lblDown := label.new(x = time, y = -2, text = "DOWN", color = color.new(color.green, 100), textcolor = color.black, style = label.style_label_left, xloc = xloc.bar_time, yloc = yloc.price, size = size.normal, textalign = text.align_left) // Show Downtrend area label var label lblCurrentType = na label.delete(lblCurrentType) lblCurrentType := label.new(x = time, y = smoothType, color = color.new(color.blue, 30), style = label.style_label_right, xloc = xloc.bar_time, yloc = yloc.price, size = size.small) // Show the latest status label trendCol = smoothType == 2 ? colGreen30 : smoothType == 0 ? colGray : colRed30 // Determine the color of the oscillator in different conditions plot(smoothType, title = "Trend Type Oscillator", color = trendCol, linewidth = 3, offset = -lag, style = plot.style_stepline) // Draw the trend type oscillator
프로필 이미지
코샘매쓰
2021-09-27
1743
글번호 152500
지표
답변완료

시스템식 문의 드립니다.

여러번 질문드려 죄송합니다.ㅜ.ㅜ 아침에 송부해주신 식을 기준으로 다시 시뮬레이션을 돌려봤더니.. 예를들어 아시아나 항공으로 1차 타점 : 28350 2차 타점 : 27800 3차 타점 : 27300 이렇게 타점을 걸어두고 매매를 진행되었을때 제가 생각하는 시뮬레이션은 28350에 매수해서 2프로 익절하고 , 그다음 27800원에 매수해서 2프로 익절하고, 27300원에서 매수해서 2프로 익절하는 식을 생각했었는데 아래의 그림을 보시면, 28350에 매수해서 2프로 익절후에 또 다시, 28350원에 진입하는걸 볼수 있습니다. 다시하면 조건을 적는다면.. 요청조건은 ------------------------------------------------------------------- 여기서 추가하고자 하는 조건은 전부다 동일한 조건으로 진행되는데, 1차매수 2프로 익절 했을 경우에만, 다음타점으로 매수진행되도록 조건을 추가하고 싶습니다. 예를들어 5000원에 매수해서 2프로 익절까지 했을경우, 다음 4500원이 매수타점으로 되어 진행되도록 조건을 추가하고자 합니다. ------------------------------------------------------------------- 입니다. 그럼 부탁드리겠습니다. 감사합니다. 요청식 ------------------------------------------------------------------- 안녕하세요 예스스탁입니다. 기존식은 기존의 2차진입가격을 그대로 적용했습니다. 첫타점 다음가격으로 지정해 드립니다. 첫타점이 타점5이면 다음가격이 없어 진입할 수 없습니다. input : 타점1(5000),타점2(4500),타점3(4000),타점4(3500),타점5(3000); input : 투자금액1(1000000),투자금액2(2000000); var : entry(0),HH(0),H1(0); if Bdate != Bdate[1] Then { entry = 0; #5개의 타점중 시가보다 작은것 중에 젤 큰값 계산 HH = 0; H1 = 0; if 타점1 < DayOpen*0.99 and 타점1 < DayClose(1) and 타점1 > HH Then { HH = 타점1; H1 = 타점2; } if 타점2 < DayOpen*0.99 and 타점2 < DayClose(1) and 타점2 > HH Then { HH = 타점2; H1 = 타점3; } if 타점3 < DayOpen*0.99 and 타점3 < DayClose(1) and 타점3 > HH Then { HH = 타점3; H1 = 타점4; } if 타점4 < DayOpen*0.99 and 타점4 < DayClose(1) and 타점4 > HH Then { HH = 타점4; H1 = 타점5; } if 타점5 < DayOpen*0.99 and 타점5 < DayClose(1) and 타점5 > HH Then { HH = 타점5; } } if (MarketPosition != 0 and MarketPosition != MarketPosition[1]) and (MarketPosition != MarketPosition[1] and TotalTrades > TotalTrades[1]) Then entry = entry+1; if MarketPosition == 0 and sTime < 133000 and entry == 0 Then { Buy("1차매수",AtLimit,HH,Floor(투자금액1/min(NextBarOpen,HH))); } if MarketPosition == 1 and entry == 1 Then { Buy("2차매수",AtLimit,HH*0.974,Floor(투자금액2/min(NextBarOpen,HH*0.974))); } if MarketPosition == 0 and sTime < 133000 and entry == 1 and IsexitName("1차매수 2프로익절",1) == true and H1 > 0 Then { Buy("2차매수A",AtLimit,H1,Floor(투자금액2/min(NextBarOpen,HH*0.974))); } if MarketPosition == 1 Then { if MaxEntries == 1 and IsEntryName("1차매수",0) == true Then { ExitLong("1차매수 1프로익절",AtLimit,avgEntryPrice*1.01,"",Floor(MaxContracts*0.4)); ExitLong("1차매수 2프로익절",AtLimit,avgEntryPrice*1.02); } if MaxEntries == 2 and IsEntryName("1차매수",0) == true Then { ExitLong("2차매수 0.3익절",AtLimit,avgEntryPrice*1.003,"",Floor(MaxContracts*0.5)); ExitLong("2차매수 0.5익절",AtLimit,avgEntryPrice*1.005); } if MaxEntries == 1 and IsEntryName("2차매수A",0) == true Then { ExitLong("2차매수A 0.3익절",AtLimit,avgEntryPrice*1.003,"",Floor(MaxContracts*0.5)); ExitLong("2차매수A 0.5익절",AtLimit,avgEntryPrice*1.005); } ExitLong("손절",AtStop,HH*0.96); }
프로필 이미지
맴맴잉
2021-09-28
1582
글번호 152499
시스템
답변완료

이동평균

항상 감사합니다. 5)이동평균 단순이동평균/지수이동평균/가중이동평균의 차이알려주세요? *단순-간단한 조건없는 *지수- &#10647;수&#10648; 어떤 수나 문자의 오른쪽 위에 덧붙여 그 거듭제곱을 나타내는 문자나 숫자. *가중- (加重) @단어 뜻만 가지고는 이해가 어렵습니다
프로필 이미지
회원
2021-09-27
1199
글번호 152498
지표