커뮤니티

예스랭귀지 Q&A

글쓰기
답변완료

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

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

현재 사용 수식에 매수 조건 추가 부탁드림니다.

기존 사용 수식 국내주식(삼성전자) 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
1123
글번호 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
1072
글번호 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
1064
글번호 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
1294
글번호 170449
종목검색

트라이 님에 의해서 삭제되었습니다.

프로필 이미지
트라이
2023-07-08
7
글번호 170448
종목검색

절제9단 님에 의해서 삭제되었습니다.

프로필 이미지
절제9단
2023-07-08
5
글번호 170447
지표
답변완료

안녕하세요. 수식 문의 드립니다.

안녕하세요.. 키움 신호 수식인데요.. 종목검색으로 변환 부탁드립니다. Mv = Macd(20, 60); LL = Lowest(Mv, 기간); HH = Highest(Mv, 기간); NH = Valuewhen(1, Mv > HH(1),Mv); NL = Valuewhen(1, Mv < LL(1), Mv); DaL = Valuewhen(1,BarsSince(Mv<LL(1))==(기간 - k) ,HH); DaH = Valuewhen(1,BarsSince(Mv>HH(1))==(기간 - k) ,NH); Cnt = CountSince(Crossup(Mv,Dal),CrossUp(Mv,DaH)); Cnt && !Cnt(1) && Mv < 0 기간 5 k 3 매번 감사합니다.
프로필 이미지
손느린주식
2023-07-08
1449
글번호 170446
검색
답변완료

키움 수식 전환부탁드립니다

x=eavg(A,20); s=sum(1); 조건1=x<-2.8; 조건2=c>o && c(1)<c && o(1)<o; a=if(조건1 && 조건2, h(1),0); shift(a,-3);
프로필 이미지
단짜공
2023-07-08
1473
글번호 170445
사용자 함수
답변완료

수치좀 부탁 드립니다.

* 매번 도움에 고맙 습니다. * 아래 수식에서 수정 좀 요청 드립니다. * <요청1> 두 수식을 합처 부탁 드립니다. 즉 색상이 변경 되는 첫봉에 수평선을 출력 하려 합니다. <요청2> 수평선이 색상이 변경되면 끝나게 부탁 드립니다. <요청3> 수평선 우측 끝부분에 가격 표시 ## 윗부분 (hh) 수평선이 계속 되어 색상이 변경되도 출력 됨니다. : hh(60) ## 색상이 변경 되면 이전 수평선은 끝나고 ## 다음 색상 첫봉 수평선 출력 되도록 부탁 드립니다. ## 색상 중간에 나오는 모든 수평선은 필요 없습니다. 첫봉의 수평선만 필요 합니다. ## 첫봉 최고가 최저가 가격을 수평선 우축에 출력좀 부탁 드립니다. ## <아래 수식> Input: aa(5) , bb(15) ; var1 = ma(c,aa) ; var2 = ma(c,bb) ; var : box(0); if CrossUp(var1,var2) Then { box = Box_New(sDate,sTime,h,NextBarSdate,NextBarStime,l); Box_SetColor(box,Red); Box_SetFill(box,true); Box_SetExtFill(box,true); } else if CrossDown(var1,var2) Then { box = Box_New(sDate,sTime,h,NextBarSdate,NextBarStime,l); Box_SetColor(box,Blue); Box_SetFill(box,true); Box_SetExtFill(box,true); } Else Box_SetEnd(box,NextBarSdate,NextBarStime,l); ############################################################# input: n(1), hh(60) ; ## 윗부분 (hh) 수평선이 계속 되어 색상이 변경되도 출력 됨니다. : hh(60) ## 색상이 변경 되면 이전 수평선은 끝나고 다음 색상 첫봉 수평선 출력 되도록 부탁 드립니다. ## 색상 중간에 나오는 모든 선은 필요 없습니다. 첫봉의 수평선만 필요 합니다. ## 첫봉 최고가 최저가 가격을 수평선 우축에 출력좀 부탁 드립니다. var : dd1(0),cnt2(0); Array : TL1[100](0),TL2[100](0),V1[100](0),V2[100](0),D1[100](0); Array : TL3[100](0),TL4[100](0),V3[100](0),V4[100](0),D2[100](0); if bdate != Bdate[1] Then dd1 = dd1+1; if CrossUp(var1, var2) Then { For cnt2 = 99 DownTo 1 { TL1[cnt2] = TL1[cnt2-1]; TL2[cnt2] = TL2[cnt2-1]; V1[cnt2] = V1[cnt2-1]; V2[cnt2] = V2[cnt2-1]; D1[cnt2] = D1[cnt2-1]; } V1[0] = H; V2[0] = L; D1[0] = Index; TL1[0] = TL_new(sDate,sTime,V1[0],NextBarSdate,NextBarStime,V1[0]); TL2[0] = TL_new(sDate,sTime,V2[0],NextBarSdate,NextBarStime,V2[0]); TL_SetColor(TL1[0],Red); TL_SetColor(TL2[0],Red); } Else { For cnt2 = 99 DownTo 0 { if Index < D1[cnt2]+hh Then { TL_SetEnd(TL1[cnt2],sDate,sTime,V1[cnt2]); TL_SetEnd(TL2[cnt2],sDate,sTime,V2[cnt2]); } } } if CrossDown(var1, var2) Then { For cnt2 = 99 DownTo 1 { TL3[cnt2] = TL3[cnt2-1]; TL4[cnt2] = TL4[cnt2-1]; V3[cnt2] = V3[cnt2-1]; V4[cnt2] = V4[cnt2-1]; D2[cnt2] = D2[cnt2-1]; } V3[0] = H; V4[0] = L; D2[0] = Index; TL3[0] = TL_new(sDate,sTime,V3[0],NextBarSdate,NextBarStime,V3[0]); TL4[0] = TL_new(sDate,sTime,V4[0],NextBarSdate,NextBarStime,V4[0]); TL_SetColor(TL3[0],Blue); TL_SetColor(TL4[0],Blue); } Else { For cnt2 = 99 DownTo 0 { if Index < D2[cnt2]+hh Then { TL_SetEnd(TL3[cnt2],sDate,sTime,V3[cnt2]); TL_SetEnd(TL4[cnt2],sDate,sTime,V4[cnt2]); } } } ###########################################33 고맙습니다. 수고하십시요.
프로필 이미지
요타
2023-07-10
1314
글번호 170444
지표