답변완료
파라볼릭 박스
아래 차트의 선만 있을 때는 박스 오류가 안보이는데, (근본적인 한계인지?)윗 차트의 박스를 주가 상하단에 맞춰 왼쪽으로 옮기니, 상하가 일치하지 않습니다.선물 400틱 차트입니다. 검토 부탁드립니다.Input : af(0.02), maxAF(0.2);var : T(0),TL(0),B(0),S(0),tx(0),txx(0),HH(0),HD(0),HT(0),LL(0),LD(0),LT(0),box(0);var : B1(0),B2(0),S1(0),S2(0),H1(0),H2(0),L1(0),L2(0);var : tx1(0),tx2(0),tx3(0),tx4(0),tx5(0),tx6(0);var1 = CSar(af,maxAF);plot1(var1, "CSAR",IFF(c>var1,Red,Green)); if CrossUp(C,var1) Then{ B = var1; T = 1; B1 = B[1]; B2 = B1[1]; HD = sDate; HT = sTime; HH = H; H1 = HH[1]; H2 = H1[1]; if LL > 0 Then box = Box_New(LD,LT,LL,HD,HT,HH); if abs(S-LL) < 1.25 Then Text_Delete(tx); tx = Text_New(sDate,sTime,HH,NumToStr(abs(HH-B),2)); Text_SetColor(tx,Red); Text_SetSize(tx,22); Text_SetStyle(tx,1,1); Text_SetBold(tx,1); Condition1 = False;}if CrossDown(C,var1) Then{ S = var1; T = -1; S1 = S[1]; S2 = S1[1]; LD = sDate; LT = sTime; LL = L; L1 = LL[1]; L2 = L1[1]; if HH > 0 Then box = Box_New(HD,HT,HH,LD,LT,LL); if abs(B-HH) < 1.25 Then Text_Delete(tx); tx = Text_New(sDate,sTime,LL,NumToStr(abs(LL-S),2)); Text_SetColor(tx,Blue); Text_SetSize(tx,22); Text_SetStyle(tx,1,0); Text_SetBold(tx,1); Condition1 = False; }Else{ if T == 1 Then { if H >= HH Then { HD = sDate; HT = sTime; HH = H; } Text_SetString(tx,NumToStr(abs(HH-B),2)); Text_SetLocation(tx,sDate,sTime,HH); Box_SetEnd(box,HD,HT,HH); if HH < LL+1.5 Then { Box_SetColor(box,Magenta); Box_SetFill(box,true,60); } Else if HH >= LL+1.5 and HH < LL+3.5 Then { Box_SetColor(box,Gray); Box_SetFill(box,true,60); } Else { Box_SetColor(box,Orange); Box_SetFill(box,true,40); } if abs(HH-LL) >= 2 Then { if Condition1 == False Then { Condition1 = true; tx1 = Text_New(HD,HT,HH+abs(HH-LL)*0.618,"●"); tx2 = Text_New(HD,HT,HH+abs(HH-LL)*1.000,"●"); tx3 = Text_New(HD,HT,HH+abs(HH-LL)*1.618,"●"); Text_SetStyle(tx1,2,2); Text_SetStyle(tx2,2,2); Text_SetStyle(tx3,2,2); Text_SetColor(tx1,Red); Text_SetColor(tx2,Blue); Text_SetColor(tx3,Red); tx4 = Text_New(HD,HT,LL-abs(HH-LL)*0.618,"●"); tx5 = Text_New(HD,HT,LL-abs(HH-LL)*1.000,"●"); tx6 = Text_New(HD,HT,LL-abs(HH-LL)*1.618,"●"); Text_SetStyle(tx4,2,2); Text_SetStyle(tx5,2,2); Text_SetStyle(tx6,2,2); Text_SetColor(tx4,Red); Text_SetColor(tx5,Blue); Text_SetColor(tx6,Red); } Else { Text_SetLocation(tx1,HD,HT,HH+abs(HH-LL)*0.618); Text_SetLocation(tx2,HD,HT,HH+abs(HH-LL)*1.000); Text_SetLocation(tx3,HD,HT,HH+abs(HH-LL)*1.618); Text_SetLocation(tx4,HD,HT,LL-abs(HH-LL)*0.618); Text_SetLocation(tx5,HD,HT,LL-abs(HH-LL)*1.000); Text_SetLocation(tx6,HD,HT,LL-abs(HH-LL)*1.618); } } } if T == -1 Then { if L <= LL Then { LD = sDate; LT = sTime; LL = L; } Text_SetString(tx,NumToStr(abs(LL-S),2)); Text_SetLocation(tx,sDate,sTime,LL); Box_SetEnd(box,LD,LT,LL); if LL > HH-1.5 Then { Box_SetColor(box,Lime); Box_SetFill(box,true,80); } Else if LL <= HH-1.5 and LL > HH-3.5 Then { Box_SetColor(box,Cyan); Box_SetFill(box,true,70); } Else { Box_SetColor(box,Cyan); Box_SetFill(box,true,50); } if abs(HH-LL) >= 2 Then { if Condition1 == False Then { Condition1 = true; tx1 = Text_New(LD,LT,HH+abs(HH-LL)*0.618,"●"); tx2 = Text_New(LD,LT,HH+abs(HH-LL)*1.000,"●"); tx3 = Text_New(LD,LT,HH+abs(HH-LL)*1.618,"●"); Text_SetStyle(tx1,2,2); Text_SetStyle(tx2,2,2); Text_SetStyle(tx3,2,2); Text_SetColor(tx1,Red); Text_SetColor(tx2,Blue); Text_SetColor(tx3,Red); tx4 = Text_New(LD,LT,LL-abs(HH-LL)*0.618,"●"); tx5 = Text_New(LD,LT,LL-abs(HH-LL)*1.000,"●"); tx6 = Text_New(LD,LT,LL-abs(HH-LL)*1.618,"●"); Text_SetStyle(tx4,2,2); Text_SetStyle(tx5,2,2); Text_SetStyle(tx6,2,2); Text_SetColor(tx4,Red); Text_SetColor(tx5,Blue); Text_SetColor(tx6,Red); } Else { Text_SetLocation(tx1,LD,LT,HH+abs(HH-LL)*0.618); Text_SetLocation(tx2,LD,LT,HH+abs(HH-LL)*1.000); Text_SetLocation(tx3,LD,LT,HH+abs(HH-LL)*1.618); Text_SetLocation(tx4,LD,LT,LL-abs(HH-LL)*0.618); Text_SetLocation(tx5,LD,LT,LL-abs(HH-LL)*1.000); Text_SetLocation(tx6,LD,LT,LL-abs(HH-LL)*1.618); } } }}
2026-01-15
183
글번호 229818
지표
답변완료
시스템매매로 변환부탁드립니다...
아래 수식은 예스 지표수식입니다...청색라인에서 매수 하는 시스템 매매로 변환 부탁드립니다..input : ATRperiod(14);input : BBperiod(20);input : BBdeviation(1.5);input : UseATRfilter(true);input : showsignals(true);var : BBupper(0),BBlower(0),alpha(0),atrValue(0);var : FollowLine(Nan),BBSignal(0),iTrend(0);BBUpper = ma(close, BBperiod) + std(close, BBperiod) * BBdeviation;BBLower = ma(close, BBperiod) - std(close, BBperiod) * BBdeviation;alpha = 1 / ATRperiod ;atrValue = IFf(IsNan(atrValue[1]) == true, ma(TrueRange,ATRperiod) , alpha * TrueRange + (1 - alpha) * IFf(isnan(atrValue[1])==true,0,atrValue[1]));if (close > BBUpper) Then BBSignal = 1;else if (close < BBLower) Then BBSignal = -1;if (BBSignal == 1) Then{ if (UseATRfilter) Then { FollowLine = low - atrValue; } else { FollowLine = low; } if (FollowLine < iff(IsNan(FollowLine[1])==true,0,FollowLine[1])) Then { FollowLine = iff(IsNan(FollowLine[1])==true,0,FollowLine[1]); }}if (BBSignal == -1) Then{ if (UseATRfilter) Then { FollowLine = high + atrValue; } else { FollowLine = high; } if (FollowLine > iff(IsNan(FollowLine[1])==true,0,FollowLine[1])) Then { FollowLine = iff(IsNan(FollowLine[1])==true,0,FollowLine[1]); }}if iff(IsNan(FollowLine)==true,0,FollowLine) > iff(IsNan(FollowLine[1])==true,0,FollowLine[1]) Then iTrend = 1;else if iff(IsNan(FollowLine)==true,0,FollowLine) < iff(IsNan(FollowLine[1])==true,0,FollowLine[1]) Then iTrend = -1;var : lineColor(0),B(0),S(0),tx(0);lineColor = iff(iTrend > 0 , Gold , Blue);b = iff(iTrend[1]==-1 and iTrend==1 , 1 , 0);s = iff(iTrend[1]==1 and iTrend==-1 , 1 , 0);plot1(FollowLine, "Follow Line", lineColor);if B == 1 and showsignals Then{ tx = text_new(sDate,stime,L,"▲"); Text_SetColor(tx,ReD); Text_SetStyle(tx,2,0);}if S == 1 and showsignals Then{ tx = text_new(sDate,stime,H,"▼"); Text_SetColor(tx,WhitE); Text_SetStyle(tx,2,1);}
2026-01-14
128
글번호 229814
시스템
답변완료
조건검색 문의
//@version=5indicator("RSI Shift Zone - Lower Breakout Only", overlay = true, max_labels_count = 500)// --------------------------------------------------------------------------------------------------------------------// [Inputs]rsi_len = input.int(14, "RSI length")upper_level = input.int(70, "Upper RSI Level", minval = 50)lower_level = input.int(30, "Lower RSI Level", maxval = 50)min_channel_len = input.int(15, "Minimal bars length of the channel")rsi_filter_val = input.int(40, "Min RSI for Signal")upper_line_width = input.int(2, "Upper Line Width")lower_line_width = input.int(3, "Lower Line Width")center_line_width = input.int(2, "Center Line Width")upper_col = input.color(color.new(#21c997, 50), "Upper Color")lower_col = input.color(color.new(#cc24e2, 50), "Lower Color")lower_line_col = input.color(#FF5252, "Lower Line Signal Color")// --------------------------------------------------------------------------------------------------------------------// [Calculations]var int start = navar bool trigger = falsevar float upper = na var float lower = navar color channel_color = color(na)var bool is_upper_zone = false rsi = ta.rsi(close, rsi_len)channel_upper = ta.crossover(rsi, upper_level) and not trigger channel_lower = ta.crossunder(rsi, lower_level) and not trigger rsi_color = color.from_gradient(rsi, lower_level, upper_level, lower_col, upper_col)if channel_upper start := bar_index trigger := true upper := high lower := low channel_color := rsi_color is_upper_zone := true if channel_lower start := bar_index trigger := true upper := high lower := low channel_color := rsi_color is_upper_zone := false if bar_index - start >= min_channel_len trigger := falsetrigger_change = (channel_upper != channel_upper[1]) or (channel_lower != channel_lower[1])active_upper_line = trigger_change ? na : upperactive_lower_line = trigger_change ? na : lowermiddle_line = trigger_change ? na : math.avg(upper, lower)// --------------------------------------------------------------------------------------------------------------------// [Signal Logic]// Only signals when price crosses Lower Line formed by Upper RSI levellow_breakout = ta.crossover(close, active_lower_line) and is_upper_zone and rsi > rsi_filter_val// --------------------------------------------------------------------------------------------------------------------// [Plotting]plot(active_upper_line, "Upper Line", color = channel_color, style = plot.style_linebr, linewidth = upper_line_width)plot(active_lower_line, "Lower Line", color = channel_color, style = plot.style_linebr, linewidth = lower_line_width)p1 = plot(active_upper_line, display = display.none)p2 = plot(active_lower_line, display = display.none)fill(p1, p2, color.new(channel_color, 90))plot(middle_line, "Center Line", color = color.gray, style = plot.style_linebr, linewidth = center_line_width)plotshape(low_breakout, title="Lower Breakout", style=shape.triangleup, location=location.belowbar, color=lower_line_col, size=size.small, text="LOW")// --------------------------------------------------------------------------------------------------------------------// [Alerts]alertcondition(low_breakout, title="Lower Breakout Alert", message="Price crossed Lower Shift Zone")일봉상 위 신호가 나온 종목을 검출 할 수 있도록 해주시면 감사 드리겠습니다 (__)
2026-01-14
150
글번호 229811
검색