커뮤니티
예스랭귀지 Q&A
답변완료
[공지] 예스랭귀지 AI 어시스턴트, '예스나 AI' 출시 및 무료 체험 안내
안녕하세요, 예스스탁 입니다.복잡한 수식 공부 없이 여러분의 아이디어를 말하면 시스템 트레이딩 언어 예스랭귀지로 작성해주는 서비스예스나 AI(YesNa AI)가 출시되었습니다.지금 예스나 AI를 직접 경험해 보실 수 있도록 20크레딧(질문권 20회)를 무료로 증정해 드리고 있습니다.바로 여러분의 아이디어를 코드로 변환해보세요.--------------------------------------------------🚀 YesNa AI 핵심 기능- 지표식/전략식/종목검색식 생성: 자연어로 요청하면 예스랭귀지 문법에 맞는 코드를 작성합니다.- 종목검색식 변환 지원: K증권의 종목 검색식을 예스랭귀지로 변환 지원합니다.- 컴파일 검증: 작성된 코드가 실행 가능한지 컴파일러를 통해 문법 검증을 거쳐 결과물을 제공합니다.상세한 서비스 개요 및 활용 방법은 [서비스 소개 페이지]에서 확인하실 수 있습니다.▶ 서비스 소개 페이지: 바로가기서비스 사용 유의사항 및 결제 환불정책은 [이용약관]을 참고 부탁드립니다.▶ 서비스 이용약관: 바로가기💬 이용 문의사용 중 문의사항은 [프로그램 사용법 Q&A] 게시판에서 [예스나 AI] 카테고리를 설정 후 문의해 주시면 상세히 안내해 드리겠습니다.--------------------------------------------------앞으로도 AI를 활용한 다양한 트레이딩 기능들을 지속적으로 선보일 예정입니다.많은 관심과 기대 부탁드립니다.
2026-02-27
6966
글번호 230811
답변완료
알림창 크기 위치
알림창 크기와 위치를 옮길수 없나요
WIn10 알림들이 그자리에 생기는 것들이 많아서....
안보이고, 못보고, 겹치고 헷갈리네요.
안되겠죠?
2023-05-11
1443
글번호 168866
답변완료
수고많으십니다. 수식수정부탁드립니다.
수고 많으십니다.
전략실행챠트를 분할하여
하나의 챠트에는 영국파운드를 매도하고
같은 시간에 다른챠트에는 호주달러를 매수하는
시스템식을 시험적용하였습니다.
영국파운드마이크로
if Date==20230511 and Time==050000 Then
{
Sell("매도",AtMarket);
}
호주달러마이크로
if Date==20230511 and Time==050000 Then
{
Buy("매수",AtMarket);
}
매수도 매도도 체결되지 않았습니다.
수식수정부탁드립니다.
}
2023-05-11
1704
글번호 168865
답변완료
문의 드립니다.
indicator("SuperBollingerTrend (Expo)","",true,max_labels_count = 500)
//~~ Inputs {
int prd = input.int(12,"Period",minval=1,inline="setting")
float mult = input.float(2.0,"Mult",minval=0.1,step=.1,inline="setting", tooltip = "Set the Bollinger Band period. ₩n₩nSet the multiplier.")
bool showZigZag = input.bool(true,"ZigZag",inline="zigzag")
string signal = input.string("Signal","",["Signal","Peak Distance"],inline="zigzag")
string dev = input.string("ZigZag","",["ZigZag","High/Low","Close"],inline="zigzag", tooltip = "Enable the ZigZag Bollinger Signals. ₩n₩nSele;ct if you only want to display the signals or the Peak Signal Distance between each signal. ₩n₩nThe Signal Distance can be calculated using the ZigZag, High/Low, or Close.")
bool showTable = input.bool(false,"Average/Median Distance",inline="", tooltip = "Enable the Table that displays the Average or Median ZigZag move.")
bool showTP = input.bool(false,"Take Profit",inline="tp")
string Tp = input.string("Median","",["Median","Average"],inline="tp", tooltip = "Enable the Take-Profit line. ₩n₩nSele;ct if the TP should be based on the Average or Median move.")
//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~}
//~~ Types & Variables {
//Types
type ZigZag
int [] x1
float [] y1
float [] diff
type SuperBollingerTrend
float s
color c
type Alerts
bool Long = false
bool Short = false
bool LongTp = false
bool ShortTp = false
var zz = ZigZag.new(array.new<int>(),array.new<float>(),array.new<float>())
var sbt = SuperBollingerTrend.new(0.0,na)
alerted = Alerts.new()
//Variables
int b = bar_index
float bbup = ta.sma(high,prd)+ta.stdev(high,prd)*mult
float bbdn = ta.sma(low,prd)-ta.stdev(low,prd)*mult
//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~}
//~~ Methods{
//ZigZag
method zigzag(ZigZag z,c,p,l)=>
y2 = dev=="ZigZag"?sbt.s:
dev=="High/Low"?p:
close
if z.x1.size()>0
x1 = z.x1.get(0)
y1 = z.y1.get(0)
z.diff.unshift(math.abs(y2-y1))
line.new(x1,y1,b,y2,color=color.new(color.gray,0),style=line.style_dashed)
style = signal=="Signal"?(l?label.style_triangleup:label.style_triangledown) :
(l?label.style_label_up:label.style_label_down)
txt = signal=="Signal"?na : str.tostring(y2-y1,format.mintick)+"p"
label.new(b,sbt.s,txt,color=c,size=size.small,style=style,textcolor=chart.bg_color)
z.x1.unshift(b)
z.y1.unshift(y2)
//SuperBollingerTrend Calculation
method SBT(SuperBollingerTrend s,cond,val,col,p,l)=>
s.s := na(bbdn) or na(bbup)?0.0 : close>sbt.s?math.max(sbt.s,bbdn) : close<sbt.s?math.min(sbt.s,bbup) : 0.0
if cond
s.s := val
s.c := col
if showZigZag
zz.zigzag(col,p,l)
alerted.Long := l?true:false
alerted.Short := l?false:true
//Run Methods
sbt.SBT(ta.crossover(close,sbt.s),bbdn,color.lime,low,true)
sbt.SBT(ta.crossunder(close,sbt.s),bbup,color.red,high,false)
//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~}
//~~ Plot & Table {
//Plot
plot(sbt.s,"SuperBollingerTrend",sbt.c)
//TP Line
var tp = line.new(na,na,na,na,color=color.lime)
var ltp = label.new(na,na,"TP",color=color(na),style=label.style_label_left,textcolor=chart.fg_color,size=size.normal)
dist = Tp=="Median"?zz.diff.median():zz.diff.avg()
if showTP and zz.y1.size()>0
pos = close>sbt.s?true:false
x = zz.x1.get(0)
y = pos?zz.y1.get(0)+dist:zz.y1.get(0)-dist
tp.set_xy1(x,y)
tp.set_xy2(b+10,y)
ltp.set_xy(b+10,y)
alerted.LongTp := pos?high>=y and high[1]<y:false
alerted.ShortTp := pos?false:low<=y and low[1]>y
//Table
var table tbl = na
if barstate.islast and showZigZag and showTable
tbl := table.new(position.top_right, 1, 1, chart.bg_color,
frame_color=color.new(color.gray,50), frame_width=3, border_width=1)
tbl.cell(0,0,Tp=="Median"?"Median ZigZag Distance: "+str.tostring(dist,format.mintick)+"p":"Avg ZigZag Distance: "+str.tostring(dist,format.mintick)+"p",text_color=chart.fg_color)
//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~}
//~~ Alerts {
alertcondition(alerted.Long,"Long Alert","Long Signal")
alertcondition(alerted.Short,"Short Alert","Short Signal")
alertcondition(alerted.LongTp,"Long TP Alert","Long TP")
alertcondition(alerted.ShortTp,"Short TP Alert","Short TP")
//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~}
트레이딩뷰 지표입니다.
예스로 전환이 될까요?
된다면 라인선만 예스로 바꿔주세요.
nSele;ct에서 ; 빼야 됩니다.
2023-05-11
1701
글번호 168864
답변완료
수식 작성 부탁드립니다
마찬가지로 트뷰입니다. 예스랭귀지도 dmi는 내장되어 있지만 변형해서 쓰다보니 따로 개인함수가 필요합니다. 미리 감사드립니다. 작성해주신 것 보면서 많이 배우고 있습니다
STR_dmi_len = input.int(defval=29, title="DMI Length")
STR_adx_len = input.int(defval=18, title="ADX period")
F_STR(dmi_len, adx_len)=>
up = ta.change(high)
down = -ta.change(low)
truerange = ta.rma(ta.tr, dmi_len)
plus = fixnan(100 * ta.rma(up > down and up > 0 ? up : 0, dmi_len) / truerange)
minus = fixnan(100 * ta.rma(down > up and down > 0 ? down : 0, dmi_len) / truerange)
sum = plus + minus
adx = 100 * ta.rma(math.abs(plus - minus) / (sum == 0 ? 1 : sum), adx_len)
strength = (adx-1)*12
[strength, adx, plus, minus]
[Strength, STR_adx, STR_plus, STR_minus] = F_STR(STR_dmi_len, STR_adx_len)
2023-05-10
1347
글번호 168863
답변완료
문의 드립니다.~~~~
수고하십니다.
아래식으로 cme종목과 항생지수를 거래할 때
정해진 시간대에서만 진입하도록 하려면 어떻게 해야 하나요?
(예를들어 10시~13시 그리고 23시~1시에만 진입허용)
input : N(9),N1(30);
var : ET(0);
if ET > 0 and sDate != sDate[1] Then
SetStopEndofday(ET);
if Bdate != Bdate[1] Then
{
SetStopEndofday(0);
if stime >= 80000 Then
ET = 060000;
else
ET = 050000;
}
if Bdate == Bdate[n-1] and CountIf(C>O,3) == 3 and c >= L[N-1]+PriceScale*n1 //and c >= DayHigh
Then
Buy();
if Bdate == Bdate[n-1] and CountIf(C<O,3) == 3 and c[n-1] >= L+PriceScale*n1 //and DayLow >= c
Then
Sell();
2023-05-10
1452
글번호 168862
답변완료
부탁드립니다.
안녕하세요.
이평선을 일목균형표와 같이사용 하고자합니다.
변경부탁드립니다
수식1:BBandsup(20,2)
수식2:BBandsdown(20,2)
수식3:Eavg(C,40)
수식4:Eavg(C,15)
수식5:Eavg(C,50)
역방향
수식1:BBandsup(20,2)
수식2:BBandsdown(20,2)
수식3:Eavg(C,15)
수식4:Eavg(C,40)
수식5:Eavg(C,50)
수식4.수식5는 사이애 색상을(일목균형표)와 같이 사용하고싶습니다.
2023-05-10
1618
글번호 168861
답변완료
문의드립니다.
안녕하세요.
수고하심에 언제나 감사드립니다.
매수 조건:
무포지션에서 60일 이동평균선가격A 를 기준으로 60일 이동평균선가격A 상방에서
음봉이 하나 발생하고 첫 양봉이 생기고 둘째 양봉이 생기면 즉 음봉후
양봉이 연속으로 2개 생길 때
1 상승 대양봉 이라 합니다. 이 때
1 상승 대양봉 시가 = 첫 양봉의 시가
1 상승 대양봉 중간 시가 = 둘째 양봉 시가
1 상승 대양봉 종가 = 둘째 양봉의 종가 정의합니다.
그 후에 다시 음봉이 생기고 첫 양봉이 생기고 둘째 양봉이 생기면 즉 음봉후
양봉이 연속으로 2개 생길 때
2 상승 대양봉 이라 합니다. 이 때
2 상승 대양봉 시가 = 첫 양봉의 시가
2 상승 대양봉 중간 시가 = 둘째 양봉 시가
2 상승 대양봉 종가 = 둘째 양봉의 종가 정의합니다.
조건: 음봉의 종가 또는 양봉의 시가 중 어느 하나라도 60일 이동평균선가격A 를 하방으로
깨면 상승 대양봉들의 조건은 모두 취소가 되어서 처음부터 다시 시작햐여 합니다.
매수:
조건들을 만족하고 1상승 대양봉 시가 < 2 상승 대양봉 시가 이면
매수합니다.
청산:::::
손절청산:
매수후에 손절가격 = 2 상승 대양봉 시가(첫 양봉의 시가)를 손절가격으로 정하고 종가가 아닌 현재가가 하방으로 깨면 손절합니다.
매수후에 매수가격< 양봉이 하나 생기면
손절가격 = 2 상승 대양봉 중간 시가( 둘째 양봉 시가) 를 손절가격으로 정하고 종가가 아닌 현재가가 하방으로 깨면 손절합니다.
본절 청산:
매수후에 매수후 매수가격< 첫 양봉 종가 < 양봉 종가를 만족하는 양봉이 2개가 생기면
본절가격 = 매수가격 이라 정의 하고
현재가가 본절가격에 오면 본절 청산합니다.
이익청산:
매수후에 이익이 나면 처음 음봉종가 > 둘재 음봉 종가 > 3번째 음봉 연속으로 3개가 음봉이 나면 이익 청산합니다.
매도: 반대논리로 매도 수식도 부탁드립니다.
2023-05-10
2207
글번호 168857
답변완료
문의 드립니다.
5 20 60 120 이평선 정배열이고, MACD오실레이터 12 26 9가 기준 0선 아래에서
골든 크로스 나오면 매수 진입하고
손절은 MACD오실레이터 12 26 9가 기준 0선 아래에서 데드크로스 발생 시 매도 청산
익절은 MACD오실레이터 12 26 9가 기준 0선 위로 돌파 후 위에서 아래로 돌파 시 청산완료
부탁드립니다.
2023-05-10
1979
글번호 168853
답변완료
수식작성 부탁드립니다
항상 감사합니다ㅠㅠㅠㅠ 마찬가지로 트뷰 언어로 되어있습니다. 미리감사드립니다
BBB_src = input.source(defval=close , group=group_BBB, title='source')
BBB_mult = input.float (defval=0.8 , group=group_BBB, title='mult')
BBB_lookback = input.int (defval=21 , group=group_BBB, title='lookback_len')
F_BBB(src, mult) =>
a1 = ta.ema(src, 10) - ta.ema(src, 20) * mult
a2 = ta.ema(a1, 50) * mult
a3 = 5 * (a1 - a2) * 30 * mult
a4 = math.pow(a3, 5) * 0.33 + math.pow(a3, 5) * mult
a5 = (a3 > 0.055 ? a4 : 0) / 20 * mult
short_BBB = a5 / 10
b1 = ta.ema(src, 2) - ta.ema(src, 150)
b2 = ta.ema(b1, 50)
b3 = 5 * (b1 - b2)
b4 = math.pow(b3, 5) * 0.1 + math.pow(b3, 10)
long_BBB = (b3 > 0.4 ? b4 : 0) * 55 / 150
BBB = ta.ema(short_BBB + long_BBB, 50) / 100000000
BBB = F_BBB(BBB_src, BBB_mult)
BBB_rising_col = color.from_gradient(BBB, ta.lowest(BBB, BBB_lookback), ta.highest(BBB, BBB_lookback), #f8a5bb, #f91111)
BBB_relaxing_col = color.from_gradient(BBB, ta.lowest(BBB, BBB_lookback), ta.highest(BBB, BBB_lookback), #dcf8a5, #12f807)
plot(BBB, color = ta.rising(BBB, 1)? BBB_rising_col : BBB_relaxing_col, linewidth=2, style=plot.style_columns, title="BBB")
2023-05-10
2073
글번호 168851