예스스탁
예스스탁 답변
2025-06-20 12:31:05
안녕하세요
예스스탁입니다.
input : orderFlowWindow(12);
input : smoothingLength(10);
input : upColor(Green);
input : downColor(Red);
var : efficiency(0),oF(0),orderFlow(0),stdDev(0),normalizedOrderFlow(0);
var : gap(0);
efficiency = abs(close-open)/volume;
oF = AccumN(IFF(close > close[1] , volume , IFf(close < close[1] , -volume , 0)) * efficiency, orderFlowWindow) / AccumN(efficiency, orderFlowWindow);
orderFlow = wma(2 * wma(oF, smoothingLength / 2) - wma(oF, smoothingLength), round(sqrt(smoothingLength),0));
stdDev = std(orderFlow, 45) * 1;
normalizedOrderFlow = orderFlow/(stdDev + stdDev);
// Plotting Order Flow Columns
gap = 0.4;
#plot1(gap,"Basis", blue);
plot2(0,"Basis", IFf(close > 0 , upColor , downColor));
#plot3(-gap,"Basis", Blue);
#plot4(1.5+gap,"upper");
plot5(1.5,"upper", blue);
#plot6(1.5-gap,"upper", blue);
#plot7(-1.5+gap,"lower", blue);
#plot8(-1.5,"lower", blue);
#plot9(-1.5-gap,"lower", blue);
plot10(avg(gap, 1.5-gap), "Upper Inter Range",Blue);
plot11(avg(-gap, -1.5+gap), "Lower Inter Range",Blue);
var : transparencyControl1(0),chg1(0),chg2(0),chg3(0),chg4(0);
transparencyControl1 = 30;
chg1 = normalizedOrderFlow * 0.80;
chg2 = normalizedOrderFlow * 0.60;
chg3 = normalizedOrderFlow * 0.40;
chg4 = normalizedOrderFlow * 0.20;
plot12(normalizedOrderFlow, "normalizedOrderFlow",iff(normalizedOrderFlow > 0 , upColor , downColor));
plot13(chg1, "chg1",IFF(normalizedOrderFlow > 0 , upColor , downColor));
plot14(chg2, "chg2",IFF(normalizedOrderFlow > 0 , upColor , downColor));
plot15(chg3, "chg3",IFF(normalizedOrderFlow > 0 , upColor , downColor));
plot16(chg4, "chg4",IFF(normalizedOrderFlow > 0 , upColor , downColor));
plot17(normalizedOrderFlow,"normalizedOrderFlow", IFf(normalizedOrderFlow > 0 , upColor , downColor));
var : tx(0);
if CrossDown(normalizedOrderFlow, 1.5) Then
{
tx = Text_New_Self(sDate,sTime,1.5,"▼");
Text_SetStyle(tx,2,1);
Text_SetColor(tx,downColor);
}
if CrossUp(normalizedOrderFlow, -1.5) Then
{
tx = Text_New_Self(sDate,sTime,-1.5,"▲");
Text_SetStyle(tx,2,0);
Text_SetColor(tx,upColor);
}
즐거운 하루되세요
> 사노소이 님이 쓴 글입니다.
> 제목 : 수식 부탁드립니다
> 지표식 부탁 드립니다.
indicator(title='Weighted Orderflow', precision = 3, overlay=false, explicit_plot_zorder = true)
// Input parameters
useSmoothing = input.bool(true, "Smooth OrderFlow?", group = "Calculation Parameters")
orderFlowWindow = input.int(12, minval=1, title='Order Flow Period', group = "Calculation Parameters")
smoothingLength = input.int(10, minval=1, title='Order Flow HMA Smoothing Length', group = "Calculation Parameters")
// Colors
upColor = input(#00ffbb, "Up Colour")
downColor = input(#ff1100, "Down Colour")
// Order Flow Calculation
efficiency = math.abs(close-open)/volume
orderFlow = math.sum((close > close[1] ? volume : (close < close[1] ? -volume : 0)) * efficiency, orderFlowWindow) / math.sum(efficiency, orderFlowWindow)
orderFlow := useSmoothing ? ta.hma(orderFlow, smoothingLength) : orderFlow
pine_vwrma(x, y) =>
ta.rma(x * volume, y) / ta.rma(volume, y)
// Standard Deviation Calculation
stdDev = ta.stdev(orderFlow, 45) * 1
normalizedOrderFlow = orderFlow/(stdDev + stdDev)
// Plotting Order Flow Columns
gap = 0.4
midu = plot(gap, "Basis", color = color.blue, display = display.none)
mmm = plot(0, "Basis", color = color.new(close > 0 ? upColor : downColor, 3), display = display.all)
midl = plot(-gap, "Basis", color = color.blue, display = display.none)
upu = plot(1.5+gap, "upper", color = color.blue, display = display.none)
uuu = plot(1.5, "upper", color = color.blue, display = display.none)
upl = plot(1.5-gap, "upper", color = color.blue, display = display.none)
lpu = plot(-1.5+gap, "lower", color = color.blue, display = display.none)
lll = plot(-1.5, "lower", color = color.blue, display = display.none)
lpl = plot(-1.5-gap, "lower", color = color.blue, display = display.none)
plot(math.avg(gap, 1.5-gap), "Upper Inter Range", color.new(chart.fg_color, 80), 1, plot.style_circles)
plot(math.avg(-gap, -1.5+gap), "Lower Inter Range", color.new(chart.fg_color, 80), 1, plot.style_circles)
fill(upu, uuu, 1.5+gap, 1.5, color.new(downColor, normalizedOrderFlow > 0 ? 20 : 60), color.new(downColor, normalizedOrderFlow > 0 ? 50 : 80), "Upper Cloud")
fill(upl, uuu, 1.52, 1.5-gap, color.new(downColor, 80), color.new(downColor, 99), "Upper Cloud")
fill(lpl, lll, -1.5, -1.5-gap, color.new(upColor, normalizedOrderFlow < 0 ? 50 : 80), color.new(upColor, normalizedOrderFlow < 0 ? 20 : 60), "lower Cloud")
fill(lpu, lll, -1.5+gap, -1.5, color.new(upColor, 99),color.new(upColor, 80), "lower Cloud")
transparencyControl1 = 30
chg1 = normalizedOrderFlow * 0.80
chg2 = normalizedOrderFlow * 0.60
chg3 = normalizedOrderFlow * 0.40
chg4 = normalizedOrderFlow * 0.20
plot(normalizedOrderFlow, color = color.new(normalizedOrderFlow > 0 ? upColor : downColor, transparencyControl1+60), style = plot.style_columns, linewidth = 4)
plot(chg1, color = color.new(normalizedOrderFlow > 0 ? upColor : downColor, transparencyControl1+55), style = plot.style_columns, linewidth = 4)
plot(chg2, color = color.new(normalizedOrderFlow > 0 ? upColor : downColor, transparencyControl1+40), style = plot.style_columns, linewidth = 4)
plot(chg3, color = color.new(normalizedOrderFlow > 0 ? upColor : downColor, transparencyControl1+30), style = plot.style_columns, linewidth = 4)
plot(chg4, color = color.new(normalizedOrderFlow > 0 ? upColor : downColor, transparencyControl1+25), style = plot.style_columns, linewidth = 4)
plot(normalizedOrderFlow, color = color.new(normalizedOrderFlow > 0 ? upColor : downColor, transparencyControl1))
plotchar(ta.crossunder(normalizedOrderFlow, 1.5) ? 2.1 : na, "Bearish Reversal", "▼", location.absolute, downColor, size = size.tiny)
plotchar(ta.crossover(normalizedOrderFlow, -1.5) ? -2.1 : na, "Bullish Reversal", "▲", location.absolute, upColor, size = size.tiny)