커뮤니티

예스랭귀지 Q&A

글쓰기
답변완료

종목 검색 부탁드립니다.

srcF = CLOSE; srcS = CLOSE; VWmaF = SUM(srcF * VOLUME, lenF) / SUM(VOLUME, lenF); VWmaS = SUM(srcS * VOLUME, lenS) / SUM(VOLUME, lenS); AvgF = MA(srcF, lenF); AvgS = MA(srcS, lenS); VPC = VWmaS - AvgS; VPR = IF(AvgF != 0, VWmaF / AvgF, 0); VM = IF(MA(VOLUME, lenS) != 0, MA(VOLUME, lenF) / MA(VOLUME, lenS), 0); VPCI = VPC * VPR * VM; lenV = IF(VPC < 0, CEIL(ABS(VPCI - 3)), IF(VPC >= 0, CEIL(VPCI + 3), 1)); VPCc = IF(VPC > -1 AND VPC < 0, -1, IF(VPC < 1 AND VPC >= 0, 1, VPC)); PriceV = IF(lenV != 0, (LOW * (1 / VPCc) * (1 / VPR)) / lenV / 100, 0); DeV = mult * VPCI * VM; AVSL = MA(LOW - PriceV + DeV, lenS); AVSL 지표조건 lenF 12 lenS 26 lenT 9 mult 1 offset 1 위 LINE을 지수이평 5일선이 돌파 하는 검색식 부탁드립니다
프로필 이미지
골든도라도
2025-07-31
164
글번호 192890
종목검색
답변완료

문의

하루 2번 거래하는 수식입니다. 두번째 b2 진입에 필터를 두고 싶습니다. 필터 내용입니다. 1) b1 진입이 SetStopInactivity로 청산되면 b2 진입에 필터가 작동됩니다. 2) b2 진입은 ( c<dayopen-2.5 and b2 진입조건) 이 경우에만 허용됩니다. 항상 고맙습니다. *************************************************************************************** input : b1(116); input : b1ls(1.5),b1tr(2.7),mi1(0.5),bg1(150); input : b2(122); input : b2ls(2),b2tr(3.6),mi2(0),bg2(0); var : T1(0),entry(0),LL(0),EH(0); if Bdate != Bdate[1] Then T1 = TotalTrades; if MarketPosition == 0 Then entry = TotalTrades-T1; Else entry = (TotalTrades-T1)+1; if MarketPosition == 0 and entry == 0 and C >= daylow+PriceScale*B1 Then buy("b1"); if TotalTrades > TotalTrades[1] Then LL = L; if L < LL Then LL = L; if MarketPosition == 0 and entry == 1 and C >= LL+PriceScale*B2 and C[1] < LL+PriceScale*B2 Then buy("b2"); if MarketPosition== 1 Then { if IsEntryName("b1") == true Then { SetStopLoss(b1ls,PointStop); SetStopTrailing(b1tr,0,PointStop,1); SetStopInactivity(mi1,bg1,PointStop); } Else if IsEntryName("b2") == true Then { SetStopLoss(b2ls,PointStop); SetStopTrailing(b2tr,0,PointStop,1); SetStopInactivity(mi2,bg2,PointStop); } Else { SetStopLoss(0); SetStopTrailing(0,0); SetStopInactivity(0,0); } }
프로필 이미지
목마와숙녀
2025-07-31
138
글번호 192889
시스템
답변완료

질문 부탁드립니다

지난 답변 관련 재문의 드리고 싶은데요 최초 만족시에만 저장하는 경우에 1. x,y 에 큰 값을 주거나 (if var==0 and 없이) 2. if var1==0 and 을 하거나 둘 다 같은 의미로써 둘중 하나로 하면 된다는 거죠?? 즉 아래 두 식은 같은 의미 if aa[y] >= aa[x] *2 then { var1= aa[y]; y=4+(x*5) + 1; x=6; } if var1 ==0 and aa[y] >= aa[x] *2 then { var1= aa[y]; } 아래는 수식입니다 감사합니다 var : x(0) , y(0); var1=0; for x = 0 to 5 { for y= 0 to 4+(x*5) { if var1 ==0 and aa[y] >= aa[x] *2 then { var1= aa[y]; } } }
프로필 이미지
yamu
2025-07-31
157
글번호 192888
지표
답변완료

종목검색 부탁드립니다.

안녕하세요? 다음의 수식의 종목검색식 부탁드립니다. 감사합니다. max( avg(C,5), avg(C,20), avg(C,60)) < min( avg(C,5), avg(C,20), avg(C,60)) * (1+5/100) && C > highest(H(1),5) && C(1) <= highest(H(2),5) and CrossUp(h,BBandsUp(20,2))
프로필 이미지
오말리
2025-07-31
167
글번호 192887
종목검색
답변완료

수식 수정을 부탁드립니다

UT Bot + LinReg Candles 지표를 시스템용으로 작성한 것인데 67줄에 에러 메세지가 뜹니다 한번 살펴 봐 주시면 감사하겠습니다. 늘 친절히 답해 주셔서 너무나 감사드립니다. 늘 건강하세요. // === 입력 변수 선언 === Input: a_buy(2.0), // 매수 민감도 (ATR 배수) c_buy(1), // 매수 ATR 기간 signal_length(7), // 신호 평활화 (이 수식에서는 사용되지 않음) sma_signal(true), // 단순이동평균 사용 여부 (이 수식에서는 사용되지 않음) lin_reg(true), // 선형회귀 사용 여부 (이 수식에서는 사용되지 않음) linreg_length(11); // 선형회귀 길이 (이 수식에서는 사용되지 않음) // === 변수 선언 === Vars: src_buy(0), atr_buy(0), nLoss_buy(0), trail_buy(0), // 이 변수는 YesLanguage에서 자동으로 이전 바 값을 기억해요! ema_buy(0), above_buy(false), buy_signal_raw(false), buy_signal(false); // === UT Bot 매수 계산 === src_buy = C; // 종가 사용 atr_buy = ATR(c_buy); // ATR 계산 nLoss_buy = a_buy * atr_buy; // 손실 기준값 // 트레일링 스톱 계산 (매수용) // IsNaN(trail_buy[1])은 첫 번째 바에서 true가 돼요. if IsNaN(trail_buy[1]) then // 첫 번째 봉에서는 trail_buy를 초기화해요. { trail_buy = src_buy - nLoss_buy; } else // 두 번째 봉부터는 이전 봉의 trail_buy 값(trail_buy[1])을 사용해서 계산해요. { if src_buy > trail_buy[1] and src_buy[1] > trail_buy[1] then { trail_buy = IFF(trail_buy[1] > src_buy - nLoss_buy, trail_buy[1], src_buy - nLoss_buy); } else if src_buy < trail_buy[1] and src_buy[1] < trail_buy[1] then { trail_buy = IFF(trail_buy[1] < src_buy + nLoss_buy, trail_buy[1], src_buy + nLoss_buy); } else // 그 외의 경우 (방향 전환 시) { trail_buy = IFF(src_buy > trail_buy[1], src_buy - nLoss_buy, src_buy + nLoss_buy); } } // EMA(src_buy, 1)은 종가(C)와 같으므로 C로 간단히 표시해요. ema_buy = C; above_buy = CrossUp(ema_buy, trail_buy); // 종가가 트레일링 스톱을 상향 돌파했는지 확인 // 원시 매수 신호: 종가가 trail_buy 위에 있고, 상향 돌파 조건이 만족할 때 buy_signal_raw = (src_buy > trail_buy) AND above_buy; buy_signal = buy_signal_raw; // 확정 매수 신호 // === 조건검색 및 시스템 매매 로직 === // 매수 신호가 발생하면 매수 진입! If buy_signal == TRUE Then { Buy("UTBot_Buy"); // 진입 전략 이름을 "UTBot_Buy"로 지정 } // 매도 조건 (매수 신호가 더 이상 유효하지 않을 때 청산) // 가장 기본적이고 오류가 적은 형태로 ExitLong을 사용합니다. If buy_signal == FALSE Then { ExitLong; // 현재 열린 모든 Long 포지션을 청산합니다. }
프로필 이미지
장보고153
2025-07-31
165
글번호 192882
시스템
답변완료

지표 수식 부탁드립니다

다음 TradingView 수식을 그림1과 같이 단순하게 녹색, 적색 삼각형만 표시하게끔 변환 부탁드려요. 모든 label과 수평선은 불필요합니다. 아래쪽에 GEMINI에 부탁해서 간략 버전도 있씁니다. 간략버전을 변환해 주십시오. 미리 감사드립니다. //@version=6 indicator("Choch Pattern Levels [BigBeluga]", overlay = true, max_lines_count = 500, max_bars_back = 5000, calc_bars_count = 5000) // INPUTS ――――――――――――――――――――{ len = input.int(10, "Length") amount = input.int(10, "Amount of Patterns") show_delta = input.bool(true, "Show Delta Volume", inline = "Delta") sizeDelta = input.string("normal", "", ["tiny", "small", "normal", "large", "huge"], inline = "Delta") col_plus = input.color(color.red, "ChoCh Up") col_minus = input.color(color.lime, "ChoCh Dn") var ph = float(na) var pl = float(na) var pl_index = int(na) var ph_index = int(na) var trend = false type zone line level label label1 label label2 label label3 label label4 polyline poly label label5 var ms_levels = array.new<zone>() // } // CALCULATIONS――――――――――{ pivotH = ta.pivothigh(len, len) pivotL = ta.pivotlow(len, len) if not na(pivotH) ph_index := bar_index[len] ph := pivotH if not na(pivotL) pl_index := bar_index[len] pl := pivotL if ta.crossover(high, ph) and not trend check = false l = low lbl1 = label(na) lbl2 = label(na) lbl3 = label(na) lbl4 = label(na) lbl5 = label(na) lne = line(na) cp = array.new<chart.point>() c_p1 = chart.point.from_index(ph_index, ph) c_p2 = chart.point.from_index(bar_index, high) cp.push(c_p1) cp.push(c_p2) lbl1 := label.new(c_p1, "", style = label.style_circle, color = color.new(col_plus, 30)) lbl2 := label.new(c_p2, "", style = label.style_circle, color = color.new(col_plus, 30)) delta = 0. for i = 0 to bar_index-ph_index l := math.min(l, low[i]) delta += close[i] > open[i] ? volume[i] : -volume[i] for i = 0 to bar_index-ph_index lo = low[i] if lo == l and not check check := true cp.push(chart.point.from_index(bar_index-i, l)) lbl3 := label.new(bar_index-i, l, "", style = label.style_circle, color = color.new(col_plus, 30)) lne := line.new(bar_index-i, l, bar_index, l, color = col_plus) lbl4 := label.new(bar_index, l, "&#9711;", style = label.style_label_center, color = color.new(col_plus, 100), textcolor = col_plus) if show_delta lbl5 := label.new(int(math.avg(bar_index,ph_index)), math.avg(lo, high)+(high-lo)*0.1, (delta > 0 ? "+" : "") + str.tostring(delta, format.volume), style = label.style_label_center, color = color.new(col_plus, 100), textcolor = delta > 0 ? col_plus : col_minus, tooltip = "Delta Volume") poly = polyline.new(cp, closed = true, fill_color = color.new(col_plus, 85), line_color = col_plus, line_width = 1) z = zone.new(lne, lbl1, lbl2, lbl3, lbl4, poly, lbl5) ms_levels.push(z) trend := true if ta.crossunder(low, pl) and trend check = false h = high lbl1 = label(na) lbl2 = label(na) lbl3 = label(na) lbl4 = label(na) lbl5 = label(na) lne = line(na) cp = array.new<chart.point>() c_p1 = chart.point.from_index(pl_index, pl) c_p2 = chart.point.from_index(bar_index, low) cp.push(c_p1) cp.push(c_p2) lbl1 := label.new(c_p1, "", style = label.style_circle, color = color.new(col_minus, 30)) lbl2 := label.new(c_p2, "", style = label.style_circle, color = color.new(col_minus, 30)) delta = 0. for i = 0 to bar_index-pl_index h := math.max(h, high[i]) delta += close[i] > open[i] ? volume[i] : -volume[i] for i = 0 to bar_index-pl_index hi = high[i] if hi == h and not check check := true cp.push(chart.point.from_index(bar_index-i, h)) lbl3 := label.new(bar_index-i, h, "", style = label.style_circle, color = color.new(col_minus, 30)) lne := line.new(bar_index-i, h, bar_index, h, color = col_minus) lbl4 := label.new(bar_index, h, "&#9711;", style = label.style_label_center, color = color.new(col_minus, 100), textcolor = col_minus) if show_delta lbl5 := label.new(bar_index - i, math.avg(hi, low)-(hi-low)*0.2, (delta > 0 ? "+" : "") + str.tostring(delta, format.volume), style = label.style_label_center, color = color.new(col_minus, 100), textcolor = delta > 0 ? col_plus : col_minus) poly = polyline.new(cp, closed = true, fill_color = color.new(col_minus, 80), line_color = col_minus, line_width = 1) z = zone.new(lne, lbl1, lbl2, lbl3, lbl4, poly, lbl5) ms_levels.push(z) trend := false body_h = close > open ? close : open body_l = close < open ? close : open for z in ms_levels z.level.set_x2(bar_index+5) z.label4.set_x(bar_index+5) z.level.set_width(3) z.label1.set_size(size.tiny) z.label2.set_size(size.tiny) z.label3.set_size(size.tiny) z.label4.set_size(size.large) z.label5.set_size(size.small) if body_h > z.level.get_y1() and body_l < z.level.get_y1() or body_h[1] > z.level.get_y1() and body_l[1] < z.level.get_y1() z.level.delete() z.label1.delete() z.label2.delete() z.label3.delete() z.label4.delete() z.label5.delete() z.poly.delete() ms_levels.remove(ms_levels.indexof(z)) if ms_levels.size() > amount z = ms_levels.shift() z.level.delete() z.label1.delete() z.label2.delete() z.label3.delete() z.label4.delete() z.label5.delete() z.poly.delete() // } //================================================================== // GEMINI에 부탁해서 간략화한 것입니다. //================================================================== //@version=6 indicator("Choch Pattern Levels[GEMINI]", overlay = true, max_lines_count = 500, max_bars_back = 5000, calc_bars_count = 5000) // INPUTS ――――――――――――――――――――{ len = input.int(10, "Length") amount = input.int(10, "Amount of Patterns") col_plus = input.color(color.red, "ChoCh Up") col_minus = input.color(color.lime, "ChoCh Dn") var ph = float(na) var pl = float(na) var pl_index = int(na) var ph_index = int(na) var trend = false // zone 타입에 삼각형의 기준선 정보 추가 type zone polyline poly float level_y int level_bar_index var ms_levels = array.new<zone>() // } // CALCULATIONS――――――――――{ pivotH = ta.pivothigh(len, len) pivotL = ta.pivotlow(len, len) if not na(pivotH) ph_index := bar_index[len] ph := pivotH if not na(pivotL) pl_index := bar_index[len] pl := pivotL if ta.crossover(high, ph) and not trend check = false l = low cp = array.new<chart.point>() c_p1 = chart.point.from_index(ph_index, ph) c_p2 = chart.point.from_index(bar_index, high) cp.push(c_p1) cp.push(c_p2) for i = 0 to bar_index-ph_index l := math.min(l, low[i]) var found_l_index = int(na) for i = 0 to bar_index-ph_index lo = low[i] if lo == l and not check check := true cp.push(chart.point.from_index(bar_index-i, l)) found_l_index := bar_index - i poly = polyline.new(cp, closed = true, fill_color = color.new(col_plus, 85), line_color = col_plus, line_width = 1) z = zone.new(poly, l, found_l_index) ms_levels.push(z) trend := true // 'amount' 제한 로직 if ms_levels.size() > amount removed_z = ms_levels.shift() removed_z.poly.delete() if ta.crossunder(low, pl) and trend check = false h = high cp = array.new<chart.point>() c_p1 = chart.point.from_index(pl_index, pl) c_p2 = chart.point.from_index(bar_index, low) cp.push(c_p1) cp.push(c_p2) for i = 0 to bar_index-pl_index h := math.max(h, high[i]) var found_h_index = int(na) for i = 0 to bar_index-pl_index hi = high[i] if hi == h and not check check := true cp.push(chart.point.from_index(bar_index-i, h)) found_h_index := bar_index - i poly = polyline.new(cp, closed = true, fill_color = color.new(col_minus, 80), line_color = col_minus, line_width = 1) z = zone.new(poly, h, found_h_index) ms_levels.push(z) trend := false // 'amount' 제한 로직 if ms_levels.size() > amount removed_z = ms_levels.shift() removed_z.poly.delete() // --- 캔들 교차 시 오래된 삼각형을 삭제하는 로직 --- body_h = close > open ? close : open body_l = close < open ? close : open // **수정된 부분: 배열이 비어있지 않은지 먼저 확인** if ms_levels.size() > 0 for i = ms_levels.size() - 1 to 0 z = ms_levels.get(i) // level_y 또는 level_bar_index가 na 값이 아닌지 확인 (안전 장치) if not na(z.level_y) and not na(z.level_bar_index) if bar_index > z.level_bar_index and ( (body_h > z.level_y and body_l < z.level_y) or (body_h[1] > z.level_y and body_l[1] < z.level_y) ) z.poly.delete() ms_levels.remove(i)
프로필 이미지
고도산
2025-07-31
235
글번호 192881
지표
답변완료

수식 변환 부탁드립니다

다음수식 예스트레이더로 변환 부탁드립니다. A = Sum(V); A1 = ValueWhen(1,date(1)!= date, A(1)); B = A-A1; B1 = ValueWhen(1,date(1)!= date, B(1)); CrossUp(B, B1)
프로필 이미지
파크에버뉴
2025-07-30
133
글번호 192880
사용자 함수
답변완료

신호변환 부탁 드려요^^

키움에서 쓰던거라 지표는 다만들었는데...답답한게 많네요. 도움 주시면 감사하겠습니다. 1. 후팬볼밴(파랑) Bu = BBandsUp(20,2); Crossup(C, Bu(25)) 2. 후팬볼밴5(핑크) Bu = BBandsUp(20,2); Crossup(C, Bu(25)) && C>C(1) * 1.05 3. 저점W패턴(녹색) M = ma(C, 20); T = LRL(20) + LRS(20); T저점 = T>T(1) && T(1)<T(2); shift(T저점, -1)
프로필 이미지
제너리
2025-07-30
174
글번호 192878
강조
답변완료

질문 부탁드립니다

그럼 만약에 최초 조건 만족시가 아니라 조건 만족 할때마다 var1에 새로운 값이 들어가게 될때는 if var1 ==0 and 가 들어가야 하나요? 아니면 그냥 if aa[y] >= aa[x] *2 then 이라고 해도 되나요? 코드 진행 순서가 궁금한데요 for문을 반복 수행할때마다 다시 코드 시작점 (var1=0; 부터)으로 돌아가서 반복을 하는게 아니라 for 시작점 (for x = 0 to 5 )에서 다시 시작하는게 맞지 않나요?? 감사합니다 var : x(0) , y(0); var1=0; for x = 0 to 5 { for y= 0 to 4+(x*5) { if var1 ==0 and aa[y] >= aa[x] *2 then { var1= aa[y]; } } }
프로필 이미지
yamu
2025-07-30
149
글번호 192875
지표
답변완료

검색식 부탁드립니다~

수고 많으십니다. 아래 조건을 만족할 때 검색식 부탁드립니다. < 조건1 > crossup(c,((predayhigh()+ predaylow()+predayclose())/3) +(predayhigh()-predaylow())) < 조건 2 > s=sum(1); valuewhen(1,624-s==20,(종가+시가)/2); ** 3분봉 상, 검색 조건 ** 조건1이 2번 이상 발생 되고 난 후 조건2를 깨고 내려갔다가 다시 돌파 할 때 or 깨지 않고 조건2를 지지할 때 (당일 or 며칠 후)
프로필 이미지
kimsing
2025-07-30
161
글번호 192868
종목검색