커뮤니티
예스랭귀지 Q&A
답변완료
[공지] 예스랭귀지 AI 어시스턴트, '예스나 AI' 출시 및 무료 체험 안내
안녕하세요, 예스스탁 입니다.복잡한 수식 공부 없이 여러분의 아이디어를 말하면 시스템 트레이딩 언어 예스랭귀지로 작성해주는 서비스예스나 AI(YesNa AI)가 출시되었습니다.지금 예스나 AI를 직접 경험해 보실 수 있도록 20크레딧(질문권 20회)를 무료로 증정해 드리고 있습니다.바로 여러분의 아이디어를 코드로 변환해보세요.--------------------------------------------------🚀 YesNa AI 핵심 기능- 지표식/전략식/종목검색식 생성: 자연어로 요청하면 예스랭귀지 문법에 맞는 코드를 작성합니다.- 종목검색식 변환 지원: K증권의 종목 검색식을 예스랭귀지로 변환 지원합니다.- 컴파일 검증: 작성된 코드가 실행 가능한지 컴파일러를 통해 문법 검증을 거쳐 결과물을 제공합니다.상세한 서비스 개요 및 활용 방법은 [서비스 소개 페이지]에서 확인하실 수 있습니다.▶ 서비스 소개 페이지: 바로가기서비스 사용 유의사항 및 결제 환불정책은 [이용약관]을 참고 부탁드립니다.▶ 서비스 이용약관: 바로가기💬 이용 문의사용 중 문의사항은 [프로그램 사용법 Q&A] 게시판에서 [예스나 AI] 카테고리를 설정 후 문의해 주시면 상세히 안내해 드리겠습니다.--------------------------------------------------앞으로도 AI를 활용한 다양한 트레이딩 기능들을 지속적으로 선보일 예정입니다.많은 관심과 기대 부탁드립니다.
2026-02-27
1719
글번호 230811
답변완료
수식 문의드립니다
안녕하세요 수식 문의드립니다(3분봉 기준)
0.매수진입시점: 골든크로스(정배열), 양봉이 5일선을 터치, 그 양봉의 종가진입
0.매도진입시점: 데드크로스(역배열), 음봉이 5일선을 터치, 그 음봉의 종가진입
0 매수 강제청산: 현재봉을 포함하여 20봉중 최저가격보다 5틱 이하시 청산
0.매도 강제청산: 현재봉을 포함하여 20봉중 최고가격보다 5틱 이하시 청산
0.손절: 진입가격대비 -100틱 청산
0.익절: 진입가격대비 +150틱 청산
2024-08-19
762
글번호 182605
답변완료
안녕하세요 수식 좀 문의드립니다.
안녕하세요 수식 좀 문의 드립니다.
아래 코드에서 print문으로 엑셀에 데이터를 저장하고 있는데요
주로 실시간에서.. 차트는 5분봉으로 되어 있는데 5분마다 데이터가 들어오는게 아니고 불규칙적으로 데이터가 들어오는데 봉이 완성되는 5분마다만 데이터를 받게 수정할수 있을까요?
var : var11(0),var12(0),var13(0),var14(0),var15(0),var1(0),var2(0);
var : var21(0),var22(0),var23(0),var24(0),var25(0);
var : var31(0),var32(0),var33(0),var34(0),var35(0),var36(0);
input : StartDate(20240702),EndDate(20240814);
input : StartTime(090000),EndTime(150000);
var : Tcond(false);
if (sdate != sdate[1] and stime >= StartTime) or
(sdate == sdate[1] and stime >= StartTime and stime[1] < StartTime) Then
{
Tcond = true;
}
if (sdate != sdate[1] and stime >= EndTime) or
(sdate == sdate[1] and stime >= EndTime and stime[1] < EndTime) Then
{
Tcond = False;
}
if sDate >= StartDate and sDate <= EndDate and Tcond == true Then
{
var11 = Data2(c);
var12 = Data3(c);
var13 = Data4(c);
var14 = Data5(c);
var21 = Data6(c);
var22 = Data7(c);
var23 = Data8(c);
var24 = Asks;
var25 = Bids;
var31 = Upvol;
var32 = DownVol;
var33 = openinterest;
var34 = var33[1]-var33 ;
if (abs(Var21[1]-Var21)) < 50000 Then var15 =(Var21[1]-Var21); Else var15 =0;
var2= var11-Var32;
var1= var13-Var31;
#print("c:₩win₩data.csv",",날짜,%f,,시간,%f,,시,%.2f,,고,%.2f,,저,%.2f,,종,%.2f,,거래량,%f,,미결제,%f,,비차익,%f,,매수수량,%2f,,매수건수,%.f,,매도수량,%.f,,매도건수,%.f,,매도총건수,%.f,,매수총건수,%.f,,매도총수량,%.f,,매수총건수,%.f,,상승체결,%.f,,하락체결,%.f",sDate,sTime,O,H,L,C,V,var34,var15,var11,var12,var13,var14,var22,var23,var24,var25,var31,var32);
print("c:₩win₩data.csv",",거래량,%f,시,%.2f,고,%.2f,저,%.2f,종,%.2f,미결제,%f,비차익,%f,매수수량,%2f,매수건수,%.f,매도수량,%.f,매도건수,%.f,매도총건수,%.f,매수총건수,%.f,매도총수량,%.f,매수총건수,%.f,상승체결,%.f,하락체결,%.f,상승건수,%.f,하락건수,%.f,체결건수,%.f,상승제외,%.f,하락제외,%.f,",V,O,H,L,C,V,var34,var15,var11,var12,var13,var14,var22,var23,var24,var25,var31,var32,Upticks,Downticks,Ticks,Var1,Var2);
Plot1(var34, "미결제약정");
Plot2(var11,"매수5호가수량");
Plot3(var12,"매수5호가건수");
Plot4(var13,"매도호5호가수량");
Plot5(var14,"매도5호가건수");
Plot6(var15,"비차익");
Plot7(var22,"매도총건수");
Plot8(var23,"매수총건수");
Plot9(var24,"매도총수량");
Plot10(var25,"매수총건수");
Plot11(var31,"상승체결");
Plot12(var32,"하락체결");
#Plot13(var15, "비차익2");
}
2024-08-19
860
글번호 182604
답변완료
수식 해석 관련해서 질문드립니다
공부를 하다가 해석이 안되는 부분이 있어서 여쭤보고 싶습니다.
For cnt = 0 to n-1
{
if hh == 0 or (hh > 0 and h[cnt] > hh) Then
{
hh = h[cnt];
hb = cnt;
}
if ll == 0 or (ll > 0 and l[cnt] < ll) Then
{
ll = l[cnt];
lb = cnt;
} }
수식중에서 위 수식처럼 for 문으로 cnt 하는 조건문에서 array 가 아닌 if ~ then 이 들어가는 조건문이 있는가 하면
input : N(5);
var : cnt(0),hh(0);
Array : HV[50](0);
if Bdate != Bdate[1] Then
{
For cnt = 49 DownTo 1
{
HV[cnt] = HV[cnt-1];
}
HV[0] = 0;
}
if DayClose(1)*1.2 >= C and C >= DayClose(1)*0.95 Then
{
if HV[0] == 0 or (HV[0] > 0 and V > HV[0]) Then
HV[0] = V;
}
hh = 0;
For cnt = 0 to N-1
{
if HV[cnt] > 0 and (hh == 0 or (hh > 0 and HV[cnt] > hh)) Then
hh = HV[cnt];
}
Plot1(HV[0],"당일");
plot2(HH,"N일최고");
위 식처럼 배열로 cnt 하는 수식이 있는데 어떨때 쓰는건지 궁금합니다
그리고 위 수식의 내용은 아래와 같은데 해석을 좀 해주셨으면 합니다
특히
For cnt = 49 DownTo 1
{
HV[cnt] = HV[cnt-1];
}
HV[0] = 0;
이부분이 잘 이해가 안갑니다 array 를 통해 무엇을 구하려는 것인지 궁금하며,
if DayClose(1)*1.2 >= C and C >= DayClose(1)*0.95 Then
{
if HV[0] == 0 or (HV[0] > 0 and V > HV[0]) Then
HV[0] = V;
#이부분에서는 위의 array cnt 에서 구한 값과 어떤 관계인지요???
}
hh = 0;
For cnt = 0 to N-1
{
if HV[cnt] > 0 and (hh == 0 or (hh > 0 and HV[cnt] > hh)) Then
hh = HV[cnt];
}
그리고 이 조건에서는 발생한 최대거래량을 구하고, 5일간의 최대치를 구하는 부분인데 어떤 원리인지 잘 모르겠습니다. 도와주세요
수식 조건:
분봉 차트에서,
수식1) 현재가가 전일종가 대비 -5% 이상, +20% 이하인 구간에서 당일발생 된 최대거래량.
수식2) 4일전, 3일전, 2일전, 1일전, 0일전에서 (총5일간) 가장 큰 수식1의 수치.
2024-08-19
831
글번호 182593
답변완료
부탁드립니다.
트레이딩뷰 지표인데 변환 부탁드립니다.
2가지 지표입니다.
1번째 지표 : BUY & SELL VOLUME TO PRICE PRESSURE
signal = input(title="Base for FastMA Periods:", type=integer, defval=3)
long = input(title="Buy to Sell Conv/Div Lookback:", type=integer, defval=27)
vmacd = input(true, title="Buy to Sell Convergence/Div OSC:")
vinv = input(false, title="Buy to Sell Conv/Div as cummulative:")
norm = input(false, title="Normalised (Filtered) Version:")
//vapi = input(false, title="Display Acc/Dist % :")
vol = iff(volume > 0, volume , 1)
// PRESSURE ALGORITHMS AND VARIABLES
TR = atr(1)
// Bull And Bear "Power-Balance" by Vadim Gimelfarb Algorithm's
BP = iff(close<open, iff(close[1]<open, max(high-close[1], close-low),
max(high-open, close-low)),
iff(close>open, iff(close[1]>open, high-low,
max(open-close[1], high-low)),
iff(high-close>close-low, iff(close[1]<open, max(high-close[1],close-low),
high-open),
iff(high-close<close-low, iff(close[1]>open, high-low,
max(open-close[1], high-low)),
iff(close[1]>open, max(high-open, close-low),
iff(close[1]<open, max(open-close[1], high-low),
high-low))))))
SP = iff(close<open, iff(close[1]>open, max(close[1]-open, high-low),
high-low),
iff(close>open, iff(close[1]>open, max(close[1]-low, high-close),
max(open-low, high-close)),
iff(high-close>close-low, iff(close[1]>open, max(close[1]-open, high-low),
high-low),
iff(high-close<close-low, iff(close[1]>open, max(close[1]-low, high-close),
open-low),
iff(close[1]>open, max(close[1]-open, high-low),
iff(close[1]<open, max(open-low, high-close),
high-low))))))
TP = BP+SP
// RAW Pressure Volume Calculations
BPV = (BP/TP)*vol
SPV = (SP/TP)*vol
TPV = BPV+SPV
BPVavg = ema(ema(BPV,signal),signal)
SPVavg = ema(ema(SPV,signal),signal)
TPVavg = ema(wma(TPV,signal),signal)
//
VN = vol/ema(vol,long)
BPN = ((BP/ema(BP,long))*VN)*100
SPN = ((SP/ema(SP,long))*VN)*100
TPN = BPN+SPN
nbf = ema(wma(BPN,signal),signal)
nsf = ema(wma(SPN,signal),signal)
tpf = ema(wma(TPN,signal),signal)
ndif = nbf-nsf
//
BPc1 = BPV>SPV ? BPV : -abs(BPV)
BPc2 = BPN>SPN ? BPN : -abs(BPN)
SPc1 = SPV>BPV ? SPV : -abs(SPV)
SPc2 = SPN>BPN ? SPN : -abs(SPN)
BPcon = norm ? BPc2 : BPc1
SPcon = norm ? SPc2 : SPc1
BPAcon = norm ? nbf : BPVavg
SPAcon = norm ? nsf : SPVavg
TPAcon = norm ? tpf : TPVavg
// Volume Pressure Convergence Divergence by XeL_Arjona
vpo1 = vinv ? (( sum(BPVavg,long)-sum(SPVavg,long))/sum(TPVavg,long))*100 : ((BPVavg-SPVavg)/TPVavg)*100
vpo2 = vinv ? (( sum(nbf,long)-sum(nsf,long))/sum(tpf,long))*100 : ((nbf-nsf)/tpf)*100
vph = nz((vpo1 - vpo2),0)
// Plot Indicator
histC = vph > vph[1] ? blue:#BA00AA
Vpo1C = vpo1 > 0 ? green:red
Vpo2C = vpo2 > 0 ? green:red
plot(vmacd ? na:SPcon, color=red, title="SELLING", style=columns, linewidth=3, transp=80)
plot(vmacd ? na:BPcon, color=green, title="BUYING", style=columns, linewidth=3, transp=80)
plot(vmacd ? na:SPAcon, color=red, title="SPAvg", style=line, linewidth=2) //ema(BearPower*SPV,signal)
plot(vmacd ? na:BPAcon, color=green, title="BPAvg", style=line, linewidth=2) //ema(BullPower*BPV,signal)
plot(vmacd ? vpo1:na, color=Vpo1C,title="VPO1", style=line, linewidth=3)
plot(vmacd ? vpo2:na, color=Vpo2C,title="VPO2", style=line, linewidth=1)
plot(vmacd ? vph:na, color=histC, title="VPH", style=columns, linewidth=3, transp=90)
2번째 지표 : Buy or Sell Signal
Factor=input(3, minval=1,maxval = 140)
Pd=input(80, minval=1,maxval = 140)
Up=hl2-(Factor*atr(Pd))
Dn=hl2+(Factor*atr(Pd))
TrendUp=close[1]>TrendUp[1]? max(Up,TrendUp[1]) : Up
TrendDown=close[1]<TrendDown[1]? min(Dn,TrendDown[1]) : Dn
Trend = close > TrendDown[1] ? 1: close< TrendUp[1]? -1: nz(Trend[1],1)
Tsl = Trend==1? TrendUp: TrendDown
linecolor = Trend == 1 ? green : red
plot(Tsl, color = linecolor , style = line , linewidth = 2,title = "SuperTrend")
plotshape(cross(close,Tsl) and close>Tsl , "Up Arrow", shape.triangleup,location.belowbar,green,0,0)
plotshape(cross(Tsl,close) and close<Tsl , "Down Arrow", shape.triangledown , location.abovebar, red,0,0)
//plot(Trend==1 and Trend[1]==-1,color = linecolor, style = circles, linewidth = 3,title="Trend")
plotarrow(Trend == 1 and Trend[1] == -1 ? Trend : na, title="Up Entry Arrow", colorup=lime, maxheight=60, minheight=50, transp=0)
plotarrow(Trend == -1 and Trend[1] == 1 ? Trend : na, title="Down Entry Arrow", colordown=red, maxheight=60, minheight=50, transp=0)
2024-08-18
1041
글번호 182592
답변완료
지표식 과 종가상 이선 이하인 종목검색식
A=lowest(v , 10 );
valuewhen(1, v==A , L ) 위지표 식과
종가가 위지표선 이하인 종목검색 식 부탁드립니다.
2024-08-18
777
글번호 182591
답변완료
data 값에 자연수를 곱할수는 없나요?
예를 들어 data(1)*20 으로는 수식을 작성할수 없나요?
2024-08-18
1025
글번호 182590
답변완료
종목검색
선행스팬2=(highest(high,52)+lowest(low,52))/2,26-1;
선행스팬1=(highest(high,9)+lowest(low,9)+highest(high,26)+lowest(low,26))/4,26-1;
조건=선행스팬2 > 선행스팬2(1) && 선행스팬1 > 선행스팬2;
AA=SAR(0.02, 0.2);
조건 && !조건(1) && C>O && AA<C
감사합니다
2024-08-17
743
글번호 182589
답변완료
종목검색
Crossup(DIPLUS(20), DIMINUS(20))&&
ADX(20)>20&&
DIPLUS(20)>DIPLUS(50)
감사합니다
2024-08-17
820
글번호 182588
답변완료
예스트레이더 종목검색으로 요청합니다.
항상 도움을 주셔서 고맙고 감사합니다...
아래수식을 예스트레이더 종목검색으로 작성부탁드립니다.
조건은 일봉조건이며,추가조건으로 캔들이 일목균형표 음운구름대를 돌파할때 조건하고MACD가 0선위에 있거나 또는 macd가 0선에 1~2%이내 근접하고 MACD가 macd 시그널 위에있을때, 단순이평 20일선이 60일선 돌파하거나 또는 단순이평 20일선이 60일선에 1~3%이내 근접하는 조건까지 추가해 주시면 고맙겠습니다...
A=(((highest(high,longPeriod)+lowest(low,longPeriod
))/2
+BBandsUp(Period,D1))/2
+
((highest(high,longPeriod)+lowest(low,longPeriod))/2
+BBandsDown(Period,D1))/2)/2;
B=(highest(high,shortPeriod)+lowest(low,shortPeriod))/2;
CROSSUP(B,A) && C>O
*지표변수
longPeriod ; 52
period : 14
D1 : 5
shortperiod : 9
2024-08-18
804
글번호 182587