커뮤니티
예스랭귀지 Q&A
답변완료
[공지] 예스랭귀지 AI 어시스턴트, '예스나 AI' 출시 및 무료 체험 안내
안녕하세요, 예스스탁 입니다.복잡한 수식 공부 없이 여러분의 아이디어를 말하면 시스템 트레이딩 언어 예스랭귀지로 작성해주는 서비스예스나 AI(YesNa AI)가 출시되었습니다.지금 예스나 AI를 직접 경험해 보실 수 있도록 20크레딧(질문권 20회)를 무료로 증정해 드리고 있습니다.바로 여러분의 아이디어를 코드로 변환해보세요.--------------------------------------------------🚀 YesNa AI 핵심 기능- 지표식/전략식/종목검색식 생성: 자연어로 요청하면 예스랭귀지 문법에 맞는 코드를 작성합니다.- 종목검색식 변환 지원: K증권의 종목 검색식을 예스랭귀지로 변환 지원합니다.- 컴파일 검증: 작성된 코드가 실행 가능한지 컴파일러를 통해 문법 검증을 거쳐 결과물을 제공합니다.상세한 서비스 개요 및 활용 방법은 [서비스 소개 페이지]에서 확인하실 수 있습니다.▶ 서비스 소개 페이지: 바로가기서비스 사용 유의사항 및 결제 환불정책은 [이용약관]을 참고 부탁드립니다.▶ 서비스 이용약관: 바로가기💬 이용 문의사용 중 문의사항은 [프로그램 사용법 Q&A] 게시판에서 [예스나 AI] 카테고리를 설정 후 문의해 주시면 상세히 안내해 드리겠습니다.--------------------------------------------------앞으로도 AI를 활용한 다양한 트레이딩 기능들을 지속적으로 선보일 예정입니다.많은 관심과 기대 부탁드립니다.
2026-02-27
5457
글번호 230811
답변완료
종목검색 순서
안녕하세요.
수식을 만들고 있습니다.
궁금한 것은 240일 이평선을 기준으로 최근 20봉 이내에 최저가와 최고가를 비교, 즉 [240일 이평선과 최저 저가의 이격률] vs [240일 이평선과 최고 종가 이격률]을 비교해서 최저가 이격률보다 최고가 이격률이 높을 때 신호를 표시하려고 합니다.
그런데, 제가 생각하는 것을 만족하기 위해서는 [240일 이평선과 최저 저가의 이격률] 이 [240일 이평선과 최고 종가 이격률]보다 반드시 앞에 있어야 합니다.
순서가 바뀌면 안되서요.. 혹시 방법이 있을까요?
가능하시면 condition1=~~ 형태로 부탁 드립니다.
도움에 늘 감사합니다.
좋은 하루 보내세요.
2025-09-20
378
글번호 194160
답변완료
변환 부탁드립니다.
BB=BBandsUp(20,2);
Hs=HighestSince(1,date!=date(1),Bb);
Line=ValueWhen(1,date!=date(1),Hs(1));
signal=CrossUp(C,Line);
Cnt=CountSince(date!=date(1),Signal);
Cnt==1 && Cnt(1)==0
2025-09-19
292
글번호 194156
답변완료
지정시간
매수매도 신호가 정해진(9시 40부터 12시까지) 시간에만 작동되는 수식
밑에 예시가 작동 안되고 8시 50분에도 신호발생 오류 수정 부탁합니다
예시)
if Time >= 94000 and Time <= 120000 then
# 매수/매도청산
If entry < 1 and CrossUp(var1,Var3) Then
{
Buy("b");
}
2025-09-19
275
글번호 194154
답변완료
Data2 의 전일종가 데이터가 09시 1분까지는 전전일 종가를 입력받습니다.
안녕하세요! 항상 도움 많이 받고 있습니다. 감사합니다.
다름 아니고, 예스트레이더를 사용할 때, Data2나 Data3에서 전일종가를 입력받고 싶은데요.
그런데 09시 01분 전까지는 전일종가 데이터가 아니라 전전일 종가 데이터를 입력받습니다.
이거 수정할 수 있는 방법이 있을까요?
==================================================================
요약.
Data1의 CloseD(1)은 09시 01분 이전에도 전일종가를 정상적으로 입력 받는데,
Data3의 CloseD(1)인 Data3(CloseD(1))은 09시 01분 이전에는 전전일 종가를 입력받네요.
===================================================================
첨부 이미지 설명) 거래소 외국인 순매수금액
2024년 2월 5일 08:45부터
2024년 2월 2일 종가 데이터(전일종가)인 18,950 을 입력받고 싶은데,
2024년 2월 1일 종가 데이터(전전일종가)인 10,452 를 입력받고 있습니다.
2025-09-19
728
글번호 194147
2wnwn 님에 의해서 삭제되었습니다.
2025-09-19
49
글번호 194146
답변완료
검색식 부탁 드립니다
A= Disparity(Period2);
D=ValueWhen(1, crossup(A, 기준2) OR crossdown(A, 기준2) ,가격)
지표조건
period2 120
기준2 101
가격 (H+L)/2
주가가 D를 돌파했다 최근 7일사이 어느날에 종목 검색식 부탁드립니다
2025-09-19
326
글번호 194144
답변완료
종목검색식 요청드립니다.
당일 분봉에서 아래조건식을 만족했던 모든 종목을 검색하는 검색식으로 수정 부탁드리겠습니다. 그리고 1일전, 2일전, 3일전 등 n일전 종목검색도 가능하다면 부탁드리겠습니다. 항상 감사합니다.
* 예스트레이더 조건식
Input : PERIOD(20),N(5);
Var : 상승(False),하락(False),조건(False),조건1(False),TSF1(0),HV1(False),HV2(False),TH(0);
TsF1 = LRL(C,PERIOD)+LRS(C,PERIOD);
상승=TsF1>TsF1[1];
하락=TsF1<TsF1[1];
조건=CountIF(하락,N)==N && CountIF(상승[N],N)==N;
HV1=Highest(v,120)<=V;
HV2=Highest(v,240)<=V;
IF 조건 TheN
TH=TsF1[N];
조건1=Crossup(C,TH);
IF (조건1==True OR 조건1[1]==True) && (HV1 OR HV2) TheN
Find(1);
2025-09-19
309
글번호 194143
답변완료
종목검색식 요청드립니다.
아래 키움라인을 돌파하는 종목을 검색하는 검색식을 만들고 싶습니다. 도움 부탁드립니다.
* 키움수식라인 (조건 : 기간 20)
A = if(C > O, C, 0);
S = if(C > O, 1, 0);
AA = sum(A, 기간);
SS = sum(S, 기간);
if(AA == 0 or SS == 0, C(기간 - 1), AA / SS)
2025-09-19
306
글번호 194142
답변완료
지표 변환 부탁드립니다.
// This work is licensed under a Attribution-NonCommercial-ShareAlike 4.0 International (CC BY-NC-SA 4.0) https://creativecommons.org/licenses/by-nc-sa/4.0/
// © LuxAlgo
//@version=5
indicator("Supply and Demand Visible Range [LuxAlgo]", overlay = true, max_boxes_count = 500, max_bars_back = 500)
//------------------------------------------------------------------------------
//Settings
//-----------------------------------------------------------------------------{
per = input.float(10., 'Threshold %', minval = 0, maxval = 100)
div = input.int(50, 'Resolution' , minval = 2, maxval = 500)
tf = input.timeframe('', 'Intrabar TF')
//Colors
showSupply = input(true ,'Supply        ', inline = 'supply', group = 'Style')
supplyCss = input(#2157f3, '' , inline = 'supply', group = 'Style')
supplyArea = input(true ,'Area' , inline = 'supply', group = 'Style')
supplyAvg = input(true ,'Average' , inline = 'supply', group = 'Style')
supplyWavg = input(true ,'Weighted' , inline = 'supply', group = 'Style')
showEqui = input(true ,'Equilibrium' , inline = 'equi' , group = 'Style')
equiCss = input(color.gray, '' , inline = 'equi' , group = 'Style')
equiAvg = input(true ,'Average' , inline = 'equi' , group = 'Style')
equiWavg = input(true ,'Weighted' , inline = 'equi' , group = 'Style')
showDemand = input(true ,'Demand    ' , inline = 'demand', group = 'Style')
demandCss = input(#ff5d00, '' , inline = 'demand', group = 'Style')
demandArea = input(true ,'Area' , inline = 'demand', group = 'Style')
demandAvg = input(true ,'Average' , inline = 'demand', group = 'Style')
demandWavg = input(true ,'Weighted' , inline = 'demand', group = 'Style')
//-----------------------------------------------------------------------------}
//UDT's
//-----------------------------------------------------------------------------{
type bin
float lvl
float prev
float sum
float prev_sum
float csum
float avg
bool isreached
type area
box bx
line avg
line wavg
//-----------------------------------------------------------------------------}
//Functions
//-----------------------------------------------------------------------------{
n = bar_index
get_hlv()=> [high, low, volume]
method set_area(area id, x1, top, btm, avg, wavg, showArea, showAvg, showWavg)=>
if showArea
id.bx.set_lefttop(x1, top)
id.bx.set_rightbottom(n, btm)
if showAvg
id.avg.set_xy1(x1, avg)
id.avg.set_xy2(n, avg)
if showWavg
id.wavg.set_xy1(x1, wavg)
id.wavg.set_xy2(n, wavg)
//-----------------------------------------------------------------------------}
//Main variables
//-----------------------------------------------------------------------------{
var max = 0.
var min = 0.
var x1 = 0
var csum = 0.
//Intrabar data
[h, l, v] = request.security_lower_tf(syminfo.tickerid, tf, get_hlv())
//Init on left bar
if time == chart.left_visible_bar_time
max := high
min := low
csum := volume
x1 := n
else //Accumulate
max := math.max(high, max)
min := math.min(low, min)
csum += volume
//-----------------------------------------------------------------------------}
//Set zones
//-----------------------------------------------------------------------------{
var supply_area = area.new(
box.new(na, na, na, na, na, bgcolor = color.new(supplyCss, 80))
, line.new(na, na, na, na, color = supplyCss)
, line.new(na, na, na, na, color = supplyCss, style = line.style_dashed))
var demand_area = area.new(
box.new(na, na, na, na, na, bgcolor = color.new(demandCss, 80))
, line.new(na, na, na, na, color = demandCss)
, line.new(na, na, na, na, color = demandCss, style = line.style_dashed))
var equi = line.new(na, na, na, na, color = equiCss)
var wequi = line.new(na, na, na, na, color = equiCss, style = line.style_dashed)
var float supply_wavg = na
var float demand_wavg = na
if time == chart.right_visible_bar_time
r = (max - min) / div
supply = bin.new(max, max, 0, 0, 0, 0, false)
demand = bin.new(min, min, 0, 0, 0, 0, false)
//Loop trough intervals
for i = 0 to div-1
supply.lvl -= r
demand.lvl += r
//Accumulated volume column
if not supply.isreached and showSupply and supplyArea
box.new(x1, supply.prev, x1 + int(supply.sum / csum * (n - x1)), supply.lvl, na
, bgcolor = color.new(supplyCss, 50))
if not demand.isreached and showDemand and demandArea
box.new(x1, demand.lvl, x1 + int(demand.sum / csum * (n - x1)), demand.prev, na
, bgcolor = color.new(demandCss, 50))
//Loop trough bars
for j = 0 to (n - x1)-1
//Loop trough intrabars
for k = 0 to (v[j]).size()-1
//Accumulate if within upper internal
supply.sum += (h[j]).get(k) > supply.lvl and (h[j]).get(k) < supply.prev ? (v[j]).get(k) : 0
supply.avg += supply.lvl * (supply.sum - supply.prev_sum)
supply.csum += supply.sum - supply.prev_sum
supply.prev_sum := supply.sum
//Accumulate if within lower interval
demand.sum += (l[j]).get(k) < demand.lvl and (l[j]).get(k) > demand.prev ? (v[j]).get(k) : 0
demand.avg += demand.lvl * (demand.sum - demand.prev_sum)
demand.csum += demand.sum - demand.prev_sum
demand.prev_sum := demand.sum
//Test if supply accumulated volume exceed threshold and set box
if supply.sum / csum * 100 > per and not supply.isreached
avg = math.avg(max, supply.lvl)
supply_wavg := supply.avg / supply.csum
//Set Box/Level coordinates
if showSupply
supply_area.set_area(x1, max, supply.lvl, avg, supply_wavg, supplyArea, supplyAvg, supplyWavg)
supply.isreached := true
//Test if demand accumulated volume exceed threshold and set box
if demand.sum / csum * 100 > per and not demand.isreached and showDemand
avg = math.avg(min, demand.lvl)
demand_wavg := demand.avg / demand.csum
//Set Box/Level coordinates
if showDemand
demand_area.set_area(x1, demand.lvl, min, avg, demand_wavg, demandArea, demandAvg, demandWavg)
demand.isreached := true
if supply.isreached and demand.isreached
break
if supply.isreached and demand.isreached and showEqui
//Set equilibrium
if equiAvg
avg = math.avg(max, min)
equi.set_xy1(x1, avg)
equi.set_xy2(n, avg)
//Set weighted equilibrium
if equiWavg
wavg = math.avg(supply_wavg, demand_wavg)
wequi.set_xy1(x1, wavg)
wequi.set_xy2(n, wavg)
break
supply.prev := supply.lvl
demand.prev := demand.lvl
//-----------------------------------------------------------------------------}
2025-09-19
949
글번호 194141