답변완료
예스트레이더 수식으로 변환 부탁 드립니다.
Volumatic Trend 지표를 예스로 변환 부탁 드립니다.
주말 행복하게 보내세요~ 감사합니다.^^
//@version=6
indicator("Volumatic Trend [ChartPrime]", overlay = true, max_bars_back = 5000)
// --------------------------------------------------------------------------------------------------------------------}
// 📌 𝙐𝙎𝙀𝙍 𝙄𝙉𝙋𝙐𝙏𝙎
// --------------------------------------------------------------------------------------------------------------------{
int length = input.int(40)
bool vol_h = input.bool(true, "Volume Histogram")
color color_up = input.color(#247ac0, "Up Trend")
color color_dn = input.color(#c88829, "Down Trend")
var upper = float(na)
var lower = float(na)
var lower_vol = float(na)
var upper_vol = float(na)
var step_up = float(na)
var step_dn = float(na)
var last_index = int(na)
// --------------------------------------------------------------------------------------------------------------------}
// 📌 𝙄𝙉𝘿𝙄𝘾𝘼𝙏𝙊𝙍 𝘾𝘼𝙇𝘾𝙐𝙇𝘼𝙏𝙄𝙊𝙉𝙎
// --------------------------------------------------------------------------------------------------------------------{
ema_swma(x, length) =>
ta.ema(x[3] * 1 / 6 + x[2] * 2 / 6 + x[1] * 2 / 6 + x[0] * 1 / 6, length)
atr = ta.atr(200)
ema1 = ema_swma(close, length)
ema2 = ta.ema(close, length)
trend = ema1[1] < ema2
if trend != trend[1]
upper := ema1 + atr * 3
lower := ema1 - atr * 3
lower_vol := lower + atr*4
upper_vol := upper - atr*4
step_up := (lower_vol-lower) / 100
step_dn := (upper-upper_vol) / 100
last_index := bar_index
vol = int(volume / ta.percentile_linear_interpolation(volume, 1000, 100) * 100)
vol_up = step_up * vol
vol_dn = step_dn * vol
// --------------------------------------------------------------------------------------------------------------------}
// 📌 𝙑𝙄𝙎𝙐𝘼𝙇𝙄𝙕𝘼𝙏𝙄𝙊𝙉
// --------------------------------------------------------------------------------------------------------------------{
color color = trend ? color_up : color_dn
color grad_col = color.from_gradient(vol, 0, 25, chart.bg_color, color)
color grad_col1 = color.from_gradient(vol, 0, 10, chart.bg_color, color)
color col_vol_up = trend ? grad_col : color(na)
color col_vol_dn = not trend ? grad_col : color(na)
plotcandle(open, high, low, close, title='Volumatic Candles Trend', color = grad_col1, wickcolor=grad_col1, bordercolor = grad_col1, force_overlay = true)
plotcandle(lower, lower, lower + vol_up, lower + vol_up, title='Volume Up Trend', color = col_vol_up, wickcolor=col_vol_up, bordercolor = col_vol_up, display = vol_h ? display.all : display.none, editable = false, force_overlay = true)
plotcandle(upper, upper, upper - vol_dn, upper - vol_dn, title='Volume Down Trend', color = col_vol_dn, wickcolor=col_vol_dn, bordercolor = col_vol_dn, display = vol_h ? display.all : display.none, editable = false, force_overlay = true)
plot(trend and vol_h ? na : upper, color = color, style = plot.style_linebr, display = vol_h ? display.all : display.none, editable = false, force_overlay = true)
plot(trend and vol_h ? lower : na, color = color, style = plot.style_linebr, display = vol_h ? display.all : display.none, editable = false, force_overlay = true)
plot(ema1, "Trend Line", color = color.new(color, 20), linewidth = 2, force_overlay = true)
plotshape(trend != trend[1] ? ema1[1] : na, "Trend Change", shape.diamond, location.absolute, color = color, size = size.tiny, offset = -1, force_overlay = true)
volume_ = close > open ? volume : -volume
if barstate.islast
delta = 0.
total = 0.
for i = 0 to (bar_index - last_index)
total += volume[i]
delta += volume_[i]
lblb = label.new(bar_index, vol_h ? (trend ? lower + vol_up : upper - vol_dn) : ema1
, "Delta > "+str.tostring(delta, format.volume) + "₩n"
+ "--------------------" + "₩n"
+ "Total > "+str.tostring(total, format.volume)
, textalign = text.align_left
, style = label.style_label_left, color = grad_col1)
label.delete(lblb[1])
2025-06-27
280
글번호 192157
지표
답변완료
문의 드립니다.
안녕하세요
본 시스템으로 시뮬레이션을 해보니
손절만 일어나고 익절 거래가 이루어 지지 않습니다.
검토 부탁드립니다.
*일봉기준
1. 매수진입: 첫매수는 RSI(14) 55이하일때, 2회차부터는 RSI 55이하, 평균단가 이하일때, 전일보다 하락했을때만 매수, 총 40회차 매수 (원금대비 1/40씩 매수)
2. 청산: 손절 40회차 모두 매수 후 평균 단가에서 -10% 시 손절
익절: 40회차 모두 매수 후 평균 단가에서 +10% 시 익절
> 예스스탁 님이 쓴 글입니다.
> 제목 : Re : 문의 드립니다.
>
안녕하세요
예스스탁입니다.
input : 총매수금(100000000);
input : 최대누적진입횟수(40);
input : 익절(10),손절(-10);
var1 = rsi(14);
if C < C[1] and var1 <= 55 Then
{
if MarketPosition == 0 or (MarketPosition == 1 and MaxEntries < 최대누적진입횟수 and C < AvgEntryPrice) Then
Buy("b",OnClose,Def,Floor((총매수금/40)/c));
}
if MarketPosition == 1 and MaxEntries == 최대누적진입횟수 Then
{
ExitLong("익절",AtLimit,AvgEntryPrice*(1+익절/100));
ExitLong("손절",AtLimit,AvgEntryPrice*(1+손절/100));
}
즐거운 하루되세요
2025-06-27
227
글번호 192155
지표