답변완료
종목검색과 지표 부탁드립니다.
종가가 이평선 고가 라인을 돌파하는 종목을 찾고 싶습니다.
죄송하지만 지표와 종목 검색 부탁드립니다.
고점
M=ma(C,기간,종류);
HH=Highest(M, 봉수);
Valuewhen(1, HH>HH(1), HH)
저점
M=ma(C, 기간, 종류);
LL=Lowest(M, 봉수);
Valuewhen(1, LL<LL(1), LL)
기간 20
종류 단순
봉수 20
2025-05-26
151
글번호 191194
종목검색
답변완료
지표 변환 부탁드립니다.
번번히 폐를 끼치네요. TradingView 지표 변환 부탁드립니다.
/@version=6
indicator("Range Filtered Trend Signals [AlgoAlpha]", overlay=true)
groupKalman = "Kalman Filter"
kalmanAlpha = input.float(0.01, title="Kalman Alpha")
kalmanBeta = input.float(0.1, title="Kalman Beta")
kalmanPeriod = input.int(77, title="Kalman Period")
dev = input.float(1.2, title="Deviation")
groupSupertrend = "Supertrend"
supertrendFactor = input.float(0.7, title="Supertrend Factor")
supertrendAtrPeriod = input.int(7, title="ATR Period")
groupColors = "Colors"
green = input.color(#00ffbb, title="Bullish Color")
red = input.color(#ff1100, title="Bearish Color")
kalman(a, b, alpha, beta) =>
var float v1 = na
var float v2 = 1.0
var float v3 = alpha * b
var float v4 = 0.0
var float v5 = na
if na(v1)
v1 := a[1]
v5 := v1
v4 := v2 / (v2 + v3)
v1 := v5 + v4 * (a - v5)
v2 := (1 - v4) * v2 + beta / b
v1
pine_supertrend(k, factor, atrPeriod) =>
src = k
atr = ta.atr(atrPeriod)
upperBand = src + factor * atr
lowerBand = src - factor * atr
prevLowerBand = nz(lowerBand[1])
prevUpperBand = nz(upperBand[1])
lowerBand := lowerBand > prevLowerBand or k[1] < prevLowerBand ? lowerBand : prevLowerBand
upperBand := upperBand < prevUpperBand or k[1] > prevUpperBand ? upperBand : prevUpperBand
int _direction = na
float superTrend = na
prevSuperTrend = superTrend[1]
if na(atr[1])
_direction := 1
else if prevSuperTrend == prevUpperBand
_direction := k > upperBand ? -1 : 1
else
_direction := k < lowerBand ? 1 : -1
superTrend := _direction == -1 ? lowerBand : upperBand
[superTrend, _direction]
k = kalman(close, kalmanPeriod, kalmanAlpha, kalmanBeta)
[supertrend, direction] = pine_supertrend(k, supertrendFactor, supertrendAtrPeriod)
vola = ta.wma(high-low, 200)
upper = k+vola*dev
lower = k-vola*dev
midbody = math.avg(close, open)
var trend = 0
if close > upper
trend := 1
else if close < lower
trend := -1
ktrend = 0
if direction < 0
ktrend := 1
else if direction > 0
ktrend := -1
t = 70
t_ = 20
p1 = plot(ktrend * trend == 1 ? k : na, color=color.gray, style = plot.style_linebr, linewidth = 3, title = 'k')
m = plot(midbody, color=color.gray, display = display.none, title = 'midbody')
up = plot(trend == -1 or ktrend * trend == -1 ? upper : na, color=ktrend * trend == -1 ? color.gray : ktrend == -1 ? color.new(red, t) : color.gray, style = plot.style_circles, title = 'upper')
lo = plot(trend == 1 or ktrend * trend == -1 ? lower : na, color=ktrend * trend == -1 ? color.gray : ktrend == 1 ? color.new(green, t) : color.gray, style = plot.style_circles, title = 'lower')
plotchar(ta.crossover(ktrend * trend, 0) ? k : na, location = location.absolute, color=trend == 1 ? green : red, char="◉", size=size.tiny)
x = color.new(chart.bg_color, 80)
x_ = color.new(trend == -1 ? green:red, t)
//fill(p1, m, k, midbody, x, x_)
fill(p1, m, color = x_)
//fill(up, lo, ktrend * trend == -1 ? color.new(color.gray, 90) : na, "Range")
fill(up, lo, color = x_)
2025-05-27
231
글번호 191192
지표
답변완료
청산 수식 수정 좀 요청 드립니다.
ㅇ 항상 많은 도움에 고맙습니다.
ㅇ 아래 매매식에서 청산부분이 안되는데 수정좀 요청 드림니다.
# 매수식 (요부분이 안됨니다)
1. 360틱 수익 이었다가 320틱 이하로 떨어지면 청산
2. 240틱 수익 이었다가 220틱 이하로 떨어지면 청산
3. 150틱 수익 이었다가 120틱 이하로 떨어지면 청산
4. 130틱 수익 이었다가 90틱 이하로 떨어지면 청산
5. 80틱 수익 이었다가 40틱 이하로 떨어지면 청산
6. 38틱 수익 이었다가 0틱 이하로 떨어지면 청산
## 아래 수식
##============================================================================================================
##============================================================================================================
If sDate >= 20250422 and stime >= 100000 and stime <= 220000
AND CrossUp( ma(c,5) , ma(c,20) ) Then
{
Buy( "수");
}
If sDate >= 20250422 and stime >= 100000 and stime <= 220000
AND CrossDown( ma(c,5) , ma(c,20) ) ) Then
{
Sell("도");
}
if MarketPosition == 1 then
{
if MarketPosition == 1 and highest(H,BarsSinceEntry) >= EntryPrice + PriceScale*360 Then ExitLong("bx1",AtStop, EntryPrice - PriceScale*320);
if MarketPosition == 1 and highest(H,BarsSinceEntry) >= EntryPrice + PriceScale*240 Then ExitLong("bx2",AtStop, EntryPrice - PriceScale*220);
if MarketPosition == 1 and highest(H,BarsSinceEntry) >= EntryPrice + PriceScale*150 Then ExitLong("bx3",AtStop, EntryPrice - PriceScale*120);
if MarketPosition == 1 and highest(H,BarsSinceEntry) >= EntryPrice + PriceScale*130 Then ExitLong("bx4",AtStop, EntryPrice - PriceScale*90);
if MarketPosition == 1 and highest(H,BarsSinceEntry) >= EntryPrice + PriceScale*80 Then ExitLong("bx5",AtStop, EntryPrice - PriceScale*40);
if MarketPosition == 1 and highest(H,BarsSinceEntry) >= EntryPrice + PriceScale*38 Then ExitLong("bx6",AtStop, EntryPrice - PriceScale*0);
}
if MarketPosition == -1 then
{
if MarketPosition == -1 and Lowest(L,BarsSinceEntry) <= EntryPrice - PriceScale*160 Then ExitShort("sx1",AtStop,EntryPrice - PriceScale*140);
if MarketPosition == -1 and Lowest(L,BarsSinceEntry) <= EntryPrice - PriceScale*130 Then ExitShort("sx2",AtStop,EntryPrice - PriceScale*100);
if MarketPosition == -1 and Lowest(L,BarsSinceEntry) <= EntryPrice - PriceScale*80 Then ExitShort("sx3",AtStop,EntryPrice - PriceScale*40);
}
##============================================================================================================
##============================================================================================================
SetStopEndofday(220000);
##============================================================================================================
##============================================================================================================
ㅇ 고맙 습니다. 수고하십시요.
2025-05-27
171
글번호 191191
시스템
답변완료
삼각형 표시 부탁드려요
short long 둘다 70 이상 올라 갔다가 70 이하로 떨어질때 매수 삼각형 ▲
short long 둘다 -75 이하로 떨어지면 매도 삼각형 ▼
부탁드려요 건강하세요
INPUT : short(12), Long(24);
var : A(0) , B(0);
A=iff(ACCUMN(C-C[1], short) > 0,
ACCUMN(C-C[1], short)*(-100)/
ACCUMN(iff(C<C[1], C-C[1], 0), short),
ACCUMN(C-C[1],short)*100/ACCUMN(iff(C<C[1], C-C[1], 0), short));
B=iff(ACCUMN(C-C[1], Long) > 0,
ACCUMN(C-C[1], Long)*(-100)/
ACCUMN(iff(C<C[1], C-C[1], 0), Long),
ACCUMN(C-C[1],Long)*100/ACCUMN(iff(C<C[1], C-C[1], 0), Long));
plot1(A , "short", red);
plot1(B , "long", blue);
plotbaseline1(70,"70")
plotbaseline2(-75,"-75")
2025-05-26
166
글번호 191190
지표
답변완료
Gradient Trend Filter 예스랭귀지로 변환 요청드립니다.
아래는 트레이딩뷰에서 많이 활용하고 있는 Chart Prime의 Gradient Trend Filter 수식입니다.
예스스탁에서 검토해보고자 변환 요청 드립니다.
Gradient Trend Filter 설명 자료를 유첨하였습니다.
감사합니다!
// --------------------------------------------------------------------------------------------------------------------}
// 𝙄𝙉𝘿𝙄𝘾𝘼𝙏𝙊𝙍 𝘾𝘼𝙇𝘾𝙐𝙇𝘼𝙏𝙄𝙊𝙉𝙎
// --------------------------------------------------------------------------------------------------------------------{
// Noise filter function
noise_filter(src, length) =>
alpha = 2 / (length + 1)
nf_1 = 0.0
nf_2 = 0.0
nf_3 = 0.0
nf_1 := (alpha * src) + ((1 - alpha) * nz(nf_1[1]))
nf_2 := (alpha * nf_1) + ((1 - alpha) * nz(nf_2[1]))
nf_3 := (alpha * nf_2) + ((1 - alpha) * nz(nf_3[1]))
nf_3 // Final output with three-stage smoothing
// Bands function
bands(src)=>
val = noise_filter(high-low, length)
upper3 = src + val * 0.618*2.5
upper2 = src + val * 0.382*2
upper1 = src + val * 0.236*1.5
lower1 = src - val * 0.236*1.5
lower2 = src - val * 0.382*2
lower3 = src - val * 0.618*2.5
[upper3, upper2, upper1, lower1, lower2, lower3]
float base = noise_filter(src, length)
[upper3, upper2, upper1, lower1, lower2, lower3] = bands(base)
float diff = base - base[2]
// Signals
bool signal_up = ta.crossover(diff, 0) and barstate.isconfirmed
bool signal_dn = ta.crossunder(diff, 0) and barstate.isconfirmed
// --------------------------------------------------------------------------------------------------------------------}
// 𝙑𝙄𝙎𝙐𝘼𝙇𝙄𝙕𝘼𝙏𝙄𝙊𝙉
// --------------------------------------------------------------------------------------------------------------------{
color gradient_col = color.from_gradient(diff, ta.lowest(diff, 100), ta.highest(diff, 100), color2, color1)
color trend_color = color.new(gradient_col, transp)
plot(base, "Filter", linewidth = width, color = diff >= 0 ? color1 : color2)
up3 = plot(upper3, display = display.none, editable = false)
up2 = plot(upper2, display = display.none, editable = false)
up1 = plot(upper1, display = display.none, editable = false)
lw1 = plot(lower1, display = display.none, editable = false)
lw2 = plot(lower2, display = display.none, editable = false)
lw3 = plot(lower3, display = display.none, editable = false)
fill(up3, lw3, trend_color)
fill(up2, lw2, trend_color)
fill(up1, lw1, trend_color)
plotshape(signal_up ? base[1] : na, "", shape.diamond, location.absolute, offset = -1, size = size.tiny, color = color.orange)
plotshape(signal_dn ? base[1] : na, "", shape.diamond, location.absolute, offset = -1, size = size.tiny, color = color.orange)
// --------------------------------------------------------------------------------------------------------------------}
2025-05-26
212
글번호 191187
지표