답변완료
수식검토
VLineUp(0),
VLineDn(0),
HHighest(0),
LLowest(0),
JustChanged(FALSE),
VLine(0), DBN(0),T(0);
Array:
Highs[35](0),
Lows[35](0),
RRange[35](0),
UpWave[1](FALSE),
DnWave[1](FALSE);
If STime == 180000 Then
DBN = 0;
DBN = DBN + 1;
Var1 = Period;
Var2 = Var1 - 1;
Var3 = Var1 - 2;
Var5 = Sence;
Var6 = H-L;
JustChanged = FALSE;
if CurrentBar <= Var2 then begin
Highs[CurrentBar] = Close;
Lows[CurrentBar] = Close;
RRange[CurrentBar] = (H-L) /2;
end;
if CurrentBar == Var1 then begin
if Highs[Var2] >= Highs[Var3] then begin
UpWave[1] = TRUE;
HHighest = Highs[Var2];
VLineUp = HHighest - (Var5 * MA(Var6,Var2));
#Plot1(VLineUp,"VLineUp");
end;
if Highs[Var2] < Highs[Var3] then begin
DnWave[1] = TRUE;
LLowest = Lows[Var2];
VLineDn = LLowest + (Var5 * MA(Var6,Var2));
#Plot2(VLineDn,"VLineDn");
end;
end;
if CurrentBar > Var1 then begin
if DnWave[1] and Close > VLineDn then begin
DnWave[1] = FALSE;
UpWave[1] = TRUE;
JustChanged = TRUE;
HHighest = Close;
LLowest = 0;
end;
if UpWave[1] and Close < VLineUp and JustChanged == FALSE then begin
UpWave[1] = FALSE;
DnWave[1] = TRUE;
JustChanged = TRUE;
LLowest = Close;
HHighest = 0;
end;
if JustChanged == FALSE then begin
if Close > HHighest then
HHighest = Close;
else if Close < LLowest then
LLowest = Close;
end;
VLineUp = HHighest - (Var5 * MA(Var6,Var2));
VLineDn = LLowest + (Var5 * MA(Var6,Var2));
if UpWave[1] then
T = 1;
else if DnWave[1] then
T = -1;
end;
Input : BBP(20), MultiD(2),P(30);
var : BBmd(0),BBup(0),BBdn(0),mav(0);
var : S(0),Pc(0);
BBmd = ma(C,Period);
BBup = BollBandUp(BBP,MultiD);
BBdn = BollBandDown(BBP,MultiD);
mav = ma(C,P);
if CrossDown(C,BBup) and t == -1 and c > mav Then
{
S = -1;
Pc = C;
}
if crossup(C,BBdn) and t == 1 and c < mav Then
{
S = 1;
Pc = c;
}
if S == -1 and C >= Pc+PriceScale*100 Then
{
S = -2;
Sell();
}
if S == 1 and C <= Pc-PriceScale*100 Then
{
S = 2;
Buy();
}
위 식에서 손절전환이 되어야 하는데 돼지 않아서 문의 합니다 검토 바람니다
sw2선도 바뀌었는데도 전환이 안 이루어짐 sw2선이 바뀌면 청산이나 손절되는 걸로 수정요
첨부sw2
2025-08-02
159
글번호 192944
시스템
답변완료
수식좀 요청 드립니다.
ㅇ항상 많은 도움에 고맙습니다.
ㅇ요청1:바이너리 지표를 스톡 으로 표현할수 있나요? 가능 하면 부탁 좀 드리겠습니다.
ㅇ아래 수식에서 스톡과 MACD를 "다음 항목과 공유" 하면 (사진1)
수치가 틀려서 거의 수평선으로 나옴니다. (사진2)
혹시 두수식 수치 차이가 커서 지표가 거의 수평선으로 나오는데
스톡 하고 같은 싸이클로 공유 할수 있나요?
##
input : 기간1(25),기간2(25);
var : ap(0),esa(0),d(0),ci(0),wt1(0),wt2(0);
ap = (HIGH+LOW+CLOSE)/3;
esa = Ema(ap, 기간1);
d = Ema(abs(ap - esa), 기간1);
ci = (ap - esa) / (0.015 * d);
wt1 = Ema(ci,기간2);
wt2 = ma(wt1,4);
Var21 = ma(wt1,기간1) ;
Var22 = ma(wt2,기간2) ;
Plot1(Var21,"11");
plot2(Var22,"22");
PlotBaseLine1(0,"0",Rgb(255,0,0),Def,0) ;
## MACD
Input : shortPeriod22(20), longPeriod22(60), Period22(20);
Var : MACDv22(0), MACDsig22(0),macdosc22(0) ;
MACDv22 = MACD(shortPeriod22, longPeriod22);
MACDsig22 = ema(MACDv22,Period22);
macdosc22 = MACDv22-ema(MACDv22,Period22);
var21 = ma(MACDv22 ,20 ) ;
var22 = ma(MACDv22 ,5 ) ;
var23 = ma(MACDv22 ,60 ) ;
var11 = ma(MACDv22 ,10 ) ;
var12 = ( VAR21 + Var22 + Var23 + Var11) / 3.5 ;
Plot41(var12 - PriceScale*0,"이격",IFF(var12 > var12[2] ,Rgb(255,0,255), Rgb(0,0,255)),Def,IFf(var12 < var12[2],3,3));
ㅇ 좋은 한주 되십시요. 고맙습니다.
2025-08-04
196
글번호 192939
지표
답변완료
지표 수식을 부탁합니다.
항상 노고에 감사드립니다.
다음 TV수식을 YT형식으로 부탁합니다. 개인적으로 해봤는데 PivotHigh, PivotLow에서 막히네요.
그리고 MidLine(avg)을 ① crossUp하거나 ② 위에서 1%이내로 근접하는 종목을 검색하는 식도 부탁드립니다.
//@version=6
indicator("#Step Channel Momentum Trend [ChartPrime]", overlay = true, max_labels_count = 500)
// -----------------------------------}
// USER INPUTS
// -----------------------------------{
len = input.int(3, "Length", tooltip = "Pivot Length")
mult = input.float(0.6, "Multiplier", step =0.1, tooltip = "Bands Multiplier")
color_t_up = input.color(color.rgb(202, 38, 65), "", inline = "Color", group = "Momentum Colors")
color_t = input.color(color.orange, "", inline = "Color", group = "Momentum Colors")
color_t_dn = input.color(color.rgb(26, 190, 127), "", inline = "Color", group = "Momentum Colors")
var p_h = float(na)
var p_l = float(na)
var trend = bool(na)
market_state = "Range"
// -----------------------------------}
// INDICATOR CALCUATIONS
// -----------------------------------{
ph = ta.pivothigh(len, len)
pl = ta.pivotlow(len, len)
if not na(ph)
p_h := ph
label.new(bar_index-len, ph, "☆", style = label.style_label_center, textcolor = color.white, size = size.normal, color = color.lime)
if not na(pl)
p_l := pl
label.new(bar_index-len, pl, "★", style = label.style_label_center, textcolor = color.white, size = size.normal, color = color.purple)
avg = math.avg(p_h, p_l)
atr = ta.atr(200)*mult
upper = avg + atr
lower = avg - atr
if hl2 > upper
color_t := color_t_up
trend := true
market_state := "Momentum Up"
if hl2 < lower
color_t := color_t_dn
trend := false
market_state := "Momentum Down"
// -----------------------------------}
// VISUALIZATIONS
// -----------------------------------{
plot(avg, "MidLine", color = color_t, linewidth = 3)
plot(upper, "Upper", color = chart.fg_color, style = plot.style_linebr)
plot(lower, "Lower", color = chart.fg_color, style = plot.style_linebr)
plotcandle(open, high, low, close, title='Momentum Candles', color = color_t, wickcolor=color_t, bordercolor = color_t)
if barstate.islast
label.delete(label.new(bar_index, close, market_state, color = color(na), textcolor = color_t, style = label.style_label_left, size = size.large)[1])
2025-08-02
213
글번호 192937
지표