답변완료
수식전환
항상 수고 많으십니다 아래수식을 예스랭귀지로 변환 부탁드립니다
A1=C>avg(c,5);
A2=C>avg(c,20);
A3=C>avg(c,60);
A4=avg(c,5)>avg(c,20);
A5=avg(c,5)>avg(c,60);
A6=0<avg(c,224);
A7=amount>con1;//CON1 15000
A8=(h(1)/avg(c,224,1)-1)*100>=con2;//CON2 -5
A9=sum(if(A8,1,0),con3)>=1;//CON3 30
A1 and A2 and A3 and A4 and A5 and A6 and A7 and A8 and A9
2025-06-23
205
글번호 192028
종목검색
답변완료
부탁드립니다
60 이평 위에서 10, 20 이평 골든크로스
60 이평 아래서 10, 20 이평 데드크로스
기준으로 부탁드립니다 올려주신 수식을 적용해 보니 이미지 처럼 뜨네요
var : shortPeriod(5), longPeriod(20);
var : bh(0),bd(0),bt(0),tl1(0),tx1(0),A1(0),A2(0),A3(0);
var : sl(0),sd(0),st(0),tl2(0),tx2(0),B1(0),B2(0),B3(0);
var : A31(0),B31(0);
value1 = wma(C, shortPeriod);
value2 = wma(C, longPeriod);
If CrossUP(value1, value2) Then
{
buy();
bh = h;
bd = sDate;
bt = sTime;
if sl > 0 Then
{
A1 = sd;
A2 = st;
A3 = sl;
A31 = A3[1];
TL_SetEnd(TL1,A1,A2,A3[1]);
tl1 = TL_New(A1,A2,A3,NextBarSdate,NextBarStime,A3);
Text_SetLocation(Tx1,A1,A2,A3[1]);
if A3 > A31 Then
tx1 = Text_New(NextBarSdate,NextBarStime,A3,"▲"+NumToStr(A3,1));
Else
tx1 = Text_New(NextBarSdate,NextBarStime,A3,NumToStr(A3,1));
Text_SetColor(tx1,Blue);
Text_SetStyle(tx1,1,0);
}
}
If CrossDown(value1, value2) Then
{
sell();
sl = l;
sd = sDate;
st = sTime;
if bh > 0 Then
{
B1 = bd;
B2 = bt;
B3 = bh;
B31 = B3[1];
TL_SetEnd(TL2,B1,B2,B3[1]);
TL2 = TL_New(B1,B2,B3,NextBarSdate,NextBarStime,B3);
Text_SetLocation(tx2,B1,B2,B3[1]);
if B3 < B31 Then
tx2 = Text_New(NextBarSdate,NextBarStime,B3,"▼"+NumToStr(B3,1));
Else
tx2 = Text_New(NextBarSdate,NextBarStime,B3,NumToStr(B3,1));
Text_SetColor(tx2,Red);
Text_SetStyle(tx2,1,1);
}
}
if MarketPosition == 1 Then
{
if h > bh Then
{
bh = h;
bd = sDate;
bt = sTime;
}
}
if MarketPosition == -1 Then
{
if l < sl Then
{
sl = l;
sd = sDate;
st = sTime;
}
}
TL_SetEnd(tl1,NextBarSdate,NextBarStime,A3);
TL_SetEnd(tl2,NextBarSdate,NextBarStime,B3);
Text_SetLocation(tx1,NextBarSdate,NextBarStime,A3);
Text_SetLocation(tx2,NextBarSdate,NextBarStime,B3);
2025-06-23
213
글번호 192019
시스템
답변완료
지표 부탁드려요!!!
다음 TradingView 지표를 Yestrader로 부탁드립니다. 참고로 Grok Ai에다가 ta.change(src,length) 함수를 의뢰했더니 다음 1과 같이 보내왔습니다.
1. _Change(src, len) 함수
// 사용자 정의 change 함수 구현
_Change(source, length) =>
source - source[length]
2. TV 지표 수식(HMA Swing Levels [BigBeluga])
// INPUTS ――――――――――――――――――――{
len1 = input.int(5, "Trend Change")
len2 = input.int(50, "Swing Levels")
col1 = input.color(#238be0, "", inline = "col")
col2 = input.color(#1ae382, "", inline = "col")
h = ta.highest(len2)
l = ta.lowest(len2)
mid = math.avg(h, l)
hma = ta.hma(close, 50)
change = ta.change(hma, len1)
var trail = float(na)
var color = color(na)
type lines
line l
label lbl
bool direction
var data = array.new<lines>()
// }
// CALCULATIONS――――――――――{
if last_bar_index - bar_index < 4000
if h[1] == high[1] and high < h and change > 0
label.new(bar_index[1], high[1], "▇", style = label.style_label_center, color = color(na), textcolor = col2, size = size.tiny)
lbl = label.new(bar_index[1], high[1], str.tostring(high[1]), style = label.style_label_left, color = color(na), textcolor = col2, size = size.normal)
l1 = line.new(bar_index[1], high[1], bar_index, high[1], color = col2)
gg = lines.new(l1, lbl, false)
data.push(gg)
if l[1] == low[1] and low > l and change < 0
label.new(bar_index[1], low[1], "▇", style = label.style_label_center, color = color(na), textcolor = col1, size = size.tiny)
lbl = label.new(bar_index[1], low[1], str.tostring(low[1]), style = label.style_label_left, color = color(na), textcolor = col1, size = size.normal)
l2 = line.new(bar_index[1], low[1], bar_index, low[1], color = col1)
gg = lines.new(l2, lbl, true)
data.push(gg)
if data.size() > 0
for gg in data
l_ = gg.l
lbl = gg.lbl
l_.set_x2(bar_index)
lbl.set_x(bar_index)
if l_.get_x2() - l_.get_x1() > 250
l_.set_width(2)
if l_.get_x2() - l_.get_x1() > 500
l_.set_width(3)
if l_.get_x2() - l_.get_x1() > 750
l_.set_width(4)
if gg.direction
if low < l_.get_y1()
l_.set_width(1)
label.delete(lbl)
l_.set_style(line.style_dashed)
ss = lines.new(line(na), label(na))
data.set(data.indexof(gg), ss)
else
if high > l_.get_y1()
l_.set_width(1)
label.delete(lbl)
l_.set_style(line.style_dashed)
ss = lines.new(line(na), label(na))
data.set(data.indexof(gg), ss)
if change > 0
trail := hma
color := color.fuchsia
if change < 0
trail := hma
color := color.lime
pt = plot(trail, color = color, style = plot.style_stepline, linewidth = 2)
plot(trail, color = color.new(color, 60), style = plot.style_stepline, linewidth = 6)
// }
2025-06-23
265
글번호 192018
지표