커뮤니티
예스랭귀지 Q&A
답변완료
[공지] 예스랭귀지 AI 어시스턴트, '예스나 AI' 출시 및 무료 체험 안내
안녕하세요, 예스스탁 입니다.복잡한 수식 공부 없이 여러분의 아이디어를 말하면 시스템 트레이딩 언어 예스랭귀지로 작성해주는 서비스예스나 AI(YesNa AI)가 출시되었습니다.지금 예스나 AI를 직접 경험해 보실 수 있도록 20크레딧(질문권 20회)를 무료로 증정해 드리고 있습니다.바로 여러분의 아이디어를 코드로 변환해보세요.--------------------------------------------------🚀 YesNa AI 핵심 기능- 지표식/전략식/종목검색식 생성: 자연어로 요청하면 예스랭귀지 문법에 맞는 코드를 작성합니다.- 종목검색식 변환 지원: K증권의 종목 검색식을 예스랭귀지로 변환 지원합니다.- 컴파일 검증: 작성된 코드가 실행 가능한지 컴파일러를 통해 문법 검증을 거쳐 결과물을 제공합니다.상세한 서비스 개요 및 활용 방법은 [서비스 소개 페이지]에서 확인하실 수 있습니다.▶ 서비스 소개 페이지: 바로가기서비스 사용 유의사항 및 결제 환불정책은 [이용약관]을 참고 부탁드립니다.▶ 서비스 이용약관: 바로가기💬 이용 문의사용 중 문의사항은 [프로그램 사용법 Q&A] 게시판에서 [예스나 AI] 카테고리를 설정 후 문의해 주시면 상세히 안내해 드리겠습니다.--------------------------------------------------앞으로도 AI를 활용한 다양한 트레이딩 기능들을 지속적으로 선보일 예정입니다.많은 관심과 기대 부탁드립니다.
2026-02-27
1514
글번호 230811
답변완료
3등분선
분석보조도구에 4분등선은 있는데 3등분선이 없어요
3등분선을 할수있는 지표식 부탁드립니다.
2023-08-20
971
글번호 171663
답변완료
스토캐스틱에 대한 문의드립니다.
도움 많이 주셔서 벌써 3개째 지표를 등록했습니다.
4번째로 스토캐스틱에 대해 문의드리려고 합니다.
input : 모드("현재");
Input : period1(5), period2(3);
#모드 현재 또는 미래일때 표시
if 모드 == "현재" or 모드 == "미래" Then
{
Plot2((c-Lowest(l,period1))/(Highest(h,period1)-Lowest(l,period1))*100,"%k",rgb(244, 67, 54));
Plot3(ma((c-Lowest(l,period1))/(Highest(h,period1)-Lowest(l,period1))*100,period2),"%D",rgb(244, 67, 54));
}
이게 현재값입니다.
그런데 과거값을 만드려고 하다보니 이런 문제가 있습니다.
if 모드 == "과거" Then
{
if LastBarOnChart == 1 Then
Plot5((O-Lowest(l,period1))/(Highest(h,period1)-Lowest(l,period1))*100,"%k과거",rgb(244, 67, 54));
Else
Plot5((c-Lowest(l,period1))/(Highest(h,period1)-Lowest(l,period1))*100,"%k과거",rgb(244, 67, 54));
}
종가를 시가로 바꾸면 되는데, 문제는 저가와 고가가 변경되지 않아야 하기 때문에 이 경우 추가적인 정의가 필요합니다.
예를 들면 기간 중 전봉까지의 고가와 현재 시가 중 가장 높은 값을 고가로 하고, 기간 중 전봉까지의 가장 낮은 저가와 시가 중 가장 낮은 것을 저가로 합니다. 단 현재봉에서 움직인 것은 인정하지 않아야 하는데, 이 경우 수식으로 어떻게 표현해야 하는지 알려주시면 감사하겠습니다.
2023-08-19
899
글번호 171662
답변완료
수식변환 부탁드립니다.
안녕하세요
항상 도움을 주셔서 감사드립니다.
파인스크립 수식을 예스 수식으로 부탁 드려봅니다.
종목검색식.지표식,시스템식 부탁합니다.
매번 부탁을 해서 송구 스럽습니다.
항상 가정에 건승과 건강이 함께 하시길 빕니다.
1.
// Inputs //
sl_type = input.string('%', options=['%', 'ATR', 'Absolute'])
sl_perc = input.float(500, title='% SL')
atr_length = input(500, title='ATR Length')
atr_mult = input.float(500, title='ATR Mult')
sl_absol = input.float(500, title='Absolute SL')
// BACKTESTING RANGE
// From Date Inputs
fromDay = input.int(defval=1, title='From Day', minval=1, maxval=31)
fromMonth = input.int(defval=1, title='From Month', minval=1, maxval=12)
fromYear = input.int(defval=2016, title='From Year', minval=1970)
// To Date Inputs
toDay = input.int(defval=1, title='To Day', minval=1, maxval=31)
toMonth = input.int(defval=1, title='To Month', minval=1, maxval=12)
toYear = input.int(defval=2100, title='To Year', minval=1970)
// Calculate start/end date and time condition
startDate = timestamp(fromYear, fromMonth, fromDay, 00, 00)
finishDate = timestamp(toYear, toMonth, toDay, 00, 00)
time_cond = time >= startDate and time <= finishDate
// CALCULATIONS //
// SL values
sl_val = sl_type == 'ATR' ? atr_mult * ta.atr(atr_length) : sl_type == 'Absolute' ? sl_absol : close * sl_perc / 100
// Init Variables
pos = 0
trailing_sl = 0.0
// Signals
long_signal = nz(pos[1]) != 1 and high > nz(trailing_sl[1])
short_signal = nz(pos[1]) != -1 and low < nz(trailing_sl[1])
// Calculate SL
trailing_sl := short_signal ? high + sl_val : long_signal ? low - sl_val : nz(pos[1]) == 1 ? math.max(low - sl_val, nz(trailing_sl[1])) : nz(pos[1]) == -1 ? math.min(high + sl_val, nz(trailing_sl[1])) : nz(trailing_sl[1])
// Position var
pos := long_signal ? 1 : short_signal ? -1 : nz(pos[1])
// PLOTINGS //
plot(trailing_sl, linewidth=2, color=pos == 1 ? color.green : color.red)
// STRATEGY //
if time_cond and pos != 1
strategy.entry('long', strategy.long, stop=trailing_sl)
if time_cond and pos != -1
strategy.entry('short', strategy.short, stop=trailing_sl)
----------------------------------------------------------------------------------------------------------------------------
----------------------------------------------------------------------------------------------------------------------------
2.
atr_length = input(500)
start = input(500)
increment = input(500)
maximum = input(500)
entry_bars = input(500, title='Entry on Nth trend bar')
atr = ta.atr(atr_length)
atr := na(atr) ? ta.tr : atr
psar = 0.0 // PSAR
af = 0.0 // Acceleration Factor
trend_dir = 0 // Current direction of PSAR
ep = 0.0 // Extreme point
trend_bars = 0
sar_long_to_short = trend_dir[1] == 1 and close <= psar[1] // PSAR switches from long to short
sar_short_to_long = trend_dir[1] == -1 and close >= psar[1] // PSAR switches from short to long
trend_change = barstate.isfirst[1] or sar_long_to_short or sar_short_to_long
// Calculate trend direction
trend_dir := barstate.isfirst[1] and close[1] > open[1] ? 1 : barstate.isfirst[1] and close[1] <= open[1] ? -1 : sar_long_to_short ? -1 : sar_short_to_long ? 1 : nz(trend_dir[1])
trend_bars := sar_long_to_short ? -1 : sar_short_to_long ? 1 : trend_dir == 1 ? nz(trend_bars[1]) + 1 : trend_dir == -1 ? nz(trend_bars[1]) - 1 : nz(trend_bars[1])
// Calculate Acceleration Factor
af := trend_change ? start : trend_dir == 1 and high > ep[1] or trend_dir == -1 and low < ep[1] ? math.min(maximum, af[1] + increment) : af[1]
// Calculate extreme point
ep := trend_change and trend_dir == 1 ? high : trend_change and trend_dir == -1 ? low : trend_dir == 1 ? math.max(ep[1], high) : math.min(ep[1], low)
// Calculate PSAR
psar := barstate.isfirst[1] and close[1] > open[1] ? low[1] : barstate.isfirst[1] and close[1] <= open[1] ? high[1] : trend_change ? ep[1] : trend_dir == 1 ? psar[1] + af * atr : psar[1] - af * atr
plot(psar, style=plot.style_cross, color=trend_dir == 1 ? color.green : color.red, linewidth=2)
// Strategy
strategy.entry('Long', strategy.long, when=trend_bars == entry_bars)
strategy.entry('Short', strategy.short, when=trend_bars == -entry_bars)
2023-08-19
970
글번호 171661
답변완료
부탁드립니다
1, 기본 콜, 보조1콜, 보조2콜, 보조3콜, 보조4콜과 보조5풋, 보조6풋, 보조7풋, 보조8풋, 보조9풋 간에 최고가로 서로 만난 봉이 발생하였을 경우, 기본차트 해당봉에 흰색으로 구현해 주세요, 또 최저가로 서로 만난 봉이 발생하였을 경우에는 노란색으로 구현해 주세요
2. 참조데이터의 개인선물순매수금액의 증감을 45분 간격으로 바탕화면에 표시하고 싶습니다.
전시간대보다 증가하였으면 빨강색으로, 전시간대보다 감소하였으면 파란색으로, 아니면 수직선으로 빨강색과 파란색으로 구현해 주세요
고맙습니다.
2023-08-19
681
글번호 171660
답변완료
문의 드립니다
수고 하십니다
첨부된 차트에서
상단에 있는 조건데이타를 하단식에 중복으로 활용하지 않고
상단에서 작성하여 상단식에서 만들어진▲와 같은 택스트 표시가 상단이 아닌 하단에 표시하고 싶습니다
그리고 원하는 택스트를 만드는 방법은 없나요
가령 회사 로고와 같은 것을 만들어 차트 위에 봍이고 싶습니다
알려 주십시요
2023-08-19
1127
글번호 171659
답변완료
array
안녕하세요?
array에 10개의 값을 저장하고
이 값들의 평균과 표준편차를 구할 수 있나요>
2023-08-19
1241
글번호 171658
답변완료
83418 시험 결과 의문입니다.
Plot1(evwma); 30
Plot2(vwap_smooth); 5
Plot3(mav);단순 이평이라 삭제(Plot1.2의 변화값이 중요)
예스 차트에 vwap_smooth 값을 1로 셋팅하면 선이 1개로 합쳐져서 나와서 값을 5로 조정했습니다.
예스차트 Plot1(evwma); Plot1:30 Plot2 :5)
Plot1.2 의 값을 여러번 바꾸고 대입 해보았지만 트레이딩 뷰 차트의 이평값은 찾을수가 없었습니다. 높낮이하고 일괄적으로 함께 움직인다는 느낌을 받았습니다.(리페인팅 느낌)
트레이딩뷰 차트 (트레이딩뷰 Plot1:30 Plot2 :1)
실시간이나 지나간 차트의 종목을 트뷰 연동 해서 종목을 보면 주가의 위치에 따라 업.다운이 보입니다.(리페인팅 느낌은 없는것 같습니다)
Plot1 이 Plot2를 crossup, 반대로 Plot2가 Plot1을 crossup 할때 약간의 상승후(5%내외) 잠시 기간조정후 재차 CROSSUP가 발생하면 우상향 하는경향이 많습니다.
(종목의 습성에 따라서 Plot1 or Plot2 CROSSUP하는 패턴이 다릅니다)
수식 같다면 차트이평도 비슷하게 나와야 하는데 어디가 잘못된건지 이해가 되질 않네요.
파일첨부 하오니 검토한번 부탁드립니다.
2023-08-19
907
글번호 171657
답변완료
문의드립니다
Input : Period(20),dv(2);
Var : Ep1(0), wEma(0), DINDEX1(0), PrewEma(0);
var : cnt(0),Avgv(0),SumSqrt(0),Counter(0),Stdv(0),wBBup(0),wBBDn(0);
Array : CC[100](0);
Ep1 = 2/(Period+1);
if DayOfWeek(bdate) < DayOfWeek(bdate[1]) Then
{
DINDEX1 = DINDEX1 + 1;
PrewEma = wEma[1];
for cnt = 1 to 99
{
CC[cnt] = CC[cnt-1][1];
}
}
CC[0] = C;
if DINDEX1 <= 1 then
wEma = C;
else
wEma = C * EP1 + PrewEma * (1-EP1);
If CC[Period] > 0 Then
{
Avgv = wEma;
SumSqrt = 0;
For Counter = 0 To Period - 1
{
SumSqrt = SumSqrt + (CC[Counter] - Avgv) * (CC[Counter] - Avgv);
}
Stdv = SquareRoot(SumSqrt / Period);
wBBup = wEma + (Dv * Stdv);
wBBdn = wEma - (Dv * Stdv);
plot1(wBBup);
plot2(wEma);
plot3(wBBdn);
}
-------------------------
위식이 일봉에 주봉 볼린저밴드 적용한 식이 맞나요?
wema 는 지수이평으로 한건가요?
그냥 단순이평으로 적용하려면 어떻게 해야하나요?
2023-08-19
725
글번호 171656
답변완료
수고하십니다.
사용자함수명 : Cha
반환값형 : 숫자형
var: yjp(0),forcast(0);
var : X1(0), X2(0), X3(0), X4(0), X5(0), X6(0), X7(0), X8(0), X9(0),X10(0);
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
X1=0.009341;
X2=0.009773;
X3=0.009342;
X4=-0.00043;
X5=-0.00125;
X6=-0.00096;
X7=-0.00201;
X8=-0.00565;
X9=-0.00809;
X10=8.18E-06;
forcast=yjp+x1*Data2(c)+x2*Data3(c)+x3*Data4(c)+x4*Data5(c)+x5*Data6(c)+x6*Data7(c)+x7*Data8(c)+x8*Data9(c)+x9*Data10(c)+x10*Data15(c);
CHA=(C-forcast)
//문의 : 만약 Data2(c)가 기관선물매수금액이라면 어떻게 표현해야되죠..어떻게 불러오죠..
2023-08-18
1033
글번호 171648