커뮤니티
예스랭귀지 Q&A
답변완료
[공지] 예스랭귀지 AI 어시스턴트, '예스나 AI' 출시 및 무료 체험 안내
안녕하세요, 예스스탁 입니다.복잡한 수식 공부 없이 여러분의 아이디어를 말하면 시스템 트레이딩 언어 예스랭귀지로 작성해주는 서비스예스나 AI(YesNa AI)가 출시되었습니다.지금 예스나 AI를 직접 경험해 보실 수 있도록 20크레딧(질문권 20회)를 무료로 증정해 드리고 있습니다.바로 여러분의 아이디어를 코드로 변환해보세요.--------------------------------------------------🚀 YesNa AI 핵심 기능- 지표식/전략식/종목검색식 생성: 자연어로 요청하면 예스랭귀지 문법에 맞는 코드를 작성합니다.- 종목검색식 변환 지원: K증권의 종목 검색식을 예스랭귀지로 변환 지원합니다.- 컴파일 검증: 작성된 코드가 실행 가능한지 컴파일러를 통해 문법 검증을 거쳐 결과물을 제공합니다.상세한 서비스 개요 및 활용 방법은 [서비스 소개 페이지]에서 확인하실 수 있습니다.▶ 서비스 소개 페이지: 바로가기서비스 사용 유의사항 및 결제 환불정책은 [이용약관]을 참고 부탁드립니다.▶ 서비스 이용약관: 바로가기💬 이용 문의사용 중 문의사항은 [프로그램 사용법 Q&A] 게시판에서 [예스나 AI] 카테고리를 설정 후 문의해 주시면 상세히 안내해 드리겠습니다.--------------------------------------------------앞으로도 AI를 활용한 다양한 트레이딩 기능들을 지속적으로 선보일 예정입니다.많은 관심과 기대 부탁드립니다.
2026-02-27
3382
글번호 230811
답변완료
수식 전환 부탁드립니다
지표 수식 2개 변환부탁드립니다
감사합니다
study("Volatility Stop", "VStop", overlay=true, resolution="")
length = input(20, "Length", minval = 2)
src = input(close, "Source")
factor = input(2.0, "Multiplier", minval = 0.25, step = 0.25)
Barcolor=input(true)
volStop(src, atrlen, atrfactor) =>
var max = src
var min = src
var uptrend = true
var stop = 0.0
atrM = nz(atr(atrlen) * atrfactor, tr)
max := max(max, src)
min := min(min, src)
stop := nz(uptrend ? max(stop, max - atrM) : min(stop, min + atrM), src)
uptrend := src - stop >= 0.0
if uptrend != nz(uptrend[1], true)
max := src
min := src
stop := uptrend ? max - atrM : min + atrM
[stop, uptrend]
[vStop, uptrend] = volStop(src, length, factor)
plot(vStop, "Volatility Stop", color= uptrend ? #007F0E : #872323,linewidth=2)
colors=iff(close>vStop,#008000,iff(close<vStop,#FF0000,color.black))
barcolor(Barcolor ? colors :na)
Buy=crossover(close,vStop)
Sell=crossunder(close,vStop)
plotshape(Buy,"BUY", shape.labelup, location.belowbar, color.green, text="BUY",textcolor=color.black)
plotshape(Sell,"SELL", shape.labeldown, location.abovebar, color.red, text="SELL",textcolor=color.black)
alertcondition(Buy, "Buy Signal", "Buy ATR Trailing Stop")
alertcondition(Sell, "Sell Signal", "Sell ATR Trailing Stop")
2번째 수식입니다
tudy("Braid Filter")
//-- Inputs
maType = input("EMA", "MA Type", options = ["EMA", "DEMA", "TEMA", "WMA", "VWMA", "SMA", "SMMA", "HMA", "LSMA", "Kijun", "McGinley", "RMA"])
Period1 = input(3, "Period 1")
Period2 = input(7, "Period 2")
Period3 = input(14, "Period 3")
PipsMinSepPercent = input(40)
//-- Moving Average
ma(type, src, len) =>
float result = 0
if type=="SMA" // Simple
result := sma(src, len)
if type=="EMA" // Exponential
result := ema(src, len)
if type=="DEMA" // Double Exponential
e = ema(src, len)
result := 2 * e - ema(e, len)
if type=="TEMA" // Triple Exponential
e = ema(src, len)
result := 3 * (e - ema(e, len)) + ema(ema(e, len), len)
if type=="WMA" // Weighted
result := wma(src, len)
if type=="VWMA" // Volume Weighted
result := vwma(src, len)
if type=="SMMA" // Smoothed
w = wma(src, len)
result := na(w[1]) ? sma(src, len) : (w[1] * (len - 1) + src) / len
if type == "RMA"
result := rma(src, len)
if type=="HMA" // Hull
result := wma(2 * wma(src, len / 2) - wma(src, len), round(sqrt(len)))
if type=="LSMA" // Least Squares
result := linreg(src, len, 0)
if type=="Kijun" //Kijun-sen
kijun = avg(lowest(len), highest(len))
result :=kijun
if type=="McGinley"
mg = 0.0
mg := na(mg[1]) ? ema(src, len) : mg[1] + (src - mg[1]) / (len * pow(src/mg[1], 4))
result :=mg
result
//-- Braid Filter
ma01 = ma(maType, close, Period1)
ma02 = ma(maType, open, Period2)
ma03 = ma(maType, close, Period3)
max = max(max(ma01, ma02), ma03)
min = min(min(ma01, ma02), ma03)
dif = max - min
filter = atr(14) * PipsMinSepPercent / 100
//-- Plots
BraidColor = ma01 > ma02 and dif > filter ? color.green : ma02 > ma01 and dif > filter ? color.red : color.gray
plot(dif, "Braid", BraidColor, 5, plot.style_columns)
plot(filter, "Filter", color.blue, 2, plot.style_line)
bgcolor(BraidColor)
2023-04-03
1478
글번호 167878
답변완료
수고 부탁드립니다
안녕하세요~~진행하다보니 추가도움이 필요해지네요~
input : 틱수1(50),틱수2(80);
var1 = ma(C,5);
Var2 = ma(C,20);
if var1 > Var2 Then buy("매수1진입");
if MarketPosition == 0 and
IsExitName("매수2청",1) == true and
C <= ExitPrice(1)-PriceScale*틱수1 and
var1 > Var2 Then buy("매수2진입");
if MarketPosition == 1 Then{
if var1 < Var2 Then exitlong("매수1청산");
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
if PositionProfit(0) < 0 and Var1 <= lowest(Var1,20)
Then exitlong("매수2청산");
}
~~~~~~~~~~~~~~~~~~질문~1~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
~~위수식에서~~
매수1진과 매수2진~~ 매수1청과 매수2청 4개중에서~~
매수2진으로 진입한것만은 (매수1청은 작동되고) 매수2청~으로는 청산 미적용!!
하고 싶읍니다
(매수2진입은 매수2청not 처럼)이름지명해서 통체로 적용안되게 해주시면 제일좋고요
만약 미적용 이름지명이 안되면~~~
(1진입이던 2진입이던~)진입가보다 손실이 났고~and
직전 매수1~이나 2진입으로 진입된가격보다 50틱~80틱사이 하락 (80틱하락 넘어면안되고)
~and Var1 <= lowest(Var1,20) Then exitlong("매수2청산");
~~~~~~~~~~~~~~~~~~~~~질문~2~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
(일반적인 수식 아래2개에서 바로 각각 청산대상만을 진입지명만으로 통체로~~
지정할수는 없을까요??~~~
if PositionProfit(0) < 0 and 손절 <= lowest(손절,100)
Then exitlong("매수1청"); ------>> 청산대상을 매수1진입과~~매수2진입 적용!!
if MarketPosition == 1 and
IsEntryName("2매수",0) == true and
C <= EntryPrice(1)-PriceScale*틱수2 and
var1/Var2*100 >= 110 Then
ExitLong("매수2청산"); ~~~~~~>> 청산대상을 매수2입것만~~적용!!
수고 부탁드립니다~~
2023-04-04
1752
글번호 167877
답변완료
이평매매수식 부탁드립니다.
나스닥거래 합니다.
1.이평은 10,20,60이평 사용
2.시간매매용으로 07부터 17시까지는 10/20 크로스에 한개진입하고 물타기로 +-40틱에서 물타기 한개 하여 전부 신호 청산합니다.
3.17시부터 새벽 05시까지는 10/60이평 으로 크로스 매수매도 진입 1개진입 또한개 물타기 하여 신호 청산합니다.
4. 일중 매매수익이 20만원이 되면 즉시 보유 포지지션을 청산하고 시스템 종료합니다.
수고해 주세요.....
2023-04-03
1401
글번호 167876
답변완료
문의 드립니다.
당일 중심선을 기준으로 주가가 위에 있을 때 볼린져 20 2 상선 돌파 매수
당일 중심선을 기준으로 주가가 아래 있을 때 볼린져 20 2 하선 돌파 매도
부탁드립니다.
var1 = BollBandUp(20,2);
Var2 = BollBandDown(20,2);
if CrossUp(c,var1) Then
Buy();
if CrossDown(c,var1) Then
ExitLong();
if CrossDown(c,var2) Then
Sell();
if CrossUp(c,var2) Then
ExitShort();
2023-04-03
1721
글번호 167875
답변완료
재문의드립니다.
81538 제문의입니다.
첨부파일 처럼 숫자가 보이도록 부탁드립니다.
숫자 크기변경 가능 하도록 부탁드립니다.
2023-04-03
1745
글번호 167874
렉스턴 님에 의해서 삭제되었습니다.
2023-04-03
1
글번호 167873
답변완료
함수요청
안녕하세요?
답변주신 아래 글번호 81505에 진입횟수를 추가 하고 싶습니다.
아래와 같이 작성해보았는데 횟수 제어가 안됩니다.
input : 최대진입횟수(3);
input : P(20),dv(2);
var : bbmd(0),bbup(0),bbdn(0),bwidth(0);
Var : Entry(0);
bbmd = ma(c,P);
bbup = bbmd+std(c,P)*dv;
bbdn = bbmd-std(c,P)*dv;
Bwidth = (bbup-bbdn)/bbmd;
if Bdate != Bdate[1] Then
{
entry = 0;
}
If entry < 최대진입횟수 and C > bbmd and CountIf(Bwidth>Bwidth[1],2) == 2 Then
{
Buy();
}
If entry < 최대진입횟수 and C < bbmd and CountIf(Bwidth<Bwidth[1],2) == 2 Then
{
Sell();
}
if MarketPosition == 1 and CountIf(Bwidth<Bwidth[1],BarsSinceEntry) == 2 Then
ExitLong();
if MarketPosition == -1 and CountIf(Bwidth<Bwidth[1],BarsSinceEntry) == 2 Then
ExitShort();
SetStopEndofday(152000);
2023-04-03
1352
글번호 167872
돈뭉치 님에 의해서 삭제되었습니다.
2023-04-03
11
글번호 167867
답변완료
문의드립니다.
안녕하세요.
if c > o Then
value1 = v;
위 조건은 양봉일 때의 거래량을 구한 식입니다
양봉이 아닌 봉은 제외한
이전 양봉과 전전양봉, 전전전 양봉의 거래량을 구하는 식을 알려주세요.
2023-04-03
1404
글번호 167866