답변완료
수고하십니다
항상노고에 감사드리며
타주기분봉으로 할수있게 부탁드립니다
input : length(20),hh(8),mult(3);
var : k(2),src(0),n(0),sume(0),i(0),j(0),y2(0),sum(0),sumw(0),w(0),mae(0);
Var : tx1(0), tx2(0);
src = Close;
n = barindex;
//if IsLastBar업데이트[영문으로는 쓰기금지라 한글로 씀] and barindex>length then
//y = 0
sume = 0;
for i = 0 to length-1
{
sum = 0;
sumw = 0;
for j = 0 to length-1
{
w = exp(-(pow(i-j,2)/(hh*hh*2)));
sum = sum+src[j]*w;
sumw = sumw+w;
}
y2 = sum/sumw;
sume = sume+abs(src[i] - y2);
}
mae = sume/length*mult;
if CrossDown(src,y2+mae) then
{
tx1 = Text_New_Self(sdate,stime,H,"▼");
Text_SetStyle(tx1,2,1);
Text_SetColor(tx1,Cyan);
Text_setsize(Tx1,15);
}
if CrossUp(src,y2-mae) then
{
tx2 = Text_New_Self(sdate,stime,L,"▲");
Text_SetStyle(tx2,2,0);
Text_SetColor(tx2,Black);
Text_setsize(Tx2,15);
}
Plot1(y2);
Plot2(y2+mae);
Plot3(y2-mae);
2024-11-29
542
글번호 185761
지표
답변완료
죄송합니다. 다시 한번 부탁드립니다.화살표 부탁드립니다.
input : period(20),period1(60),avgperiod(3);
var : a(0),b(0),aa(0),bb(0);
input : TrigLen(13), FastX(34), SlowX(55);
var : A1(0),xTrend(0), xFast(0), xSlow(0), xKVO(0), xTrigger(0);
// KVO 계산
A1=(H+L+C)/3;
xTrend = iff(A1 > A1[1], volume * 100, -volume * 100);
xFast = ema(xTrend, FastX);
xSlow = ema(xTrend, SlowX);
xKVO = xFast - xSlow;
xTrigger = ema(xKVO, TrigLen);
A=LRL(C, period);
B=MA(A, avgperiod)-MA(StdError(C, period),avgperiod);
AA=LRL(C, period1);
BB=MA(AA, avgperiod)-MA(StdError(C, period1),avgperiod);
if B<BB && xKVO>xTrigger && (CROSSUP(C,B) OR CROSSUP(C,BB)) && C>O Then
//if B>BB && xKVO>xTrigger && CROSSUP(C,B) && C>O Then
Find(1);
=============================================
위가 검색기인데. 화살표를 만들어 주시고 이것은 검색에서 만들어야 하는지 여쭤봅니다. 감사합니다.
2024-11-28
503
글번호 185760
검색
답변완료
문의 드립니다.
해외 유튜브 [chart prime]에서 소개된 하기 내용을 다음 2가지로 부탁 드립니다.
1)Yes Language 지표로 변환
2)예스 트레이더 종목 검색
부탁 드립니다.
=====하기====
Linear Regression Oscillator [ChartPrime]
indicator("Linear Regression Oscillator [ChartPrime]", overlay=false, max_labels_count = 500)
// ---------------------------------------------------------------------------------------------------------------------}
// 𝙐𝙎𝙀𝙍 𝙄𝙉𝙋𝙐𝙏𝙎
// ---------------------------------------------------------------------------------------------------------------------{
int length = input.int(20, "Length")
float upper = input.float(1.5, "Upper Threshold", step = 0.1)
float lower = input.float(-1.5, "Lower Threshold", step = 0.1)
bool candles = input.bool(false, "Plot Bar Color")
color col_up = #10cab8
color col_dn = color.blue
// Source
series float source = close[barstate.isconfirmed ? 0 : 1]
// Max and Min prices for Invalidation Levels (period 5 bars back)
var lowest = array.new<float>(5)
var highest = array.new<float>(5)
var series float points = na
// ---------------------------------------------------------------------------------------------------------------------}
// 𝙄𝙉𝘿𝙄𝘾𝘼𝙏𝙊𝙍 𝘾𝘼𝙇𝘾𝙐𝙇𝘼𝙏𝙄𝙊𝙉𝙎
// ---------------------------------------------------------------------------------------------------------------------{
//@function Calculation of slope and intercept
//@param length LookBack Period
//@returns Linear Regression Oscillator
linear_regression_osc(int length)=>
n = length
sum_x = 0.0
sum_y = 0.0
sum_xy = 0.0
sum_x_squared = 0.0
for i = 0 to n - 1
sum_x := sum_x + i
sum_y := sum_y + source[i]
sum_xy := sum_xy + i * source[i]
sum_x_squared := sum_x_squared + i * i
m = (n * sum_xy - sum_x * sum_y) / (n * sum_x_squared - sum_x * sum_x)
c = (sum_y - m * sum_x) / n
linear_regression = ((m * bar_index + c)*-1)
// Calculate linear regression Oscillator
linear_regression = linear_regression_osc(length)
// Normaliztion
linear_regression := (linear_regression - ta.sma(linear_regression, 100)) / ta.stdev(linear_regression, 100)
// Conditions of Mean Reversion and Trends
cond1 = ta.crossunder(linear_regression, 0)
cond2 = ta.crossover( linear_regression, 0)
cond_1 = ta.crossunder(linear_regression, linear_regression[2])
and
linear_regression > upper ? linear_regression[1] : na
cond_2 = ta.crossover(linear_regression, linear_regression[2])
and
linear_regression < lower ? linear_regression[1] : na
// Invalidation Price Levels
lowest. push(low)
highest.push(high)
switch
lowest.size() > 5 => lowest.shift(), highest.shift()
switch
cond1 => points := highest.max()
cond2 => points := lowest. min()
// ---------------------------------------------------------------------------------------------------------------------}
// 𝙑𝙄𝙎𝙐𝘼𝙇𝙄𝙕𝘼𝙏𝙄𝙊𝙉
// ---------------------------------------------------------------------------------------------------------------------{
// Defined Colors
color = linear_regression > 0
? color.from_gradient(linear_regression, 0, 2, color(na), col_up)
: color.from_gradient(linear_regression, -2, 0, col_dn, color(na))
color1= linear_regression > 0
? color.from_gradient(linear_regression, 0, 2, color(na), color.new(chart.fg_color, 50))
: color.from_gradient(linear_regression, -2, 0, color.new(chart.fg_color, 50), color(na))
color2= linear_regression > 0
? color.from_gradient(linear_regression, 0, 1, color(na), col_up)
: color.from_gradient(linear_regression, -1, 0, col_dn, color(na))
// Plot Oscillator
plot(linear_regression, color = color, style = plot.style_area)
// Zero Line
plot(0, color = color1, linewidth = 2)
// Upper and Lower Thresholds
p1 = plot(upper, display = display.none)
p3 = plot(lower, display = display.none)
p4 = plot(-4, display = display.none)
p2 = plot(4, display = display.none)
fill(p1, p2, 4, upper, na, color.new(col_up, 75))
fill(p3, p4, lower, -4, color.new(col_dn, 75), na)
if barstate.islast
l1 = label.new(bar_index, upper, str.tostring(upper),
style = label.style_diamond, size = size.tiny, textcolor = chart.fg_color, color = col_up)
label.delete(l1[1])
l2 = label.new(bar_index, lower, str.tostring(lower),
style = label.style_diamond, size = size.tiny, textcolor = chart.fg_color, color = col_dn)
label.delete(l2[1])
// Oscillator Mean Reversion above or below Thresholds
plotchar(cond_1, "", "◇",
color = col_dn,
location = location.absolute,
size = size.small,
offset = -1
)
plotchar(cond_2, "", "◇",
color = col_up,
location = location.absolute,
size = size.small,
offset = -1
)
// Oscillator Crosses zero Line
plotchar(cond1 ? 0 : na, "", "◆",
color = color.new(col_dn, 0),
location = location.absolute,
size = size.tiny,
offset = -1
)
plotchar(cond2 ? 0 : na, "", "◆",
color = color.new(col_up, 0),
location = location.absolute,
size = size.tiny,
offset = -1
)
// Trend Labels on the chart
switch
cond2 => label.new(chart.point.from_index(bar_index, low), "▲",
style = label.style_label_up,
textcolor = col_up,
size = size.large,
color = color(na),
force_overlay = true
)
cond1 => label.new(chart.point.from_index(bar_index, high), "▽",
style = label.style_label_down,
textcolor = col_dn,
size = size.large,
color = color(na),
force_overlay = true
)
// Meant Reversion Labels on the chart
switch
cond_2 => label.new(chart.point.from_index(bar_index, low),
text = "◆₩nReversion",
style = label.style_label_up,
textcolor = col_up,
size = size.normal,
color = color(na),
force_overlay = true
)
cond_1 => label.new(chart.point.from_index(bar_index, high),
text = "Reversion₩n◆",
style = label.style_label_down,
textcolor = col_dn,
size = size.normal,
color = color(na),
force_overlay = true
)
// Invalidation Price Levels
plot(not ta.change(points) ? points : na,
color = color2,
linewidth = 2,
style = plot.style_linebr,
force_overlay = true
)
if ta.change(points)
label.new(chart.point.from_index(bar_index, points[1]),
text = "Invalidation₩nLevel",
style = label.style_label_left,
textcolor = linear_regression < 0 ? col_up : col_dn,
size = size.small,
color = color(na),
force_overlay = true
)
// Candles Color
candle_col = candles ? (linear_regression < 0 ? col_dn : col_up) : na
plotcandle(open, high, low, close,
title = "Color Candles",
color = candle_col,
bordercolor = candle_col,
wickcolor = candle_col,
force_overlay= true
)
barcolor(candle_col)
2024-11-28
591
글번호 185758
지표