커뮤니티

예스랭귀지 Q&A

글쓰기
답변완료

부탁드립니다

수고하십니다 예스로 부탁드립니다 // INPUTS ――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――{ int length = input.int(100, "Lookback Period") float channel_width = input.float(1.5, "Channel Width", step = 0.1) int channel_len = input(100, "Channel Length") bool mid_disp = input.bool(true, "Mid Line", inline = "s") bool fill_band = input.bool(true, "Fill Band", inline = "s") color col1 = input.color(#21dfac, "", inline = "s1") color col2 = input.color(#df216d, "", inline = "s1") // } // CALCULATIONS――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――{ // Function to compute logarithmic regression f_log_regression(src, length) => float sumX = 0.0 float sumY = 0.0 float sumXSqr = 0.0 float sumXY = 0.0 for i = 0 to length - 1 val = math.log(src[i]) per = i + 1.0 sumX += per sumY += val sumXSqr += per * per sumXY += val * per slope = (length * sumXY - sumX * sumY) / (length * sumXSqr - sumX * sumX) average = sumY / length intercept = average - slope * sumX / length + slope [slope, intercept] // Calculate slope and intercept [slope, intercept] = f_log_regression(close, length) float start = math.exp(intercept + slope * length) float end = math.exp(intercept) float diff = end - end[3] float deviation = ta.stdev(close, length) bool up_sig = ta.crossover(diff, 0) and barstate.isconfirmed bool dn_sig = ta.crossunder(diff, 0) and barstate.isconfirmed // } // PLOT ――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――{ // Define Colors color color_up = color.from_gradient(diff, ta.lowest(diff,200), ta.highest(diff,200), na, col1) color color_dn = color.from_gradient(diff, ta.lowest(diff,200), ta.highest(diff,200), col2, na) color channel_col = end > start ? col1 : col2 color trend_col = end > end[3] ? color_up : color_dn color trend_col1 = end > end[3] ? col1 : col2 p1 = plot(end, "Log Regression", color = trend_col1, linewidth = 2) p2 = plot(end[3], color = trend_col, display = display.none, editable = false) plotshape(up_sig ? end : na, "Up", shape.xcross, location.absolute, chart.fg_color, size = size.tiny) plotshape(dn_sig ? end : na, "Dn", shape.xcross, location.absolute, chart.fg_color, size = size.tiny) fill(p1, p2, fill_band ? trend_col : na) // Define upper and lower channel based on standard deviation var line up1 = na var line up = na var line base = na var line lw = na var line lw1 = na var label lbl_t = na if na(base) and mid_disp base := line.new(bar_index[channel_len], start, bar_index, end, style = line.style_dashed) else base.set_xy1(bar_index[channel_len], start) base.set_xy2(bar_index, end) base.set_color(chart.fg_color) if na(up1) up1 := line.new(bar_index[channel_len], start+deviation*(channel_width+0.3), bar_index, end + deviation*(channel_width+0.3), width = 3) else up1.set_xy1(bar_index[channel_len], start+deviation*(channel_width+0.3)) up1.set_xy2(bar_index, end + deviation*(channel_width+0.3)) up1.set_color(channel_col) if na(up) up := line.new(bar_index[channel_len], start+deviation*channel_width, bar_index, end + deviation*channel_width, width = 1) else up.set_xy1(bar_index[channel_len], start+deviation*channel_width) up.set_xy2(bar_index, end + deviation*channel_width) up.set_color(na) if na(lw) lw := line.new(bar_index[channel_len], start-deviation*channel_width, bar_index, end - deviation*channel_width, width = 1) else lw.set_xy1(bar_index[channel_len], start-deviation*channel_width) lw.set_xy2(bar_index, end - deviation*channel_width) lw.set_color(na) if na(lw1) lw1 := line.new(bar_index[channel_len], start-deviation*(channel_width+0.3), bar_index, end - deviation*(channel_width+0.3), width = 3) lbl_t := label.new(bar_index[channel_len], start-deviation*(channel_width+0.3)) else lw1.set_xy1(bar_index[channel_len], start-deviation*(channel_width+0.3)) lw1.set_xy2(bar_index, end - deviation*(channel_width+0.3)) lw1.set_color(channel_col) lbl_t.set_xy(bar_index[channel_len], start-deviation*(channel_width+0.3)) lbl_t.set_text(end > start ? "UP" : "DN") lbl_t.set_style((end < start ? label.style_label_lower_right : label.style_label_upper_right)) lbl_t.set_color(channel_col) lbl_t.set_textcolor(#070f23) // Fill Channel Upper and Lower Zones with color linefill.new(lw, lw1, color.new(channel_col, 70)) linefill.new(up, up1, color.new(channel_col, 70)) // Info Dash if barstate.islast dash = table.new(position.top_right, 10, 10, bgcolor = color.new(chart.fg_color, 90), border_color = chart.bg_color, border_width = 5) dash.cell(0, 0, "Slope: " + str.tostring(slope*100, "#,###.###"), text_color = chart.fg_color) dash.cell(0, 1, "Log Regression Channel: " + (end > start ? "UP" : "DN"), text_color = channel_col) dash.cell(0, 2, "Logarithmic Regression: " + (end > end[3] ? "UP" : "DN"), text_color = color.new(trend_col, 0)) // }
프로필 이미지
파생돌이
2025-06-19
259
글번호 191934
지표
답변완료

시뮬레이션 돌리는 법 문의

안녕하세요? 시뮬레이션 돌리는 법 문의 드립니다. 실제 과거데이터로 시뮬레이션을 돌려 보면, SetStopProfittarget(StopTrailingPrice, PointStop); SetStopTrailing(1, StopTrailingPrice, PointStop); 은 아주 큰 차이를 보입니다. 실제 상황이랑, 이 2개 함수간에 어떤 차이가 있는지 알듯, 말듯 합니다. 그리고, 실제 상황과 가장 유사한, 추천하시는 시뮬레이션 방법에 대해 알려주십시요.
프로필 이미지
쌈팔광땡
2025-06-19
274
글번호 191930
시스템

2685up 님에 의해서 삭제되었습니다.

프로필 이미지
2685up
2025-06-19
11
글번호 191929
시스템
답변완료

질문 부탁드립니다

답변감사합니다 plot((iff(condition3 == true,1,0)) 으로 확인을 해보면 하루중에 조건 (aa[0]<h and aa[0]>l) 을 만족하게 되는 봉이 나타나면 그 다음봉이 aa[0]<h and aa[0]>l 조건을 만족하지 않아도 계속 true 로 나타나고 다음 거래일이 되면 false 가 되는데요 분봉상 조건검색이 뭘 의미하는지 개념을 잘몰라서 그런지 뭔가 이해가 잘 안가는데요 조건만족시 Condition3를 true 로 설정해놓는것과 find 를 하는것의 관계를 잘 모르겠습니다 true 로 했다가 거래일이 변경되면 다시 false 로 리셋을 하는거 같은데.. "오늘 당일날 봉들중에서 하나라도 조건에 맞으면 검색하라 " 이런 의미는 아닌건가요? if Bdate != Bdate[1] Then { Condition3=False; } ... if Condition3==False and (aa[1]<h and aa[1]>l) Then { Condition3=true; Find(1); } 질문2) 그럼 혹시 그냥 단순하게 분봉 차트로 봤을때, 지금 현재봉만 (가장 최근봉) 가지고 봤을때 aa[1]<h and aa[1]>l 조건 만족하는걸 찾게 하는건 안될까요?? 일봉에서 하는거처럼요. 그리고 질문1에서 말한거처럼 분봉상 당일날 한번이라도 그런봉이 나오면 검색하게 해주는 식은 작성이 가능할까요? 감사합니다
프로필 이미지
yamu
2025-06-19
182
글번호 191923
검색
답변완료

부탁드립니다

아래수식을 검색식으로 만들어 주시면 감사하겠습니다. A=Predayhigh()-Predaylow(); B=Dayopen()+a*0.5; B1=RSI(2); Crossup(C,B) and B1>50
프로필 이미지
hilim
2025-06-19
236
글번호 191922
종목검색
답변완료

문의

국내주간선물 5분봉 기준입니다. 아래수식은 수량 1개로 운영하는 수식입니다. 요청사항) 첫진입때 수량 2개를 진입시키고 1개씩 청산수식을 따로 적용하여 청산하고 싶습니다. 첫번째 청산수식(2개에서 1개) SetStopLoss(1,PointStop); SetStopTrailing(2,0,PointStop); 두번째 청산수식(나머지 1개) SetStopLoss(2,PointStop); SetStopTrailing(3,0,PointStop); 수식 완성 부탁드립니다. 항상 고맙습니다. ***************************************************************************** input : upfs(575); var : T1(0),entry(0); if Bdate != Bdate[1] Then T1 = TotalTrades; if MarketPosition == 0 Then entry = TotalTrades-T1; Else entry = (TotalTrades-T1)+1; if data1(Bdate)==data2(Bdate) and Data2(c>Lowd(0)+upfs) and entry==0 Then Buy("b"); SetStopLoss(1,PointStop); SetStopTrailing(2,0,PointStop);
프로필 이미지
목마와숙녀
2025-06-19
194
글번호 191921
시스템
답변완료

분봉9분봉에서 지금분봉이 최고값으로 변환 부탁드려요 항상 감사하고 있슴미다

실력이 안되서 정말 죄송함미다 건강하세요 분봉 9 분봉에서 지금 9 분봉이 41봉 최고 높은값이 나올때 종목검색 할수 있게 수정부탁 드려요 항상 감사하고 있슴미다 건강하세요 input : AvgLen(7); var : xclose(0),xopen(0),xvolume(0),nVolAccum(0),nRes(0); PlotBaseLine1(0,"line",red); xClose = close; xOpen = open; xVolume = volume; nVolAccum = AccumN(iff(xClose > xOpen, xVolume, iff(xClose < xOpen, -xVolume, 0)) ,AvgLen); nRes = nVolAccum / AvgLen;
프로필 이미지
뽀스뽀스
2025-06-19
181
글번호 191920
검색
답변완료

검색식 부탁드립니다

50일 동안 고점 대비 저점이 10% 이내에서 횡보하다가 50일 평균 거래량보다 500% 이상 거래량이 터지면서 고점을 돌파하고, 전일 종가 대비 당일 종가가 10% 이상인 양봉인 종목을 검색하고싶습니다 기간, 횡보율, 거래량, 전일대비 당일 종가 상승률은 변수 처리 부탁합니다.
프로필 이미지
삼손감자
2025-06-19
194
글번호 191911
종목검색

와우리 님에 의해서 삭제되었습니다.

프로필 이미지
와우리
2025-06-19
0
글번호 191905
지표
답변완료

부탁드립니다

var : shortPeriod(5), longPeriod(20); var : bh(0),bd(0),bt(0),tl1(0),tx1(0),A1(0),A2(0),A3(0); var : sl(0),sd(0),st(0),tl2(0),tx2(0),B1(0),B2(0),B3(0); var : A31(0),B31(0); value1 = ma(C, shortPeriod); value2 = ma(C, longPeriod); If CrossUP(value1, value2) Then { buy(); bh = h; bd = sDate; bt = sTime; if sl > 0 Then { A1 = sd; A2 = st; A3 = sl; A31 = A3[1]; TL_SetEnd(TL1,A1,A2,A3[1]); tl1 = TL_New(A1,A2,A3,NextBarSdate,NextBarStime,A3); Text_SetLocation(Tx1,A1,A2,A3[1]); if A3 > A31 Then tx1 = Text_New(NextBarSdate,NextBarStime,A3,"▼"+NumToStr(A3,1)); Else tx1 = Text_New(NextBarSdate,NextBarStime,A3,NumToStr(A3,1)); Text_SetColor(tx1,Blue); Text_SetStyle(tx1,1,0); } } If CrossDown(value1, value2) Then { sell(); sl = l; sd = sDate; st = sTime; if bh > 0 Then { B1 = bd; B2 = bt; B3 = bh; B31 = B3[1]; TL_SetEnd(TL2,B1,B2,B3[1]); TL2 = TL_New(B1,B2,B3,NextBarSdate,NextBarStime,B3); Text_SetLocation(tx2,B1,B2,B3[1]); if B3 < B31 Then tx2 = Text_New(NextBarSdate,NextBarStime,B3,"▲"+NumToStr(B3,1)); Else tx2 = Text_New(NextBarSdate,NextBarStime,B3,NumToStr(B3,1)); Text_SetColor(tx2,Red); Text_SetStyle(tx2,1,1); } } if MarketPosition == 1 Then { if h > bh Then { bh = h; bd = sDate; bt = sTime; } } if MarketPosition == -1 Then { if l < sl Then { sl = l; sd = sDate; st = sTime; } } TL_SetEnd(tl1,NextBarSdate,NextBarStime,A3); TL_SetEnd(tl2,NextBarSdate,NextBarStime,B3); Text_SetLocation(tx1,NextBarSdate,NextBarStime,A3); Text_SetLocation(tx2,NextBarSdate,NextBarStime,B3); 위의 식을 기준으로 60 일선을 추가 60 일선 위에서는 매수 신호만 표시 60 일선 아래서는 매도 신호만 표시 되게 부탁드립니다
프로필 이미지
와우리
2025-06-19
226
글번호 191904
시스템