커뮤니티

예스랭귀지 Q&A

글쓰기
답변완료

틱봉에서 ADX, DM DP계산하기

더운데 수고 많으시죠! 아래 3개의 지표를 각각 틱 차트에서 DATA2를 사용하지 않고, 5분BOX를 기준으로 계산해서 사용해보고자 합니다. var1 = ADX(11); var2 = DiPlus(11); var3 = DiMinus(11); 감사합니다!
프로필 이미지
짱짱해야지
2025-08-04
174
글번호 192966
지표
답변완료

변환 부탁드립니다.

트레이딩 뷰 지표입니다. 변환 부탁 드립니다. //@version=6 indicator("Zone Shift [ChartPrime]", max_lines_count = 500, overlay = true, max_labels_count = 500) // --------------------------------------------------------------------------------------------------------------------} // ?? ???????? ???????????? // --------------------------------------------------------------------------------------------------------------------{ int length = input.int(100, "Length 60-200", minval = 60, maxval = 200) color upColor = input.color(color.lime, "", inline = "colors") color dnColor = input.color(color.blue, "", inline = "colors") // --------------------------------------------------------------------------------------------------------------------} // ?? ?????????????????? ???????????????????????? // --------------------------------------------------------------------------------------------------------------------{ var trend = false var trendStart = float(na) var lastRetest = bar_index float ema = ta.ema(close, length) float hma = ta.hma(close, length-40) float dist = ta.sma(high-low, 200) float mid = math.avg(ema, hma) float top = mid + dist float bot = mid - dist if barstate.isconfirmed if low > top and low[1] < top[1] and not trend trend := true trendStart := low if high < bot and high[1] > bot[1] and trend trend := false trendStart := high trend_col = trend ? upColor : dnColor // Retest TrendStart Level if barstate.isconfirmed if (close > trendStart and close[1] < trendStart[1] or low > trendStart and low[1] < trendStart[1] ) and trend and bar_index - lastRetest > 5 lastRetest := bar_index label.new(bar_index, low, "?", color = color.new(color.black, 100), style = label.style_label_up, textcolor = trend_col) if (close[1] > trendStart and close < trendStart[1] or high[1] > trendStart and high < trendStart[1]) and not trend and bar_index - lastRetest > 5 lastRetest := bar_index label.new(bar_index, high, "?", color = color.new(color.black, 100), style = label.style_label_down, textcolor = trend_col) // --------------------------------------------------------------------------------------------------------------------} // ?? ?????????????????????????? // --------------------------------------------------------------------------------------------------------------------{ plot(mid, "Middle", color = bar_index % 2 == 0 ? chart.fg_color : na) plot(top, "Top", color = chart.fg_color ) plot(bot, "Bottom", color = chart.fg_color ) barcolor(trend_col) plotcandle(open, high, low, close, title='CandleColor', color = trend_col, wickcolor=trend_col, bordercolor = trend_col, force_overlay = true) plot(trendStart != trendStart[1] ? na : trendStart, "Trend Initiation Level", style = plot.style_linebr, color = bar_index % 2 == 0 ? chart.fg_color : na) // --------------------------------------------------------------------------------------------------------------------}
프로필 이미지
다올
2025-08-04
204
글번호 192965
지표
답변완료

화살표 표시가 되지 않습니다.

안녕하세요 Q&A 92545 글의 답글을 보고 아래와 같이 코드를 작성하였습니다. input : short(10),long(100); var : macdv(0),tx(0); macdv = macd(short,long); Plot1(macdv); PlotBaseLine1(0); if CrossUp(macdv,0) Then { tx = Text_New(sDate,sTime,macdv,"▲"); Text_SetColor(tx,Red); Text_SetSize(tx,20); } 새로운 지표로 만들어서 지표 적용하기를 하면 첨부의 그림과 같이 신호선은 생성이 됩니다만 신호 발생지점에서 ▲ 는 생성되지 않고 있습니다. 왜 그런지 이유를 알 수 있을까요? 답변에 미리 감사드립니다.
프로필 이미지
심플리3
2025-08-04
188
글번호 192964
지표
답변완료

Kalman지표를 변화과정에서 반복인 오류가 발생합니다.

Tradingview에 있는 "Kalman Trend Levels [BigBeluga]"의 수식을 ChatGPT로 변환을 시켰습니다. 기존 코딩은 // This work is licensed under Creative Commons Attribution-NonCommercial-ShareAlike 4.0 International // https://creativecommons.org/licenses/by-nc-sa/4.0/ // &#169; BigBeluga //@version=5 indicator("Kalman Trend Levels [BigBeluga]", overlay = true, max_labels_count = 500, max_boxes_count = 500) // INPUTS ――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――{ int short_len = input.int(50) int long_len = input.int(150) bool retest_sig = input.bool(false, "Retest Signals") bool candle_color = input.bool(true, "Candle Color") color upper_col = input.color(#13bd6e, "up", inline = "colors") color lower_col = input.color(#af0d4b, "dn", inline = "colors") // } // CALCULATIONS――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――{ float atr = ta.atr(200) *0.5 var lower_box = box(na) var upper_box = box(na) // Kalman filter function kalman_filter(src, length, R = 0.01, Q = 0.1) => // Initialize variables var float estimate = na var float error_est = 1.0 var float error_meas = R * (length) var float kalman_gain = 0.0 var float prediction = na // Initialize the estimate with the first value of the source if na(estimate) estimate := src[1] // Prediction step prediction := estimate kalman_gain := error_est / (error_est + error_meas) estimate := prediction + kalman_gain * (src - prediction) error_est := (1 - kalman_gain) * error_est + Q / (length) // Adjust process noise based on length estimate float short_kalman = kalman_filter(close, short_len) float long_kalman = kalman_filter(close, long_len) bool trend_up = short_kalman > long_kalman color trend_col = trend_up ? upper_col : lower_col color trend_col1 = short_kalman > short_kalman[2] ? upper_col : lower_col color candle_col = candle_color ? (trend_up and short_kalman > short_kalman[2] ? upper_col : not trend_up and short_kalman < short_kalman[2] ? lower_col : color.gray) : na // } // PLOT ――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――{ if trend_up and not trend_up[1] label.new(bar_index, short_kalman, "&#129145;₩n" + str.tostring(math.round(close,1)), color = color(na), textcolor = upper_col, style = label.style_label_up, size = size.normal) lower_box := box.new(bar_index, low+atr, bar_index, low, border_color = na, bgcolor = color.new(upper_col, 60)) if not ta.change(trend_up) lower_box.set_right(bar_index) if trend_up[1] and not trend_up label.new(bar_index, short_kalman, str.tostring(math.round(close,1))+"₩n&#129155;", color = color(na), textcolor = lower_col, style = label.style_label_down, size = size.normal) upper_box := box.new(bar_index, high, bar_index, high-atr, border_color = na, bgcolor = color.new(lower_col, 60)) if not ta.change(trend_up) upper_box.set_right(bar_index) if retest_sig if high < upper_box.get_bottom() and high[1]>= upper_box.get_bottom() //or high < lower_box.get_bottom() and high[1]>= lower_box.get_bottom() label.new(bar_index-1, high[1], "x", color = color(na), textcolor = lower_col, style = label.style_label_down, size = size.normal) if low > lower_box.get_top() and low[1]<= lower_box.get_top() label.new(bar_index-1, low[1], "+", color = color(na), textcolor = upper_col, style = label.style_label_up, size = size.normal) p1 = plot(short_kalman, "Short Kalman", color = trend_col1) p2 = plot(long_kalman, "Long Kalman", linewidth = 2, color = trend_col) fill(p1, p2, short_kalman, long_kalman, na, color.new(trend_col, 80)) plotcandle(open, high, low, close, title='Title', color = candle_col, wickcolor=candle_col, bordercolor = candle_col) // } 이렇게 되어 있습니다. 그리고 변환을 시켰을 때 // 예스트레이더 지표식: Kalman Trend Levels [BigBeluga] 변환본 (YesLanguage) // 차트 편집창용 지표 스크립트입니다. 충분한 주석을 참고하세요. Inputs: ShortLen(50), // 단기 칼만 필터 기간 LongLen(150), // 장기 칼만 필터 기간 RetestSig(False), // 리테스트 시그널 표시 여부 CandleColor(True), // 캔들 컬러링 사용 여부 UpColor(RGB(19,189,110)), // 상승 트렌드 색상 (녹색 계열) DnColor(RGB(175,13,75)); // 하락 트렌드 색상 (빨강 계열) Vars: // 단기 칼만 필터 내부 변수 ShortEst(0), // 단기 추정치 ShortErrEst(1), // 단기 오차 추정치 ShortErrMeas(0), // 단기 측정 오차 ShortKGain(0), // 단기 칼만 이득 PredShort(0), // 단기 예측치 // 장기 칼만 필터 내부 변수 LongEst(0), // 장기 추정치 LongErrEst(1), // 장기 오차 추정치 LongErrMeas(0), // 장기 측정 오차 LongKGain(0), // 장기 칼만 이득 PredLong(0), // 장기 예측치 ATRVal(0), // ATR 값 (200 기간 * 0.5) // 박스 개체 ID 저장용 LowerBoxID(0), UpperBoxID(0), // 트렌드 상태 TrendUp(False), TrendCol(0), TrendCol1(0); // 측정 오차 초기화 (필터 길이에 비례) ShortErrMeas = 0.01 * ShortLen; LongErrMeas = 0.01 * LongLen; // ATR 계산: 200-period ATR의 절반 사용 ATRVal = ATR(200) * 0.5; // 첫 번째 바에서 초기 추정값 세팅 if CurrentBar = 1 then begin ShortEst = C; // 첫 봉의 종가로 초기화 LongEst = C; // 첫 봉의 종가로 초기화 end; // ===== 단기 칼만 필터 계산 ===== PredShort = ShortEst; // 예측 단계 ShortKGain = ShortErrEst / (ShortErrEst + ShortErrMeas); // 칼만 이득 ShortEst = PredShort + ShortKGain * (C - PredShort); // 추정치 보정 ShortErrEst = (1 - ShortKGain) * ShortErrEst + 0.1 / ShortLen; // 오차 추정치 갱신 // ===== 장기 칼만 필터 계산 ===== PredLong = LongEst; LongKGain = LongErrEst / (LongErrEst + LongErrMeas); LongEst = PredLong + LongKGain * (C - PredLong); LongErrEst = (1 - LongKGain) * LongErrEst + 0.1 / LongLen; // ===== 트렌드 판정 ===== TrendUp = ShortEst > LongEst; // 단기 > 장기 → 상승 TrendCol = Iff(TrendUp, UpColor, DnColor); // 트렌드 컬러 TrendCol1 = Iff(ShortEst > ShortEst[2], UpColor, DnColor); // 단기 추정 증감 색상 // ===== 차트 출력 ===== Plot1(ShortEst, "ShortKalman"); // 단기 칼만 필터 값 Plot2(LongEst, "LongKalman"); // 장기 칼만 필터 값 // 캔들 컬러링: PlotPaintBar 함수 사용 if CandleColor then PlotPaintBar( O, H, L, C, Iff(TrendUp and (ShortEst > ShortEst[2]), UpColor, Iff((not TrendUp) and (ShortEst < ShortEst[2]), DnColor, RGB(128,128,128))) // 그 외는 회색 ); // ===== 트렌드 전환 시 화살표 및 박스 표시 ===== // 상승 전환: 상승 화살표 및 하단 박스 if (TrendUp) and (not TrendUp[1]) then begin Text_New( Date, Time, ShortEst, "&#129145; " + NumToStr(C, 1) // 화살표 + 종가(소수점 1자리) ); LowerBoxID = Box_New( Date, Time, L, Date, Time, L + ATRVal ); Box_SetFill(LowerBoxID, UpColor); // 박스 내부 채움 색 Box_SetExtFill(LowerBoxID, True); // 차트 전체 영역으로 확장 end; // 하락 전환: 하락 화살표 및 상단 박스 if (not TrendUp) and (TrendUp[1]) then begin Text_New( Date, Time, ShortEst, NumToStr(C, 1) + " &#129155;" // 종가 + 하락 화살표 ); UpperBoxID = Box_New( Date, Time, H + ATRVal, Date, Time, H ); Box_SetFill(UpperBoxID, DnColor); Box_SetExtFill(UpperBoxID, True); end; // ===== 리테스트 시그널 (옵션) ===== if RetestSig then begin // 상승 박스 상단 돌파 리테스트 표시 if (H < Box_GetEndVal(UpperBoxID)) and (H[1] >= Box_GetEndVal(UpperBoxID)) then Text_New(Date, Time, H, "x"); // 하락 박스 하단 돌파 리테스트 표시 if (L > Box_GetEndVal(LowerBoxID)) and (L[1] <= Box_GetEndVal(LowerBoxID)) then Text_New(Date, Time, L, "+"); end; 몇가지 단순 오류를 고쳤지만, 반복적인 수정을 하니 내용을 편집해서 결론을 내는 것을 확인했습니다. 이런 수정이 가능할까요?
프로필 이미지
jhs0713
2025-08-04
236
글번호 192963
지표
답변완료

시스템 자동매매관련 일반 질문입니다...

에를 들어서 3천만원 기준자산으로 자동매매를 하는데 계좌에 자산은 3천만원 입니다., 제가 매수 증거금을 고려해서 시스템 트레이딩설정에 고정자산을 2900만원으로 설정을해 두었는데, 매수증거금이 부족합니다, 라고 접수오류가 떳는데 궁금해서 문의합니다.. 장내최대가능 현금하고 예수금조회도 해보아도 충분히 금액이 있는데 매수가 안되었습니다...
프로필 이미지
서민순
2025-08-04
158
글번호 192962
시스템
답변완료

검색식 문의

주가등락폭 비율 0봉전 저가고가 폭 대비 0봉전 저가종가 폭의 비율이 0% 이상 50% 이하 검색식 부탁드립니다
프로필 이미지
pmcj
2025-08-04
194
글번호 192961
종목검색
답변완료

검색식 부탁 드립니다

B=BBandsC(Period,D1) 지표조건 Period 20 D1 2 A1= LinearRegressionValue(C,기간1,0); A2= LinearRegressionValue(A1,기간1,0); eq=A1-A2; VL=A1+eq; 지표조건 기간1 50 분봉에서 B 가 VL 아래에 있다 B가 VL 위로 올라온 종목 검색식 부탁드립니다
프로필 이미지
님이랑
2025-08-04
174
글번호 192960
종목검색
답변완료

문의드립니다,

수고가 많으십니다. 1.data2 macd기준선돌파시 data1 매수식 data2 macdrl기준선돌파이후에 data1 rsi bull oscillator 골든시 data1 매수식 data1 macd기준선 데드시 or data2 macd기준선 데드시 data1매도식 감사드립니다.
프로필 이미지
2685up
2025-08-04
135
글번호 192959
시스템
답변완료

종목 검색 부탁드립니다.

emaValue = eavg(C, length); // EMA 계산 correction = C + (C - emaValue); // 보정값 zlma = eavg(correction, length); // ZLMA 계산 VALUEWHEN(1, (CROSSUP(ZLMA,emaValue) or CROSSDOWN(ZLMA,emaValue)),zlma) length는 20 주가가 위 라인 돌파시 종목 검색식 부탁드립니다
프로필 이미지
골든도라도
2025-08-04
184
글번호 192958
종목검색
답변완료

검색식 부탁합니다

검색과 종목검색으로 변환 부탁드립니다. EMA = eavg(C, 5); CORRECTION = C + (C - EMA); ZLMA = eavg(CORRECTION, 5); // ZLMA와 EMA 교차 시점의 ZLMA 값 저장 A = valuewhen(1, crossup(ZLMA, EMA) or crossdown(ZLMA, EMA), ZLMA); // 강세 진입 조건 조건: crossup(L, A) and EMA < ZLMA and C > O;
프로필 이미지
행복만땅
2025-08-04
182
글번호 192957
종목검색