커뮤니티

예스랭귀지 Q&A

글쓰기
답변완료

수식전환 요청드립니다.

안녕하세요. 운영자님 다음 지표수식을 예스트레이더에서 작동될 수 있도록 전환을 부탁드립니다. 감사합니다. //@version=6 indicator("High Volume Node - ML", overlay = true, max_boxes_count = 500, max_lines_count = 500) // INPUTS ――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――{ len = input.int(300, "len") bins = input.int(100, "bins") prf_col = input.color(color.rgb(0, 187, 212, 60), "Profile") poc_col = input.color(color.blue, "High Volume Node") delta_col1 = input.color(color.aqua, "Output+", inline = "1") delta_col2 = input.color(color.red, "Output-", inline = "1") profile1 = input.bool(true, "VP1", inline = "vp") profile2 = input.bool(true, "VP2", inline = "vp") profile3 = input.bool(true, "VP3", inline = "vp") profile4 = input.bool(true, "VP4", inline = "vp") // } // CALCULATIONS――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――{ profile(length, bins, poc_mult, style = true)=> values = array.new<float>() vol_bins = array.new<float>(bins) tot_vol = array.new<float>() delta_vol = array.new<float>() max_val = float(na) min_val = float(na) step = float(na) var bin_levels = array.new<line>() var bin_labels = array.new<label>() poly = array.new<chart.point>() if barstate.islast for i = 0 to length - 1 values.push(high[i]) values.push(low[i]) max_val := values.max() min_val := values.min() step := (max_val-min_val)/bins if barstate.islast for i = 0 to bins - 1 vol_bins.set(i, 0) for i = 0 to length - 1 c_top = math.max(close[i], open[i]) c_low = math.min(close[i], open[i]) c = close[i] o = open[i] vol = volume[i] tot_vol.push(vol) delta_vol.push(c > o ? vol : -vol) for j = 0 to bins - 1 lower = min_val + step * j upper = lower + step mid = math.avg(lower, upper) if c <= upper + step*1.5 and c >= lower - step*1.5 vol_bins.set(j, vol_bins.get(j) + vol) if barstate.islast check = false if bin_levels.size() > 0 for k = 0 to bin_levels.size() - 1 line.delete(bin_levels.get(k)) if bin_labels.size() > 0 for k = 0 to bin_labels.size() - 1 label.delete(bin_labels.get(k)) for i = 0 to bins - 1 lower = min_val + step * i upper = lower + step mid = math.avg(upper, lower) vol = int(vol_bins.get(i) / vol_bins.max() * 25) start = bar_index - length end = start +vol var midd = float(na) poly.push(chart.point.from_index(i == 0 ? start : i == bins - 1 ? start : end+1, mid)) if vol_bins.get(i) == vol_bins.max() and not check check := true bin_labels.push(label.new(start, mid, str.tostring(vol_bins.get(i), format.volume), style = label.style_label_right, color = color.new(poc_col, 25), force_overlay = true)) bin_levels.push(line.new(start, mid, start + int(length/poc_mult), mid, color = poc_col, force_overlay = true, width = 3)) bin_levels.push(line.new(start, max_val, bar_index, max_val, color = chart.fg_color, style = style ? line.style_solid : line.style_dashed)) bin_levels.push(line.new(start, min_val, bar_index, min_val, color = chart.fg_color, style = style ? line.style_solid : line.style_dashed)) bin_levels.push(line.new(start, max_val, start, min_val, color = chart.fg_color, style = line.style_solid)) bin_levels.push(line.new(start, max_val, start, min_val, color = chart.fg_color, style = line.style_solid)) bin_labels.push(label.new(start, max_val, "Total₩n" + str.tostring(tot_vol.sum(), format.volume), style = label.style_label_down, text_font_family = font.family_monospace, size = size.small, tooltip = "Total Volume over VolumeProfile period", color = color.blue)) bin_labels.push(label.new(start, min_val, str.tostring(delta_vol.sum(), format.volume) + "₩nOutput", style = label.style_label_up, text_font_family = font.family_monospace, size = size.small, tooltip = "Output Volume over VolumeProfile period", color = delta_vol.sum() < 0 ? delta_col2 : delta_col1)) polyline.delete( polyline.new(poly, line_color = #00e67700, fill_color = prf_col)[1] ) if profile1 profile(len, bins, 2) if profile2 profile(int(len/2), bins, 2, false) if profile3 profile(int(len/4), bins, 2, false) if profile4 profile(int(len/8), bins, 1, false) // }
프로필 이미지
고박사122
2025-06-27
226
글번호 192134
지표
답변완료

수식 부탁드립니다

자표식 부탁 드립니다. 시작 시간이 00시 날짜가 아니라 07시 전자거래시간(ETH) 기준입니다. study(title="Opening-Range", shorttitle="Opening-Range", overlay=true) up60on = input(true, title="60 Minute Opening Range High") down60on = input(true, title="60 Minute Opening Range Low") is_newbar(res) => change(time(res)) != 0 adopt(r, s) => security(tickerid, r, s) high_range = valuewhen(is_newbar('D'),high,0) low_range = valuewhen(is_newbar('D'),low,0) up = plot(up60on ? adopt('60', high_range):na, color = lime, style=circles, linewidth=4) down = plot(down60on ? adopt('60', low_range): na, color = #DC143C, style=circles, linewidth=4) trans60 = up60on ? 75 : 100 fill(up, down, color = white, transp=trans60)
프로필 이미지
사노소이
2025-06-27
196
글번호 192131
지표
답변완료

함수 관련.. 날짜를 문자열 형식으로?

말그대로 날짜 YYMMDD 를 문자열 "YYMMDD" 로 형식을 바꾸는 방법이 있을까요?
프로필 이미지
타점
2025-06-26
164
글번호 192130
지표
답변완료

적용가능하도록 부탁드립니다.

indicator("Trend Strength Gauge", 'HSMA',overlay = true) // Inputs length = input(20, "HSMA Length") color_up = input.color(color.teal, "Color Up", group = "Theme") color_dn = input.color(color.white, "Color Down", group = "Theme") // Hma wma = ta.wma(close, length) wma1 = ta.wma(close, length) a = 3 * wma - 2 * wma1 // Sma a1 = ta.sma(close, length) // Extract the difference (HMA - SMA) diff = a - a1 // Table Function printTable(txt, col, row, color, txt1, col1, row1, color1) => var table t = table.new(position.bottom_center, 60, 3), table.cell(t, col, row, txt, bgcolor = color), table.cell(t, col1, row1, txt1, bgcolor = color1, text_color = color.white) // Normalize x = diff len = 100 xMax = ta.highest(x, len) xMin = ta.lowest(x, len) range_ = xMax - xMin y = x / range_ // Convertation searies float to searies int with round() g = math.round(y*40) // Plot color1 = color.from_gradient(g, -2, 2, color_dn, color_up) p1 = plot(a, 'HEMA', color1, 2) p2 = plot(a1, 'SMA', color1, 2) fill(p1, p2, color = color1) // Convertation negative values to positive g := g < 0 ? g *- 1 : g // Plot trend strength gauge if barstate.islast for i = 1 to 40 color_ = math.round(y*40) < 0 ? color_dn : color_up color = color.from_gradient(i, 1, 50, color.rgb(0, 137, 123, 100), color_) printTable("", i, 1, color, "V", g, 1, color.rgb(255, 255, 255, 100))
프로필 이미지
다올
2025-06-26
172
글번호 192129
지표
답변완료

수식작성 부탁드립니다

아래 수식(1,2,3)을 하나의 수식으로 작성 부탁드립니다. 매매시간내에 1. data1. 기준에 따라 Buy, Exitlong 되며, 2. 진입조건: data2의 sb < IMACD[0]일 때 매수진입 됨. 1. data1.매수진입, 청산 Inputs: Length(9), StdDev(2), Bars(2); Variables: BBTop(0),BBBot(0); BBTop = BollBandup(Length, StdDev); BBBot = BollBanddown(Length, StdDev); If CountIF(Close < BBBot, Bars) == Bars Then Buy("B", AtStop, BBBot); If CountIF(Close > BBTop, Bars) == Bars Then Exitlong("Ex", AtStop, BBTop); 2. data2. 아래 수식 input : n(30), long(34),signal(9); var : S1(0,Data2),D1(0,Data2),sTM(0,Data2),et(0,Data2),ets(0,Data2),eTM(0,Data2); Var : SS(0,Data2),TS(0,Data2),second(0,Data2),ii(0,Data2),cnt(0,Data2),tf(0,Data2); var : hlc(0,Data2),hi0(0,Data2),lo0(0,Data2),Ema5(0,Data2),Ema6(0,Data2),mi0(0,Data2),sb(0,Data2); var : hh(0,Data2),ll(0,Data2),cc(0,Data2),b(0,Data2),sum(0,Data2); var : hi01(Nan,Data2),lo01(Nan,Data2),ep(0,Data2),preEma5(0,Data2),preEma6(0,Data2); Array : IMACD[100](0,Data2); ep = 2/(long+1); if Bdate != Bdate[1] Then { stm = TimeToMinutes(stime); D1 = Bdate; } if D1 > 0 then { if date == D1 Then eTM = TimeToMinutes(time)-S1; Else eTM = TimeToMinutes(time)+1440-S1; ss = sTM*60; et= eTM*60; ets = FracPortion(time/100)*100; TS = et+ets; Second = TS-SS; TF = second%n; if Bdate != Bdate[1] or (Bdate == Bdate[1] and TF < TF[1]) Then { hh = h; ll = l; hi01 = hi0[1]; lo01 = lo0[1]; b = b+1; PreEma5 = Ema5[1]; PreEma6 = Ema6[1]; For cnt = 99 DownTo 1 { IMACD[cnt] = IMACD[cnt-1]; } } if h > hh Then hh = h; if l < ll Then ll = l; hlc = (hh+ll+c)/3; hi0 = iff(IsNan(hi01) == true, ma(hh,long), hi01*(long-1)+hh)/long; lo0 = iff(IsNan(lo01) == true, ma(ll,long), lo01*(long-1)+ll)/long; if b <= 1 then { Ema5 = hlc; Ema6 = hlc; } else{ Ema5 = C * ep + PreEma5 * (1-ep); Ema6 = Ema5 * ep + PreEma6 * (1-ep); } mi0 = Ema5+(Ema5-Ema6); IMACD[0] = iff((mi0>hi0), (mi0-hi0) , iff((mi0<lo0) , (mi0 - lo0) , 0)); sum = 0; For cnt = 0 to signal-1 { sum = sum + IMACD[cnt]; } sb = sum/signal; plot1(IMACD[0],"MAD"); plot2(sb,"SB"); 3. 매매시간설정(당일청산). 9시 10분에 매매시작 15시 까지 매수 진입 허용됨. 15시 이전에 진입한 포지션은 15시에서 15시 10분까지 Exitlong 신호 발생시 청산됨. 15시 이전에 진입한 포지션이 15시 10분까지 Exitlong 신호 발생하지 않을시 15시 10분에 청산됨( 당일청산).
프로필 이미지
뎅이요
2025-06-26
188
글번호 192128
시스템

요타 님에 의해서 삭제되었습니다.

프로필 이미지
요타
2025-06-27
24
글번호 192127
지표
답변완료

예스랭귀지로 변환 부탁드려요

A1=MA(C,5); A2=MA(C,10); A3=MA(C,15); A4=MA(C,20); A5=MA(C,25); A6=MA(C,30); A7=MA(C,35); A8=MA(C,40); A9=MA(C,45); A10=MA(C,50); A11=MA(C,55); A12=MA(C,60); max(A1,A2,A3,A4,A5,A6,A7,A8,A9,A10,A11,A12) < min(A1,A2,A3,A4,A5,A6,A7,A8,A9,A10,A11,A12) * (1+Percent/100) and highest(H, 4,1) < C and O < C and V(1)*2 <= V ---------------------- Percent 5 변환 부탁드립니다. 즐거운 하루 보내세요~
프로필 이미지
스톰82
2025-06-26
148
글번호 192126
종목검색
답변완료

종목 검색부탁드립니다.

1. 수식1) 이 "기준선 0선"을 돌파할때 종목 검색식 부탁드립니다. 수식1) xClose = close; xOpen = open; xVolume = volume; nVolAccum = SUM(if(xClose > xOpen, xVolume, if(xClose < xOpen, -xVolume, 0)) ,AvgLen); nRes = nVolAccum / AvgLen; IF(nRes>0,nRes,0) 수식2) IF(nRes<0,nRes,0) -------------- 지표조건 AvgLen 25
프로필 이미지
일지매7
2025-06-26
143
글번호 192125
종목검색

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

프로필 이미지
oni
2025-06-26
7
글번호 192124
지표
답변완료

지표가 안나와요

안녕하세요, 5월에 야간장 생기기 전에는 나왔었는데,, 지금은 지표가 안나옵니다. 확인부탁드립니다. INPUT : 박스기간(5); var : 시가(0), 전고(0), 전저(0), 전전종(0), 순번(0); array : 진폭[5](0), 최대진폭[5](0); var : 최대진폭의합(0), 예상1(0), 예상2(0), 평균진폭(0); 시가=Data1(OpenD(0)); 최대진폭의합=0; for 순번 = 1 to 박스기간 { 전고=Data1(HighD(순번)); 전저=Data1(LowD(순번)); 전전종=Data1(closeD(순번+1)); 진폭[순번] = 전고-전저; 최대진폭[순번]=max(진폭[순번]); } 최대진폭의합=최대진폭의합+최대진폭[순번]; 평균진폭=최대진폭의합/박스기간; 예상1=시가+평균진폭; 예상2=시가-평균진폭; plot91(예상1, "예상1"); plot92(예상2, "예상2");
프로필 이미지
kimfeel
2025-06-26
162
글번호 192120
지표