답변완료
문의드립니다,
Input : shortPeriod(12), longPeriod(26), Period(9);
Inputs: RSILength(10), OverSold(30);
Var : MACD1(0,Data1),MACD2(0,Data2),R(0,Data1);
MACD1 = data1(MACD(shortPeriod, longPeriod));
MACD2 = data2(MACD(shortPeriod, longPeriod));
R = Data1(RSI(RSILength));
If MACD2 > 0 and Crossup(R, OverSold) Then
Buy ("RSI");
if MarketPosition == 1 Then
{
if CrossDown(MACD1,0) or CrossDown(MACD2,0) Then
ExitLong();
}
위 수식을 다음과같이 변경 문의드립니다.
1.data2 macd oscillator 골든시 data1매수
2.data2 macd oscillator 골든이후 data1 rsi bull oscillator 매수신호시 data1매수식
3.data1 rsi bull oscillator (70)매도시 or data2 macd oscillator 매도시 매도식
늘감사드립니다
2025-08-06
123
글번호 193041
시스템
답변완료
문의드립니다.
1.아래의 트레이딩뷰수식을 변환부탁드립니다.
2 위1번에서 차트는 과거봉 500개까지 밴드가 그려지는 것으로 보이는데, 과거봉 5000개까지 확장적용하려면 어떻게 해야 하는지요?
=====================
indicator("Nadaraya-Watson Envelope [LuxAlgo]", "LuxAlgo - Nadaraya-Watson Envelope", overlay = true, max_lines_count = 500, max_labels_count = 500, max_bars_back=500)
//------------------------------------------------------------------------------
//Settings
//-----------------------------------------------------------------------------{
h = input.float(8.,'Bandwidth', minval = 0)
mult = input.float(1.6., minval = 0)
src = input(close, 'Source')
repaint = input(true, 'Repainting Smoothing', tooltip = 'Repainting is an effect where the indicators historical output is subject to change over time. Disabling repainting will cause the indicator to output the endpoints of the calculations')
//Style
upCss = input.color(color.teal, 'Colors', inline = 'inline1', group = 'Style')
dnCss = input.color(color.red, '', inline = 'inline1', group = 'Style')
//-----------------------------------------------------------------------------}
//Functions
//-----------------------------------------------------------------------------{
//Gaussian window
gauss(x, h) => math.exp(-(math.pow(x, 2)/(h * h * 2)))
//-----------------------------------------------------------------------------}
//Append lines
//-----------------------------------------------------------------------------{
n = bar_index
var ln = array.new_line(0)
if barstate.isfirst and repaint
for i = 0 to 499
array.push(ln,line.new(na,na,na,na))
//-----------------------------------------------------------------------------}
//End point method
//-----------------------------------------------------------------------------{
var coefs = array.new_float(0)
var den = 0.
if barstate.isfirst and not repaint
for i = 0 to 499
w = gauss(i, h)
coefs.push(w)
den := coefs.sum()
out = 0.
if not repaint
for i = 0 to 499
out += src[i] * coefs.get(i)
out /= den
mae = ta.sma(math.abs(src - out), 499) * mult
upper = out + mae
lower = out - mae
//-----------------------------------------------------------------------------}
//Compute and display NWE
//-----------------------------------------------------------------------------{
float y2 = na
float y1 = na
nwe = array.new<float>(0)
if barstate.islast and repaint
sae = 0.
//Compute and set NWE point
for i = 0 to math.min(499,n - 1)
sum = 0.
sumw = 0.
//Compute weighted mean
for j = 0 to math.min(499,n - 1)
w = gauss(i - j, h)
sum += src[j] * w
sumw += w
y2 := sum / sumw
sae += math.abs(src[i] - y2)
nwe.push(y2)
sae := sae / math.min(499,n - 1) * mult
for i = 0 to math.min(499,n - 1)
if i%2
line.new(n-i+1, y1 + sae, n-i, nwe.get(i) + sae, color = upCss)
line.new(n-i+1, y1 - sae, n-i, nwe.get(i) - sae, color = dnCss)
if src[i] > nwe.get(i) + sae and src[i+1] < nwe.get(i) + sae
label.new(n-i, src[i], '▼', color = color(na), style = label.style_label_down, textcolor = dnCss, textalign = text.align_center)
if src[i] < nwe.get(i) - sae and src[i+1] > nwe.get(i) - sae
label.new(n-i, src[i], '▲', color = color(na), style = label.style_label_up, textcolor = upCss, textalign = text.align_center)
y1 := nwe.get(i)
//-----------------------------------------------------------------------------}
//Dashboard
//-----------------------------------------------------------------------------{
var tb = table.new(position.top_right, 1, 1
, bgcolor = #1e222d
, border_color = #373a46
, border_width = 1
, frame_color = #373a46
, frame_width = 1)
if repaint
tb.cell(0, 0, 'Repainting Mode Enabled', text_color = color.white, text_size = size.small)
//-----------------------------------------------------------------------------}
//Plot
//-----------------------------------------------------------------------------}
plot(repaint ? na : out + mae, 'Upper', upCss)
plot(repaint ? na : out - mae, 'Lower', dnCss)
//Crossing Arrows
plotshape(ta.crossunder(close, out - mae) ? low : na, "Crossunder", shape.labelup, location.absolute, color(na), 0 , text = '▲', textcolor = upCss, size = size.tiny)
plotshape(ta.crossover(close, out + mae) ? high : na, "Crossover", shape.labeldown, location.absolute, color(na), 0 , text = '▼', textcolor = dnCss, size = size.tiny)
//-----------------------------------------------------------------------------}
==================
매번 감사드립니다. 수고하세요!!!
2025-08-06
136
글번호 193040
지표
답변완료
지표 변환 부탁드립니다.
// This work is licensed under Creative Commons Attribution-NonCommercial-ShareAlike 4.0 International
// https://creativecommons.org/licenses/by-nc-sa/4.0/
// © BigBeluga
//@version=6
indicator("Two Poles Trend Finder MTF [BigBeluga]", overlay = true)
// INPUTS ――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――{
alpha = input.float(0.10, minval=0.01, maxval=1.0, step = 0.01, title="Alpha")
source = input.source(close, "Source")
offset = 3
tf1 = input.timeframe("60", "Timeframe1")
tf2 = input.timeframe("120", "Timeframe2")
tf3 = input.timeframe("240", "Timeframe3")
tf4 = input.timeframe("720", "Timeframe4")
tf5 = input.timeframe("D", "Timeframe5")
c_up = input.color(#00b8a5, "")
c_dn = input.color(#b80090, "")
var float f = na
var float f_prev1 = na
var float f_prev2 = na
// }
// CALCULATIONS――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――{
// Apply two-pole Gaussian filter
if bar_index >= 2
f := math.pow(alpha, 2) * source + 2 * (1 - alpha) * f_prev1 - math.pow(1 - alpha, 2) * f_prev2
else
f := source // Warm-up for first bars
// Shift state
f_prev2 := f_prev1
f_prev1 := f
tp1 = request.security("", tf1, f_prev1 > f_prev1[offset])
tp2 = request.security("", tf2, f_prev1 > f_prev1[offset])
tp3 = request.security("", tf3, f_prev1 > f_prev1[offset])
tp4 = request.security("", tf4, f_prev1 > f_prev1[offset])
tp5 = request.security("", tf5, f_prev1 > f_prev1[offset])
avg = math.avg(tp1 ? 1 : 0, tp2 ? 1 : 0, tp3 ? 1 : 0, tp4 ? 1 : 0, tp5 ? 1 : 0)
dash = table.new(position.bottom_right, 100, 100)
if barstate.islast
dash.merge_cells(0, 0, 8, 0)
dash.cell(0, 0, str.tostring(syminfo.basecurrency) + (avg > 0.5 ? " 🢁" : " 🢃"), text_color = avg > 0.5 ? c_up : c_dn, tooltip = "Average Trend")
draw_gauge(col, tf, trend)=>
if barstate.islast
s = timeframe.in_seconds(tf)
m = timeframe.in_seconds(tf) / 60
h = timeframe.in_seconds(tf) / 60 / 60
d = timeframe.in_seconds(tf) / 60 / 60 / 24
tff = h < 24 and h >= 1 ? str.tostring(h) + "H" : m >= 1440 ? str.tostring(d) + "D" : m < 60 and m > 1 ? str.tostring(m) + "M" : m < 1 ? str.tostring(s) + "S" : tf
color = trend ? c_up : c_dn
dash.cell(col, 1, "", bgcolor = color)
dash.cell(col, 2, tff, text_color = chart.fg_color, text_size = size.normal)
dash.cell(col+1, 1, "", bgcolor = color(na), width = 1)
// }
// PLOT ――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――{
draw_gauge(0, tf1, tp1)
draw_gauge(2, tf2, tp2)
draw_gauge(4, tf3, tp3)
draw_gauge(6, tf4, tp4)
draw_gauge(8, tf5, tp5)
plot(f_prev1, "1", color = f_prev1 > f_prev1[offset] ? c_up : c_dn, linewidth = 3)
plot(f_prev1, "2", color = color.new(f_prev1 > f_prev1[offset] ? c_up : c_dn, 80), linewidth = 25)
// }
2025-08-06
163
글번호 193032
지표
답변완료
도움 부탁드립니다
안녕하세요
무더운 여름 잘 보내시길 바랍니다.
아래 지표는 커뮤니티에서 다운받은 지표인데 궁금한것이 챠트캔들위에 나타나는 삼각형의
표시가 캔들이 몇개이상 지나고 난 후에 캔들위에 표시가 되는데 궁금한것은
1. 보통 캔들이 완성된후에 생기는데 이처럼 여러개의 캔들이 지나서 나타나는 이유.
2. 후행성이 아닌 실시간 켄들에 나타나게 할 수는 없는지요.
3. 2번째 질문에 답이 안된다면 캔들 표식이 아닌 다른 방법으로도 실시간 알수는 없는지요
감사합니다.
input : len(3);
input : mult(0.6);
input : color_t_up(Lime);
var : color_t(orange);
input : color_t_dn(Red);
var : p_h(nan);
var : p_l(nan);
var : trend(False);
var : market_state(""),ph(0),pl(0),tx(0);
market_state = "Range";
if SwingHigh(1,h,len,len,len+len+1) != -1 Then
{
p_h = h[len];
tx = Text_New(sDate[len],sTime[len],p_h,"▼");
Text_SetStyle(tx,2,1);
Text_SetColor(tx,Blue);
Text_SetSize(tx,12);
}
if SwingLow(1,l,len,len,len+len+1) != -1 Then
{
p_l = l[len];
tx = Text_New(sDate[len],sTime[len],p_l,"▲");
Text_SetStyle(tx,2,0);
Text_SetColor(tx,Red);
Text_SetSize(tx,12);
}
var : avgv(0),ATrv(0),hl2(0),upper(0),lower(0),tx1(0);
avgv = (p_h+p_l)/2;
atrv = atr(200)*mult;
upper = avgv + atrv;
lower = avgv - atrv;
hl2 = (h+l)/2;
if hl2 > upper Then
{
color_t = color_t_up;
trend = true;
market_state = "Momentum Up";
}
if hl2 < lower Then
{
color_t = color_t_dn;
trend = false;
market_state = "Momentum Down";
}
// -----------------------------------}
// VISUALIZATIONS
// -----------------------------------{
plot1(avgv, "MidLine",color_t);
plot2(upper, "Upper");
plot3(lower, "Lower");
2025-08-05
123
글번호 193020
지표
답변완료
트레이닝 궁굼합니다. 가능할까요?
아래 지표설정대로 제가 지정하는 종목에(1개~다수) 대해서 일봉기준으로 매매하고 싶습니
다.
1. 매수후 중복으로 나오는 매수신호는 무시
2. 지정하는 종목(1~다수)
3. 매도신호시 청산(통합주문2101에서 해도 무방한가요?)
input : length(15);
input : show_levl(true);
var : up(0),dn(0),A(0),emaValue(0),correction(0),zlma(0);
var : signalUp(False),signalDn(False),zlma_color(0),ema_col(0);
var : TOP(0),BTM(0),box(0),tx(0),tx1(0),check_signals(False);
up = Black;
dn = Blue;
#var box1 = box(na) // Variable to store the box
a = atr(200);
emaValue = ema(close, length);
correction = close + (close - emaValue);
zlma = ema(correction, length);
signalUp = CrossUp(zlma, emaValue);
signalDn = CrossDown(zlma, emaValue);
zlma_color = iff(zlma > zlma[3] , up , iff(zlma < zlma[3] , dn , Nan));
ema_col = iff(emaValue < zlma , up , dn);
plot1(zlma, "ZLMA",zlma_color); // Plot ZLMA
plot2(emaValue,"EMA",ema_col);
if signalUp Then
{
Top = zlma;
BTM = zlma-A;
box = box_new(sDate,sTime,Top,NextBarSdate,NextBarStime,BTM);
Box_SetColor(box,up);
Box_SetFill(box,true);
var3 = (Top+BTM)/2;
tx = Text_New(NextBarSdate,NextBarStime,var3,NumToStr(C,2));
Text_SetStyle(tx,1,2);
}
else if signalDn Then
{
Top = zlma+A;
BTM = zlma;
box = box_new(sDate,sTime,Top,NextBarSdate,NextBarStime,BTM);
Box_SetColor(box,dn);
Box_SetFill(box,true);
var3 = (Top+BTM)/2;
tx = Text_New(NextBarSdate,NextBarStime,var3,NumToStr(C,2));
Text_SetStyle(tx,1,2);
}
Else
{
Box_SetEnd(box,sDate,sTime,BTM);
Text_SetLocation(tx,sDate,sTime,var3);
}
check_signals = signalUp or signalDn;
if CrossDown(high, BTM) and emaValue > zlma Then
{
tx1 = Text_New(sDate[1],sTime[1],H[1],"▼");
Text_SetStyle(tx1,2,1);
Text_SetColor(tx1,dn);
}
if CrossUp(low, Top) and emaValue < zlma Then
{
tx1 = Text_New(sDate[1],sTime[1],L[1],"▲");
Text_SetStyle(tx1,2,0);
Text_SetColor(tx1,up);
}
2025-08-05
129
글번호 193019
시스템