커뮤니티

예스랭귀지 Q&A

글쓰기
답변완료

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

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

수정 부탁드립니다.

안녕하세요? 아래 수식을 참조데이터2 기본차트에 넣으려고 합니다. 수식을 그에 맞게 고쳐주시면 대단히 감사하겠습니다. 감사드리며 오늘도 좋은시간 되세요. =============== input : R1(255),G1(0),B1(0); input : R2(0),G2(0),B2(255); var : hh(0),ll(0),Rt1(0),Rt2(0),Mv1(0),Mv2(0),Diff(0); Rt1 = Upvol/Volume*100; Rt2 = Downvol/Volume*100; Mv1 = money*(Rt1/100); Mv2 = money*(Rt2/100); diff = Mv1-Mv2; if Bdate != Bdate[1] Then { var1 = 0; Var2 = Diff; } var1 = var1 + Diff; if CurrentDate == sDate Then Plot1(var1,"당일실매수거래량",iff(var1 > 0,RGB(0,0,0),RGB(0,0,0))); if CurrentDate == sDate Then plot2(Var2,"첫봉종가"); if Bdate != Bdate[1] Then { hh = var1; ll = var1; } Else { if var1 > hh Then hh = var1; if var1 < ll Then ll = var1; } if CurrentDate == sDate Then { Plot3(hh,"최고"); plot4(ll,"최저"); plot5(ll+(hh-ll)*0.25,"25.0%"); plot6(ll+(hh-ll)*0.382,"38.2%"); plot7(ll+(hh-ll)*0.500,"50.0%"); plot8(ll+(hh-ll)*0.618,"61.8%"); plot9(ll+(hh-ll)*0.75,"75.0%"); plot10(ll+(hh-ll)*0.500+150,"+150"); plot11(Var2+100,"첫봉종가+20"); } if CurrentDate == sDate Then { PlotBaseLine1(0); PlotBaseLine2(30000); PlotBaseLine3(-30000); }
프로필 이미지
포보스
2023-11-28
901
글번호 174389
지표
답변완료

매수 조건식 부탁 드립니다.

안녕하세요. 아래 매수 조건들이 모두 and 상황에서 시장가 매매 가능하도록 부탁 드립니다. 매수 조건 1. 60분봉상 240이평선이 480이평선 아래 있을때 2. RSI 30 하향 돌파 시 3. 볼린저밴드 하단 하향 돌파 시 감사합니다.
프로필 이미지
둥둥애비
2023-11-28
1066
글번호 174388
시스템
답변완료

문의 드립니다.

Hsto S=stochasticsSlow(s기간1, s기간2); HighestSince(1, CrossUp(S, 기준1), ma(c, 이평기간)); Lsto S=stochasticsSlow(s기간1, s기간2); LowestSince(1, CrossDown(S, 기준2), ma(c, 이평기간)); s기간1 20 s기간2 30 이평기간 10 기준1 80 기준2 20 키움 지표인데 예스로 좀 변환해주세요
프로필 이미지
신대륙발견
2023-11-28
1108
글번호 174387
지표
답변완료

문의드립니다

20일이전에 5일선이 20일선을 하향돌파했다가 다시 상향돌파했을때 종목을 찾고싶습니다
프로필 이미지
처음처럼22
2023-11-28
1037
글번호 174383
종목검색
답변완료

종목검색식 문의드립니다

수고하십니다 종목검색식 문의드립니다 당일 5분첫봉 상승폭(저가~고가)의 두배가되는 고가라인을 종가로 돌파한 5분두번째봉의 종목을 검색하고 싶은데요.... 실시간 종목검색 가능할까요?
프로필 이미지
pinpoint
2023-11-28
1012
글번호 174382
종목검색
답변완료

시스템 변환 문의드립니다.

지표문의를 드리고 시스템 매매를 해보려고합니다. input : length(14); input : mult(1.0); var : src(0),stdev(0),Emav(0),upper(0),lower(0); var : bullish(0),bearish(0),bull_den(0),bear_den(0); var : bull(0),bear(0); src = close; stdev = std(src, length) * mult; emav = ema(src, length); upper = emav + stdev; lower = emav - stdev; bullish = AccumN(max(src - upper, 0), length); bearish = AccumN(max(lower - src, 0), length); bull_den = AccumN(abs(src - upper), length); bear_den = AccumN(abs(lower - src), length); bull = bullish/bull_den*100; bear = bearish/bear_den*100; 여기까지가 문의 답변주셔서 변환한 지표였고 위 지표를 기반으로 밑에있는 파인스크립트 코드를 변환해서 손익절을 하고싶습니다. 손익절 기준이 여러가지가 있었는데 ATR 기준으로 하고싶어서 ATR만 남기고 다 빼려고 노력했습니다만.. 여기까지가 한계라서 문의드립니다ㅜㅜ 코드에 트레일링스탑이 있는데 그것도 변환이 가능할까요? bool openLongPosition = ta.crossover(bull, bear) bool openShortPosition = ta.crossunder(bull , bear) // LOGIC ============================================================================================================ // the open signals when not already into a position bool validOpenLongPosition = openLongPosition and not (strategy.opentrades.size(strategy.opentrades - 1) > 0) bool validOpenShortPosition = openShortPosition and not (strategy.opentrades.size(strategy.opentrades - 1) < 0) bool longIsActive = validOpenLongPosition or strategy.opentrades.size(strategy.opentrades - 1) > 0 bool shortIsActive = validOpenShortPosition or strategy.opentrades.size(strategy.opentrades - 1) < 0 // INPUT ============================================================================================================ atrLength = input.int(defval = 14, title = 'ATR Length', minval = 1, tooltip = 'How many previous candles to use for the ATR calculation.', group = 'General') // LOGIC ============================================================================================================ // take profit has to communicate its exeution with the stop loss logic when 'TP' mode is seleced var bool longTrailingTakeProfitExeuted = false var bool shortTrailingTakeProfitExeuted = false float openAtr = ta.valuewhen(validOpenLongPosition or validOpenShortPosition, ta.atr(atrLength), 0) // INPUT ============================================================================================================ stopLossMethod = input.string(defval = 'ATR', title = 'Stop Loss Method', options = ['ATR'], tooltip = 'The method to calculate the Stop Loss (percentagewise, based on initial ATR or based on ATR changing over time).', group = 'Stop Loss - Target') longStopLossAtrMul = input.float(defval = 10.0, title = 'ATR Long/Short Mul', minval = 0.1, step = 0.1, inline = 'Trailing Stop Loss ATR Multiplier', group = 'Stop Loss - Target') shortStopLossAtrMul = input.float(defval = 10.0, title = '', minval = 0.1, step = 0.1, tooltip = 'ATR multiplier to be used for the long/short Stop Loss.', inline = 'Trailing Stop Loss ATR Multiplier', group = 'Stop Loss - Target') stopLossTrailingEnabled = input.string(defval = 'TP', title = 'Enable Trailing', options = ['TP', 'ON', 'OFF'], tooltip = 'Enable the trailing for Stop Loss when Take Profit order is exeted (TP) or from the start of the entry order (ON) or not at all (OFF).', group = 'Stop Loss - Trailing') breakEvenEnabled = input.bool(defval = false, title = 'Break Even', tooltip = 'When Take Profit price target is hit, move the Stop Loss to the entry price (or to a more strict price defined by the Stop Loss %/ATR Multiplier).', group = 'Stop Loss - Trailing') // LOGIC ============================================================================================================ getLongStopLossPrice(baseSrc) => switch stopLossMethod 'ATR' => baseSrc - longStopLossAtrMul * openAtr => na // trailing starts when the take profit price is reached if 'TP' mode is set or from the very begining if 'ON' mode is seleced bool longTakeProfitTrailingEnabled = stopLossTrailingEnabled == 'ON' or stopLossTrailingEnabled == 'TP' and longTrailingTakeProfitExeuted // calculate trailing stop loss price when enter long position and peserve its value until the position closes var float longStopLossPrice = na longStopLossPrice := if (longIsActive) if (validOpenLongPosition) getLongStopLossPrice(close) else stopPrice = getLongStopLossPrice(longTakeProfitTrailingEnabled ? high : strategy.opentrades.entry_price(strategy.opentrades - 1)) stopPrice := breakEvenEnabled and longTrailingTakeProfitExeuted ? math.max(stopPrice, strategy.opentrades.entry_price(strategy.opentrades - 1)) : stopPrice math.max(stopPrice, nz(longStopLossPrice[1])) else na getShortStopLossPrice(baseSrc) => switch stopLossMethod 'ATR' => baseSrc + shortStopLossAtrMul * openAtr => na // trailing starts when the take profit price is reached if 'TP' mode is set or from the very begining if 'ON' mode is seleced bool shortTakeProfitTrailingEnabled = stopLossTrailingEnabled == 'ON' or stopLossTrailingEnabled == 'TP' and shortTrailingTakeProfitExeuted // calculate trailing stop loss price when enter short position and peserve its value until the position closes var float shortStopLossPrice = na shortStopLossPrice := if (shortIsActive) if (validOpenShortPosition) getShortStopLossPrice(close) else stopPrice = getShortStopLossPrice(shortTakeProfitTrailingEnabled ? low : strategy.opentrades.entry_price(strategy.opentrades - 1)) stopPrice := breakEvenEnabled and shortTrailingTakeProfitExeuted ? math.min(stopPrice, strategy.opentrades.entry_price(strategy.opentrades - 1)) : stopPrice math.min(stopPrice, nz(shortStopLossPrice[1], 999999.9)) else na // PLOT ============================================================================================================= var stopLossColor = color.new(color.maroon, 0) plot(series = longStopLossPrice, title = 'Long Stop Loss', color = stopLossColor, linewidth = 1, style = plot.style_linebr, offset = 1) plot(series = shortStopLossPrice, title = 'Short Stop Loss', color = stopLossColor, linewidth = 1, style = plot.style_linebr, offset = 1) //#endregion ======================================================================================================== //#region TAKE PROFIT // INPUT ============================================================================================================ takeProfitQuantityPerc = input.float(defval = 50, title = 'Take Profit Quantity %', minval = 0.0, maxval = 100, step = 1.0, tooltip = 'The percentage of the position that will be withdrawn when the take profit price target is reached.', group = 'Take Profit - Quantity') takeProfitMethod = input.string(defval = 'ATR', title = 'Take Profit Method', options = ['ATR'], tooltip = 'The method to calculate the Take Profit price.', group = 'Take Profit - Target') //longTakeProfitPerc = input.float(defval = 1.0, title = 'Long/Short Take Profit %', minval = 0.05, step = 0.05, inline = 'Take Profit Perc', group = 'Take Profit - Target') / 100 //shortTakeProfitPerc = input.float(defval = 1.0, title = '', minval = 0.05, step = 0.05, tooltip = 'The percentage of the price increase/decrease to set the take profit price target for long/short positions.', inline = 'Take Profit Perc', group = 'Take Profit - Target') / 100 longTakeProfitAtrMul = input.float(defval = 10.0, title = 'ATR Long/Short Mul&#8195;', minval = 0.1, step = 0.1, inline = 'Take Profit ATR Multiplier', group = 'Take Profit - Target') shortTakeProfitAtrMul = input.float(defval = 10.0, title = '', minval = 0.1, step = 0.1, tooltip = 'ATR multiplier to be used for the long/short Take Profit.', inline = 'Take Profit ATR Multiplier', group = 'Take Profit - Target') takeProfitTrailingEnabled = input.bool(defval = true, title = 'Enable Trailing', tooltip = 'Enable or disable the trailing for take profit.', group = 'Take Profit - Trailing') distanceMethod = input.string(defval = 'ATR', title = 'Distance Method', options = ['ATR'], tooltip = 'The method to calculate the Distance for the Trailing Take Profit.', group = 'Take Profit - Trailing') distancePerc = input.float(defval = 1.0, title = 'Distance %', minval = 0.01, maxval = 100, step = 0.05, tooltip = 'The percentage wise step to be used for following the price, when the take profit target is reached.', group = 'Take Profit - Trailing') / 100 distanceAtrMul = input.float(defval = 1.0, title = 'Distance ATR Mul', minval = 0.01, step = 0.05, tooltip = 'Multiplier to be used on the initial entrys` ATR to calculate the step for following the price, when the take profit target is reached.', group = 'Take Profit - Trailing') // LOGIC ============================================================================================================ getLongTakeProfitPrice() => switch takeProfitMethod 'ATR' => close + longTakeProfitAtrMul * openAtr => na getLongTakeProfitPerc() => (close - getLongTakeProfitPrice()) / close // calculate take profit price when enter long position and peserve its value until the position closes var float longTakeProfitPrice = na longTakeProfitPrice := if (longIsActive and not longTrailingTakeProfitExeuted) if (validOpenLongPosition) getLongTakeProfitPrice() else nz(longTakeProfitPrice[1], getLongTakeProfitPrice()) else na longTrailingTakeProfitExeuted := strategy.opentrades.size(strategy.opentrades - 1) > 0 and (longTrailingTakeProfitExeuted[1] or strategy.opentrades.size(strategy.opentrades - 1) < strategy.opentrades.size(strategy.opentrades - 1)[1] or strategy.opentrades.size(strategy.opentrades - 1)[1] == 0 and high >= longTakeProfitPrice) longTrailingTakeProfitStepTicks = switch distanceMethod 'ATR' => distanceAtrMul * openAtr / syminfo.mintick => na getShortTakeProfitPrice() => switch takeProfitMethod 'ATR' => close - shortTakeProfitAtrMul * openAtr => na getShortTakeProfitPerc() => (getShortTakeProfitPrice() - close) / close // calculate take profit price when enter short position and peserve its value until the position closes var float shortTakeProfitPrice = na shortTakeProfitPrice := if (shortIsActive and not shortTrailingTakeProfitExeuted) if (validOpenShortPosition) getShortTakeProfitPrice() else nz(shortTakeProfitPrice[1], getShortTakeProfitPrice()) else na shortTrailingTakeProfitExeuted := strategy.opentrades.size(strategy.opentrades - 1) < 0 and (shortTrailingTakeProfitExeuted[1] or strategy.opentrades.size(strategy.opentrades - 1) > strategy.opentrades.size(strategy.opentrades - 1)[1] or strategy.opentrades.size(strategy.opentrades - 1)[1] == 0 and low <= shortTakeProfitPrice) shortTrailingTakeProfitStepTicks = switch distanceMethod 'ATR' => distanceAtrMul * openAtr / syminfo.mintick => na // PLOT ============================================================================================================= var takeProfitColor = color.new(color.teal, 0) plot(series = longTakeProfitPrice, title = 'Long Take Profit', color = takeProfitColor, linewidth = 1, style = plot.style_linebr, offset = 1) plot(series = shortTakeProfitPrice, title = 'Short Take Profit', color = takeProfitColor, linewidth = 1, style = plot.style_linebr, offset = 1) // LOGIC ============================================================================================================ // getting into LONG position if (validOpenLongPosition) strategy.entry(id = 'Long Entry', direction = strategy.long, alert_message = 'Long(' + syminfo.ticker + '): Start') else strategy.cancel(id = 'Long Entry') if (longIsActive) strategy.exit(id = 'Long Take Profit / Stop Loss', from_entry = 'Long Entry', qty_percent = takeProfitQuantityPerc, limit = takeProfitTrailingEnabled ? na : longTakeProfitPrice, stop = longStopLossPrice, trail_price = takeProfitTrailingEnabled ? longTakeProfitPrice : na, trail_offset = takeProfitTrailingEnabled ? longTrailingTakeProfitStepTicks : na, alert_message = 'Long(' + syminfo.ticker + '): Take Profit or Stop Loss exeuted') strategy.exit(id = 'Long Stop Loss', from_entry = 'Long Entry', stop = longStopLossPrice, alert_message = 'Long(' + syminfo.ticker + '): Stop Loss exeuted') // getting into SHORT position if (validOpenShortPosition) strategy.entry(id = 'Short Entry', direction = strategy.short, alert_message = 'Short(' + syminfo.ticker + '): Start') else strategy.cancel(id = 'Short Entry') if (shortIsActive) strategy.exit(id = 'Short Take Profit / Stop Loss', from_entry = 'Short Entry', qty_percent = takeProfitQuantityPerc, limit = takeProfitTrailingEnabled ? na : shortTakeProfitPrice, stop = shortStopLossPrice, trail_price = takeProfitTrailingEnabled ? shortTakeProfitPrice : na, trail_offset = takeProfitTrailingEnabled ? shortTrailingTakeProfitStepTicks : na, alert_message = 'Short(' + syminfo.ticker + '): Take Profit or Stop Loss exeuted') strategy.exit(id = 'Short Stop Loss', from_entry = 'Short Entry', stop = shortStopLossPrice, alert_message = 'Short(' + syminfo.ticker + '): Stop Loss exeuted') // PLOT ============================================================================================================= var posColor = color.new(color.gray, 0) plot(series = strategy.opentrades.entry_price(strategy.opentrades - 1), title = 'Position', color = posColor, linewidth = 1, style = plot.style_linebr) //#endregion ========================================================================================================
프로필 이미지
잘하고프다
2023-11-28
2401
글번호 174381
시스템
답변완료

수식 변환 부탁드립니다.

안녕하세요? 항상 감사드립니다. 아래는 K사 일봉과 분봉에 라인을 표시한 건데요 예스에서 선으로 나타내고 싶습니다. 변환가능할까요? 1. 분봉 A=PREDAYHIGH() - PREDAYLOW(); DAYOPEN()+A*0.5 2. 일봉 A=H(1)-L(1); A1=O+A*0.5; VALUEWHEN(1,CROSSUP(C,A1),A1)
프로필 이미지
매일대박
2023-11-27
984
글번호 174380
지표

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

프로필 이미지
2wnwn
2023-11-27
19
글번호 174379
지표

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

프로필 이미지
ujkl
2023-11-27
7
글번호 174378
검색