답변완료
부탁드립니다.
안녕하세요. 수고에 항상 감사드립니다.
1>
아래 수식에 signal이 50선 상방 통과시 분홍색● 봉이 생길때 봉의 저가선 종가선(연한그레이) 생기고 저가선과 종가선 사이는 연한 분홍색이 채워져 박스형식으로 생기도록 부탁드립니다.
다음 ●이 생기면 그전의 선은 없어지고 새로 생겨 선은 항상 하나만 유지합니다.
반대로 파랑색● 고가선 종가선 (연한그레이) --- 연한 연두색 채워지게
2>
signal 선 그림처럼 다이버전스 선이 생기도록 가능하다면 부탁드립니다.
봉에도 같이 생기는게 가능하다면 그럼처럼 부탁드립니다.
3> 그림처럼 노랑 박스안 80과 20사이에 5단위의 얇은회색점선 부탁드립니다.
input : length(14);
input : smoType1(3); #1:EMA, 2:SMA, 3:RMA, 4TMA
input : arsiCss(silver);
input : autoCss(true);
//Signal Line
input : smooth(14);
input : smoType2(1);#1EMA, 2SMA, 3RMA, 4TMA
input : signalCss(Orange);
//OB/OS Style
input : obValue(80);
input : obCss(Green);
input : obAreaCss(LightGreen);
input : osValue(20);
input : osCss(Red);
input : osAreaCss(LightRed);
var : src(0);
var : upper(0),lower(0),r(0);
var : d(0),diff(0),alpha(0),num(0),den(0),arsi(0),signal(0),a(0),tx(0);
src = close;
upper = highest(src, length);
lower = lowest(src, length);
r = upper - lower;
d = src - src[1];
diff = iff(upper > upper[1] , r , iff(lower < lower[1] , -r , d));
if smoType1 == 1 Then
{
num = ema(diff, length);
den = ema(abs(diff), length);
}
if smoType1 == 2 Then
{
num = ma(diff, length);
den = ma(abs(diff), length);
}
if smoType1 == 3 Then
{
alpha = 1/length;
num = iff(isnan(num[1]) == true, ma(diff, length) , alpha * diff + (1 - alpha) * iff(isnan(num[1])==true,0,num[1]));
den = iff(isnan(den[1]) == true, ma(abs(diff), length) , alpha * abs(diff) + (1 - alpha) * iff(isnan(den[1])==true,0,den[1]));
}
if smoType1 == 4 Then
{
num = ma(ma(diff, length),length);
den = ma(ma(abs(diff), length), length);
}
arsi = num / den * 50 + 50;
if smoType2 == 1 Then
{
signal = ema(arsi, smooth);
}
if smoType2 == 2 Then
{
signal = ma(arsi, smooth);
}
if smoType2 == 3 Then
{
a = 1/smooth;
signal = iff(isnan(signal[1]) == true, ma(arsi, length) , a * arsi + (1 - a) * iff(isnan(signal[1])==true,0,signal[1]));
}
if smoType2 == 4 Then
{
signal = ma(arsi, smooth);
}
plot1(arsi, "Ultimate RSI",IFf(arsi > obValue , obCss , IFF(arsi < osValue , osCss ,IFf( autoCss , Black , arsiCss))));
plot2(signal, "Signal Line", signalCss);
PlotBaseLine1(obValue, "Overbought");
PlotBaseLine2(50, "Midline");
PlotBaseLine3(osValue, "Oversold");
var : tx1(0),tx2(0);
if CrossUp(signal,50) Then
{
tx1 = Text_New(sDate,sTime,L,"●");
Text_SetColor(tx1,rgb(255, 0, 127));
Text_SetStyle(tx1,2,0);
Text_SetSize(tx1,30);
tx2 = Text_New_Self(sDate,sTime,50,"●");
Text_SetColor(tx2,rgb(255, 0, 127));
Text_SetStyle(tx2,2,0);
Text_SetSize(tx2,16);
}
if CrossDown(signal,50) Then
{
tx1 = Text_New(sDate,sTime,H,"●");
Text_SetColor(tx1,rgb(0, 145, 255));
Text_SetStyle(tx1,2,1);
Text_SetSize(tx1,30);
tx2 = Text_New_Self(sDate,sTime,50,"●");
Text_SetColor(tx2,rgb(0, 145, 255));
Text_SetStyle(tx2,2,1);
Text_SetSize(tx2,16);
}
if CrossUp(signal,80) Then
{
tx1 = Text_New(sDate,sTime,L,"◈");
Text_SetColor(tx1,rgb(255, 0, 212));
Text_SetStyle(tx1,2,0);
Text_SetSize(tx1,15);
tx2 = Text_New_Self(sDate,sTime,50,"◈");
Text_SetColor(tx2,Red);
Text_SetStyle(tx2,2,0);
Text_SetSize(tx2,20);
}
if CrossDown(signal,20) Then
{
tx1 = Text_New(sDate,sTime,H,"◈");
Text_SetColor(tx1,rgb(34, 0, 204));
Text_SetStyle(tx1,2,1);
Text_SetSize(tx1,15);
tx2 = Text_New_Self(sDate,sTime,50,"◈");
Text_SetColor(tx2,Blue);
Text_SetStyle(tx2,2,1);
Text_SetSize(tx2,20);
}
2025-06-23
345
글번호 191979
지표
답변완료
질문드립니다.
거래량 한봉으로만 표현되는것을 , 총 누적수량으로 볼수 있을까요??
input : 조정1(23.6),조정2(38.2),조정3(60.0),조정4(61.8),조정5(78.4);
input : 글자크기(12);
var : a1(0),a2(0),a3(0),b1(0),b2(0),b3(0),Grid(0);
value1=(high-close)/(high-low);
Value2=(close-low)/(high-low);
var1 = iff((high+low)/2<=close,volume,0);
var2 = iff((high+low)/2<=close,volume*value1,0);
var3 = iff((high+low)/2>close,volume,0);
Var4 = iff((high+low)/2>close,volume*Value2,0);
a1=iff((high+low)/2<=close,volume,0);
a2=(high-close)/(high-low);
a3=iff((high+low)/2<=close,volume*a2,0);
b1=iff((high+low)/2>close,volume,0);
b2=(close-low)/(high-low);
b3=iff((high+low)/2>close,volume*b2,0);
Var5 = iff(a1>0,(a3/a1)*100,iff(b1>0,(b3/b1)*100,0));
Plot1(var1);
Plot2(Var2);
Plot3(Var3);
Plot4(Var4);
Plot5(Var5);
if Index == 0 Then
Grid = Grid_New(7, 2, 5,White, Gray, 1, Gray, 0);
if LastBarOnChart == 1 Then
{
Grid_Cell(Grid,0,0,"매수",0,0,BLACK,White);
Grid_Cell(Grid,1,0,NumToStr(var1,2),0,0,Red,White);
Grid_CellSetTextSize(Grid,0,0,글자크기);
Grid_CellSetTextSize(Grid,1,0,글자크기);
Grid_Cell(Grid,0,1,"매수중매도",0,0,BLACK,White);
Grid_Cell(Grid,1,1,NumToStr(var2,2),0,0,BLACK,White);
Grid_CellSetTextSize(Grid,0,1,글자크기);
Grid_CellSetTextSize(Grid,1,1,글자크기);
Grid_Cell(Grid,0,2,"매도",0,0,BLACK,White);
Grid_Cell(Grid,1,2,NumToStr(var3,2),0,0,Blue,White);
Grid_CellSetTextSize(Grid,0,2,글자크기);
Grid_CellSetTextSize(Grid,1,2,글자크기);
Grid_Cell(Grid,0,3,"매도중매수",0,0,BLACK,White);
Grid_Cell(Grid,1,3,NumToStr(var4,2),0,0,BLACK,White);
Grid_CellSetTextSize(Grid,0,3,글자크기);
Grid_CellSetTextSize(Grid,1,3,글자크기);
Grid_Cell(Grid,0,4,"대비(%)",0,0,Green,White);
Grid_Cell(Grid,1,4,NumToStr(var5,2),0,0,BLACK,White);
Grid_CellSetTextSize(Grid,0,4,글자크기);
Grid_CellSetTextSize(Grid,1,4,글자크기);
2025-06-20
316
글번호 191973
지표
답변완료
지표로 전환 부탁드려요
건강하세요
var : aa(0),bb(0),a(0),b(0),av(0),bv(0),d(0),e(0),f(0),g(0);
var : bf(0),sf(0),pbf(0),psf(0),bfh(0),SFH(0);
aa=C-(H+L)/2;
bb=(O+C+H+L+Iff(0<=aa,(C+H)/2,(C+L)/2))/5;
A=Accum(Iff(0<=aa,bb*V,0));
B=Accum(Iff(aa<0,bb*V,0));
AV=Accum(Iff(0<=aa,V,0));
BV=Accum(Iff(aa<0,V,0));
if sDate != sDate[1] Then
{
D=A[1];
E=B[1];
F=AV[1];
G=BV[1];
}
BF=(A-D)/(AV-F);
SF=(B-E)/(BV-G);
PBF=Iff(0<BF,BF,bb);
PSF=Iff(0<SF,SF,bb);
IF PBF>PSF && CROSSUP(C, PBF) && C>O TheN
Find(1);
2025-06-20
258
글번호 191964
지표
답변완료
수식 부탁드립니다
지표식 부탁 드립니다.
//@version=5
indicator(title='Machine Learning Momentum Index (MLMI)', shorttitle='Machine Learning Momentum Index (MLMI)', overlay=false, precision=1)
// ~~ ToolTips {
t1 ="This parameter controls the number of neighbors to consider while making a prediction using the k-Nearest Neighbors (k-NN) algorithm. By modifying the value of k, you can change how sensitive the prediction is to local fluctuations in the data. ₩n₩nA smaller value of k will make the prediction more sensitive to local variations and can lead to a more erratic prediction line. ₩n₩nA larger value of k will consider more neighbors, thus making the prediction more stable but potentially less responsive to sudden changes."
t2 ="The parameter controls the length of the trend used in computing the momentum. This length refers to the number of periods over which the momentum is calculated, affecting how quickly the indicator reacts to changes in the underlying price movements. ₩n₩nA shorter trend length (smaller momentumWindow) will make the indicator more responsive to short-term price changes, potentially generating more signals but at the risk of more false alarms. ₩n₩nA longer trend length (larger momentumWindow) will make the indicator smoother and less responsive to short-term noise, but it may lag in reacting to significant price changes."
//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~}
// ~~ Input Parameters {
numNeighbors = input(200, title='Prediction Data (k)', tooltip=t1)
momentumWindow = input.int(20, step=2, minval=10, maxval=200, title='Trend Length', tooltip=t2)
//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~}
// ~~ Moving Averages & RSI {
MA_quick = ta.wma(close, 5)
MA_slow = ta.wma(close, 20)
rsi_quick = ta.wma(ta.rsi(close, 5),momentumWindow)
rsi_slow = ta.wma(ta.rsi(close, 20),momentumWindow)
//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~}
// ~~ Crossover Conditions {
pos = ta.crossover(MA_quick, MA_slow)
neg = ta.crossunder(MA_quick, MA_slow)
//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~}
// ~~ Type Definition {
type Data
array<float> parameter1
array<float> parameter2
array<float> priceArray
array<float> resultArray
// Create a Data object
var data = Data.new(array.new_float(1, 0), array.new_float(1, 0), array.new_float(1, 0), array.new_float(1, 0))
//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~}
// ~~ Method that saves the last trade and temporarily holds the current one. {
method storePreviousTrade(Data d, p1, p2) =>
d.parameter1.push(d.parameter1.get(d.parameter1.size() - 1))
d.parameter2.push(d.parameter2.get(d.parameter2.size() - 1))
d.priceArray.push(d.priceArray.get(d.priceArray.size() - 1))
d.resultArray.push(close >= d.priceArray.get(d.priceArray.size() - 1) ? 1 : -1)
d.parameter1.set(d.parameter1.size() - 1, p1)
d.parameter2.set(d.parameter2.size() - 1, p2)
d.priceArray.set(d.priceArray.size() - 1, close)
//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~}
// ~~ Method to Make Prediction {
method knnPredict(Data d, p1, p2, k) =>
// Create a Distance Array
distances = array.new_float(0)
n = d.parameter1.size() - 1
for i = 0 to n
distance = math.sqrt(math.pow(p1 - d.parameter1.get(i), 2) + math.pow(p2 - d.parameter2.get(i), 2))
distances.push(distance)
// Get Neighbors
sortedDistances = distances.copy()
sortedDistances.sort()
셀렉티드Distances = sortedDistances.slice( 0, math.min(k, sortedDistances.size()))
maxDist = 셀렉티드Distances.max()
neighbors = array.new_float(0)
for i = 0 to distances.size() - 1
if distances.get(i) <= maxDist
neighbors.push(d.resultArray.get(i))
// Return Prediction
prediction = neighbors.sum()
prediction
if pos or neg
data.storePreviousTrade(rsi_slow, rsi_quick)
//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~}
// ~~ Plots {
prediction = data.knnPredict(rsi_slow, rsi_quick, numNeighbors)
prediction_ = plot(prediction, color=color.new(#426eff, 0), title="MLMI Prediction")
prediction_ma = ta.wma(prediction, 20)
plot(prediction_ma, color=color.new(#31ffc8, 0), title="WMA of MLMI Prediction")
hline(0, title="Mid Level")
//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~}
// ~~ Gradient Fill {
upper = ta.highest(prediction,2000)
lower = ta.lowest(prediction,2000)
upper_ = upper - ta.ema(ta.stdev(prediction,20),20)
lower_ = lower + ta.ema(ta.stdev(prediction,20),20)
channel_upper = plot(upper, color = na, editable = false, display = display.none)
channel_lower = plot(lower, color = na, editable = false, display = display.none)
channel_mid = plot(0, color = na, editable = false, display = display.none)
// ~~ Channel Gradient Fill {
fill(channel_mid, channel_upper, top_value = upper, bottom_value = 0, bottom_color = na, top_color = color.new(color.lime,75),title = "Channel Gradient Fill")
fill(channel_mid, channel_lower, top_value = 0, bottom_value = lower, bottom_color = color.new(color.red,75) , top_color = na,title = "Channel Gradient Fill")
//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~}
// ~~ Overbought/Oversold Gradient Fill {
fill(prediction_, channel_mid, upper, upper_, top_color = color.new(color.lime, 0), bottom_color = color.new(color.green, 100),title = "Overbought Gradient Fill")
fill(prediction_, channel_mid, lower_, lower, top_color = color.new(color.red, 100), bottom_color = color.new(color.red, 0),title = "Oversold Gradient Fill")
2025-06-20
369
글번호 191959
지표
답변완료
부틱드립니다
수고하십니다
매번 부탁드려서 죄송합니다
예스로 변경드립니다
// This Pine S cript™ code is subject to the terms of the Mozilla Public License 2.0 at https://mozilla.org/MPL/2.0/
// © ChartPrime
//@version=5
indicator('Linear Regression Channel', overlay = true, max_lines_count = 3)
// ---------------------------------------------------------------------------------------------------------------------}
// 𝙐𝙎𝙀𝙍 𝙄𝙉𝙋𝙐𝙏𝙎
// ---------------------------------------------------------------------------------------------------------------------{
bool bands = input.bool(true, "Plot Linear Regression Bands", group = "Settings Bands")
int window = input.int(150, "Length", group = "Settings Bands")
float devlen_b = input.float(3., "Deviation Linear Regression Bands",step=0.1, group = "Settings Bands")
bool channel = input.bool(false, "Plot Linear Regression Channel", group = "Settings Channel")
int window1 = input.int(150, "Channel Length", group = "Settings Channel")
float devlen1 = input.float(1., "Deviation Linear Regression Channel",step=0.1, group = "Settings Channel")
bool channel1 = input.bool(false, "Plot Future Projection of linear regression", group = "Future Projection Channel")
bool arr_dirc = input.bool(false, "Plot Arrow Direction", group = "Future Projection Channel")
int window2 = input.int(50, "Length", group = "Future Projection Channel")
float devlen2 = input.float(1., "Deviation Future Projection Regression Channel",step=0.1, group = "Future Projection Channel")
// Define colors for up, down, and mid lines
color col_dn = #f01313
color col_up = color.aqua
color col_mid = color.yellow
color gray = color.gray
color fg_col = chart.fg_color
// Regression Channel Arrays Line
var reglines = array.new_line(3)
var reglines_ = array.new_line(3)
// ---------------------------------------------------------------------------------------------------------------------}
// 𝙄𝙉𝘿𝙄𝘾𝘼𝙏𝙊𝙍 𝘾𝘼𝙇𝘾𝙐𝙇𝘼𝙏𝙄𝙊𝙉𝙎
// ---------------------------------------------------------------------------------------------------------------------{
//@function linear_regression
//@des cription Calculates linear regression coefficients for a given source and window.
//@param src (series float) The data series on which linear regression is calculated.
//@param window (int) The number of bars to use in the calculation.
//@returns the intercept slope, Deviation, end of the channel.
linear_regression(src, window) =>
sum_x = 0.0
sum_y = 0.0
sum_xy = 0.0
sum_x_sq = 0.0
// Calculate sums
for i = 0 to window - 1 by 1
sum_x += i + 1
sum_y += src[i]
sum_xy += (i + 1) * src[i]
sum_x_sq += math.pow(i + 1, 2)
// Calculate linear regression coefficients
slope = (window * sum_xy - sum_x * sum_y) / (window * sum_x_sq - math.pow(sum_x, 2))
intercept = (sum_y - slope * sum_x) / window
y1 = intercept + slope * (window - 1)
dev = 0.0
for i = 0 to window - 1
dev := dev + math.pow(src[i] - (slope * (window - i) + intercept), 2)
dev := math.sqrt(dev/window)
[intercept, y1, dev, slope]
[y2, y1, dev, slope] = linear_regression(close, window)
[y2_, y1_, dev_, slope_] = linear_regression(close, window1)
[y2__, y1__, dev__, slope__] = linear_regression(close, window2)
// Linear Regression Channel Lines
series float mid = y2 + slope
series float upper = mid + ta.rma(high - low, window) * devlen_b
series float lower = mid - ta.rma(high - low, window) * devlen_b
// Returns True for window length period
isAllowed = (last_bar_index - bar_index < window1)
// ---------------------------------------------------------------------------------------------------------------------}
// 𝙑𝙄𝙎𝙐𝘼𝙇𝙄𝙕𝘼𝙏𝙄𝙊𝙉
// ---------------------------------------------------------------------------------------------------------------------{
// Plot upper, lower, and mid lines if channel is not enabled
p_u = plot(upper, color = bands and channel ? na : bands ? gray : na, linewidth = 2)
p_l = plot(lower, color = bands and channel ? na : bands ? gray : na, linewidth = 2)
p_m = plot(mid, color = bands and channel ? na : bands ? gray : na)
// Fill areas between upper/mid and lower/mid lines
fill(p_u, p_m, mid, upper, na, bands and channel ? na : bands ? color.new(col_up, 80) : na)
fill(p_m, p_l, lower, mid, bands and channel ? na : bands ? color.new(col_dn, 80) : na, na)
if barstate.islast and channel
for i = 0 to 2
array.set(reglines, i,
line.new(x1 = bar_index - (window1 - 1),
y1 = y1_ + dev_ * devlen1 * (i - 1),
x2 = bar_index,
y2 = y2_ + dev_ * devlen1 * (i - 1),
color = color.gray,
style = i % 2 == 1 ? line.style_dashed : line.style_solid,
width = 2,
extend = extend.none)
)
linefill.new(array.get(reglines, 1), array.get(reglines, 2), color = color.new(col_up, 90))
linefill.new(array.get(reglines, 1), array.get(reglines, 0), color = color.new(col_dn, 90))
if barstate.islast and channel1
for i = 0 to 2
array.set(reglines_, i,
line.new(x1 = bar_index - (window2 - 1),
y1 = y1__ + dev__ * devlen2 * (i - 1),
x2 = bar_index,
y2 = y2__ + dev__ * devlen2 * (i - 1),
color = color.gray,
style = i % 2 == 1 ? line.style_dotted : line.style_dashed,
width = 1,
extend = extend.right)
)
linefill.new(array.get(reglines_, 1), array.get(reglines_, 2), color = color.new(col_up, 95))
linefill.new(array.get(reglines_, 1), array.get(reglines_, 0), color = color.new(col_dn, 95))
if arr_dirc
l1 = label.new(chart.point.from_index(bar_index, hl2 > y2__ ? high : low),
text = hl2 > y2__ ? "⇗" : hl2 < y2__ ? "⇘" : "⇒",
textcolor = hl2 > y2__ ? col_up : hl2 < y2__ ? col_dn : gray,
color = color(na),
size = size.huge,
style = label.style_label_left
)
label.delete(l1[1])
// Bar Heat Map
b_c = (close - lower) / (upper - lower)
b_c := b_c > 1 ? 1 : b_c < 0 ? 0 : b_c
bar_color = channel ?
(isAllowed ?
(b_c <= 0.5 ? color.from_gradient(b_c, 0, 0.5, col_up, col_mid) : color.from_gradient(b_c, 0.5, 1, col_mid, col_dn))
: na)
: (b_c >= 0.5 ? color.from_gradient(b_c, 0.5, 1, col_mid, col_up) : color.from_gradient(b_c, 0, 0.5, col_dn, col_mid))
plotcandle(open, high, low, close,
title = "Bar HeatMap",
color = bar_color,
wickcolor = bar_color,
bordercolor = bar_color
)
barcolor(bar_color)
// Conditions for crossovers
condition1 = bands and channel ? na : bands ? ta.pivotlow(3, 3) and close < lower : na
condition2 = bands and channel ? na : bands ? ta.pivothigh(3, 3) and close > upper: na
// Plot markers for channel break outs
plotchar(condition1, "", "◆", size=size.tiny, location=location.belowbar, color = col_up)
plotchar(condition2, "", "◆", size=size.tiny, location=location.abovebar, color = col_dn)
// ------------------------------------------------------------------------------------
2025-06-20
316
글번호 191951
지표
답변완료
트레이딩뷰 지표 변환 요청
트레이딩뷰 지표소스로 종목 검색식을 만들고 싶은데
가능할까요?
지표상 Buy 신호 종목 검색을 하고 싶습니다.
//@version=4
study("Hull Trend", shorttitle="HMA Trend",overlay=true)
length = input(24)
src = input(hl2)
showcross = input(true, "Show cross over/under")
hma(_src, _length)=>
wma((2 * wma(_src, _length / 2)) - wma(_src, _length), round(sqrt(_length)))
hma3(_src, _length)=>
p = length/2
wma(wma(close,p/3)*3 - wma(close,p/2) - wma(close,p),p)
a = hma(src, length)
b = hma3(src, length)
c = b > a ? color.lime : color.red
p1 = plot(a,color=c,linewidth=1,transp=75)
p2 = plot(b,color=c,linewidth=1,transp=75)
fill(p1,p2,color=c,transp=55)
crossdn = a > b and a[1] < b[1]
crossup = b > a and b[1] < a[1]
plotshape(showcross and crossdn ? a : na, location=location.absolute, style=shape.labeldown, color=color.red, size=size.tiny, text="Sell", textcolor=color.white, transp=0, offset=-1)
plotshape(showcross and crossup ? a : na, location=location.absolute, style=shape.labelup, color=color.green, size=size.tiny, text="Buy", textcolor=color.white, transp=0, offset=-1)
2025-06-20
342
글번호 191949
종목검색