커뮤니티
예스랭귀지 Q&A
[공지] 예스랭귀지 AI 어시스턴트, '예스나 AI' 출시 및 무료 체험 안내
안녕하세요, 예스스탁 입니다.복잡한 수식 공부 없이 여러분의 아이디어를 말하면 시스템 트레이딩 언어 예스랭귀지로 작성해주는 서비스예스나 AI(YesNa AI)가 출시되었습니다.지금 예스나 AI를 직접 경험해 보실 수 있도록 20크레딧(질문권 20회)를 무료로 증정해 드리고 있습니다.바로 여러분의 아이디어를 코드로 변환해보세요.--------------------------------------------------🚀 YesNa AI 핵심 기능- 지표식/전략식/종목검색식 생성: 자연어로 요청하면 예스랭귀지 문법에 맞는 코드를 작성합니다.- 종목검색식 변환 지원: K증권의 종목 검색식을 예스랭귀지로 변환 지원합니다.- 컴파일 검증: 작성된 코드가 실행 가능한지 컴파일러를 통해 문법 검증을 거쳐 결과물을 제공합니다.상세한 서비스 개요 및 활용 방법은 [서비스 소개 페이지]에서 확인하실 수 있습니다.▶ 서비스 소개 페이지: 바로가기서비스 사용 유의사항 및 결제 환불정책은 [이용약관]을 참고 부탁드립니다.▶ 서비스 이용약관: 바로가기💬 이용 문의사용 중 문의사항은 [프로그램 사용법 Q&A] 게시판에서 [예스나 AI] 카테고리를 설정 후 문의해 주시면 상세히 안내해 드리겠습니다.--------------------------------------------------앞으로도 AI를 활용한 다양한 트레이딩 기능들을 지속적으로 선보일 예정입니다.많은 관심과 기대 부탁드립니다.
2026-02-27
1363
글번호 230811
답변완료
문의 드립니다.
//@version=5
indicator(
"Fourier For Loop [BackQuant]",
shorttitle="",
overlay=false,timeframe="",
timeframe_gaps=true
)
const string ui = "UI Settings"
const string inputs = "Calculation Settings"
const string scoring = "Signals"
xval = input.source(hlc3, "Calculation Source", group = inputs, inline = "2222")
N = input.int(1, minval=1, title="Calculation Period", group = inputs, inline = "2222")
start = input.int(1, "Calculation Start", group = inputs,inline = "1s")
end = input.int(45, maxval = 50, title = "Calculation End", group = inputs,inline = "1s")
upper = input.int(40, "Long Threshold",group = scoring)
lower = input.int(-10, "Short Threshold",group = scoring)
simple bool showthres = input.bool(true, "Show Threshold Lines?", group = ui)
simple bool paintCandles = input.bool(false, "Color Bars According to Trend?", group = ui)
simple bool bgcol_ = input.bool(false, "Background Colour", group = ui)
int linew = input.int(3, "Signal Line Width", 1,4,1, group = ui)
color longcol = input.color(#00ff00, "Long Colour", group = ui, inline = "xxxx")
color shortcol = input.color(#ff0000, "Short Colour", group = ui, inline = "xxxx")
DFT(x, y, Nx, _dir) =>
float _arg = 0.0
float _cos = 0.0
float _sin = 0.0
float xArr_i = 0.0
float yArr_i = 0.0
xArr = array.new_float(array.size(x))
yArr = array.new_float(array.size(y))
for i = 0 to Nx - 1 by 1
xArr_i := 0.0
yArr_i := 0.0
kx = float(i) / float(Nx)
_arg := -_dir * 2 * math.pi * kx
for k = 0 to Nx - 1 by 1
_cos := math.cos(k * _arg)
_sin := math.sin(k * _arg)
xArr_i += array.get(x, k) * _cos - array.get(y, k) * _sin
yArr_i += array.get(x, k) * _sin + array.get(y, k) * _cos
yArr_i
array.set(xArr, i, xArr_i)
array.set(yArr, i, yArr_i)
if _dir == 1
for i = 0 to Nx - 1 by 1
array.set(x, i, array.get(xArr, i) / float(Nx))
array.set(y, i, array.get(yArr, i) / float(Nx))
else
for i = 0 to Nx - 1 by 1
array.set(x, i, array.get(xArr, i))
array.set(y, i, array.get(yArr, i))
x = array.new_float(N, 0.0)
y = array.new_float(N, 0.0)
for i = 0 to N - 1
array.set(x, i, xval[i])
array.set(y, i, 0.0)
DFT(x, y, N, 1)
mag = array.new_float(N, 0.0)
for i = 0 to N - 1
mag_i = math.sqrt(math.pow(array.get(x, i), 2) + math.pow(array.get(y, i), 2))
array.set(mag, i, mag_i)
subject = array.get(mag,0)
forloop(start, end) =>
return_val = 0.0
for i = start to end by 1
return_val += (subject > subject[i] ? 1 : -1)
return_val
return_val
score = forloop(start, end)
L = score > upper
S = ta.crossunder(score, lower)
var out = 0
if L and not S
out := 1
if S
out := -1
plot(score, "FFL", color = out == 1 ? longcol : out == -1 ? shortcol : color.gray, linewidth = linew)
barcolor(paintCandles ? (out == 1 ? longcol : out == -1 ? shortcol : color.gray) : na)
plot(showthres?upper:na, "Long Threshold", longcol)
plot(showthres?lower:na, "Short Threshold", shortcol)
bgcolor(bgcol_?(out == 1 ? color.new(longcol,90) : out == -1 ? color.new(shortcol,90) : color.gray):na)
alertcondition(L and not S, title="Fourier FL Long", message="Fourier FL Long - {{ticker}} - {{interval}}")
alertcondition(S, title="Fourier FL Short", message="Fourier FL Short - {{ticker}} - {{interval}}")
트레이딩뷰 수식인데 예스로 좀 바꿔주세요.
2024-10-30
756
글번호 184806
답변완료
질문 드리겠습니다
지난 답변 감사드립니다
몇가지 더 여쭤보고 싶은데요
질문1.
if t == -1 Then
{
if h > hh Then
hh = h;
if l < ll Then
ll = l;
IF H > M2 TheN PLOT11(HIGH,"HIGH",Cyan,DeF,1);
# ElsE NoPloT(11);
}
이 부분에서 고가가 M2 (이평선) 보다 높을때 PLOT11로 출력을 했는데요
추세선 TL1 TL2 으로 표현한 구간( 두개의 MA 가 crossdown 했다가 up 하는 구간) 이 아닌 곳에서는 NOPLOT 을 하려면 어떻게 해야될까요??
ELSE NOPLOT(11); 을 추가해봤는데 안되네요.
*NOPLOT으로 값은 없지만(n/a) 두개의 지점을 이어주는 선을 없앨 수 있지 않나요??
질문2.
1번 질문에서의 IF H>M2 가 해당될때의 HIGH 값들 중에서 ,최고 HIGH 와 최저 HIGH 를 표시하고 싶습니다
질문3. 추세선 구간에 해당되지 않는 부분 (조건 만족하지 않는 봉들)에서의 최고 최저값을 작성하고 싶습니다. (최고가는 MA5 보다 클 때만 ). 추세선 구간을 지나는 연결선은 NOPLOT 으로 처리해주세요. 감사드립니다
[아래는 수식입니다]
VAR : P1(0),P2(0);
var : m1(0),m2(0),T(0),HH(0),LL(0);
var : upd(0),upt(0),dnd(0),dnt(0),TL1(0),TL2(0);
P1=5;
P2=30;
m1 = ma(C,P1);
m2 = ma(C,P2);
#이평
Plot1(M1,"M1",Green,DeF,1);
plot2(M2,"M2",OrangE,DeF,1);
if CrossUp(m1,m2) Then
{
T = 1;
upd = sDate;
upt = sTime;
value1 = hh;
Value2 = ll;
#직전 데드와 골드사이에는 추세선으로 출력
TL1 = TL_New(dnd,dnt,hh,upd,upt,hh);
TL_SetColoR(TL1,YelloW);
TL_SetSizE(TL1,1);
TL2 = TL_New(dnd,dnt,ll,upd,upt,ll);
TL_SetColoR(TL2,YelloW);
TL_SetSizE(TL2,1);
#Plot11(HIGH,"HIGH1",RED,DeF,1);
#plot3(value1,"HH EXT",LightGreen,DeF,1);
#plot4(LL,"LL EXT",BluE,DeF,1);
}
if CrossDown(m1,m2) Then
{
T = -1;
hh = h;
ll = l;
dnd = sDate;
dnt = sTime;
}
if t == -1 Then
{
if h > hh Then
hh = h;
if l < ll Then
ll = l;
IF H > M2 TheN PLOT11(HIGH,"HIGH",Cyan,DeF,1);
}
2024-10-31
640
글번호 184805
살빼고싶다 님에 의해서 삭제되었습니다.
2024-10-30
54
글번호 184793
답변완료
조건식 문의 드립니다.
안녕하세요,
바쁘신데, 도움 주셔서 매우 감사합니다.
조언 부탁드립니다.
현재 일봉 차트 시뮬레이션 중입니다.
아래 조건식을 테스트했습니다.
>>> 진입 조건 : 각 이평선이 정배열이고, 2일 전 종가가 21일 이평선 아래, 1일 전 종가가 21일 이평선 위일 경우에 진입
>>>아래는 작성한 조건식입니다.
Input : short(21), mid(50), long(150), longest(200) ;
var : sma(0), mma(0), lma(0), lgma(0);
sma = ma(c,short);
mma = ma(c,mid);
lma = ma(c,long);
lgma = ma(c,longest);
If sma>mma and mma>lma and lma>lgma
and c[2]<sma
and c[1]>sma
Then Buy("매수");
If c[1]>sma and c<sma Then
ExitLong("매도");
****
(질문)
캡쳐 사진에서의 첫 번째 매수가 진입 조건에 맞지 않는데 매수가 된 이유가 뭘까요?
두 번째는 조건에 맞게 매수되었다고 생각합니다.
2024-10-30
459
글번호 184792
살빼고싶다 님에 의해서 삭제되었습니다.
2024-10-30
18
글번호 184791
답변완료
수식 수정 부탁드립니다.
> 1.IF A 조건 then
{
Buy("b",OnClosE,DeF,진입수량);
}
IF B 조건 then
{
Buy("b1",OnClosE,DeF,진입수량);
}을 한문장으로 표현하는 식을
if a조건 or b조건 then
{buy}으로 답으로 주셨습니다.
추가로 여쭙니다.
한문장으로 표현하면서 매수명을 b와 b1으로 구분하려고 합니다. 그것이 가능한지요?
2024-10-30
773
글번호 184785
답변완료
문의드립니다
input : P1(10),P2(20);
var1 = ema(C,P1);
var2 = ema(c,P2);
if CrossUp(C,var1) and CrossUp(C,var2) and c >= var2+0.05 Then
{
Buy();
PlaySound("C:₩예스트레이더₩data₩Sound₩alert.wav");
}
if CrossDown(C,var1) and CrossDown(C,var2) and c <= var2-0.05 Then
{
Sell();
PlaySound("C:₩예스트레이더₩data₩Sound₩alert.wav");
}
..................................................
어제 구현해 주신 수식입니다
예비신호 출현때만 경보음이 들려야 하는데
예비신호가 나오지 않음에도 가격만 변해도 계속 경보음이 들립니다
살펴봐주세요
감사합니다
2024-10-30
949
글번호 184782
답변완료
검색식 부탁합니다
A=V*(H+L+O+C)/4;
K=sum(A,120);
K2=sum(V,120);
K3=K/K2;
K3*m
m:0.54
이 선을 당일 종가가 골든크로스하는 검색식 부탁합니다
2024-10-30
860
글번호 184775
답변완료
Data3에 대한 식으로 수정 부탁드립니다.
input : len1(20),len2(40);
var : mt(0,Data1),sum1(0,Data1),sum2(0,Data1),TDI(0,Data1);
mt = Abs(Data1(C)-Data1(C[len1-1]));
sum1 = AccumN(mt,len1);
sum2 = AccumN(mt,len2);
TDI = sum1-(sum2-sum1);
Var1 = Ma(TDI,9);
If TDI > Var1 Then {
plot1(TDI,"Trend Detection Index", RgB(128,0,0));
}
If TDI < Var1 Then {
plot1(TDI,"Trend Detection Index",LBlue );
}
Plot2(Var1,"10이평선");
2024-10-30
764
글번호 184769