커뮤니티

예스랭귀지 Q&A

글쓰기
답변완료

RVI

var:RVI(0); RVI = if(avg(if(c <= c(1),Stdev(c,10),n) == 0,100,(100-(100/(1+(avg(if(c>c(1),Stdev(c,10),0),n) / avg(if(c<c(1),Stdev(c,10),0),n))))); Plot1(RVI,"RVI"); //함수dptj Stdev(c,10),0),n) n 이 무슨작동인지 설명 부탁하고요 식이 작동 가능하게 코딩 부탁드립니다
프로필 이미지
불스아이
2024-05-17
982
글번호 179641
지표
답변완료

수평이동

안녕하세요. 아래수식에서 수식4, 수식5 의 수평이동이 25로 고정되어 변경이 되지 않습니다. 12로 변경을 했는데, 25로 다시 변경이 됩니다. 수평이동이 가능하게끔 변경부탁드립니다. 그리고, 변수항목에서 비율이 어떤의미인지 잘 모르겠는데,, 비율도 수정함에 따라 차트변화가 있다면 수정이 가능하게끔 부탁드립니다. input :shortPeriod(12),midPeriod(26),longPeriod(52),비율(1); var : AA(0),BB(0),CC(0); AA = (highest(high,midPeriod)+lowest(low,midPeriod))/2; BB = (highest(high,shortPeriod)+lowest(low,shortPeriod)+highest(high,midPeriod)+lowest(low,midPeriod))/4; CC = (highest(high,longPeriod)+lowest(low,longPeriod))/2; if AA>AA[1]*(1+비율/1000) Then { Plot1(AA,"수식1"); } Else NoPlot(1); if AA<=AA[1]*(1+비율/1000) and AA>=AA[1]*(1-비율/1000) Then { plot2(AA,"수식2"); } Else NoPlot(2); if AA<AA[1]*(1-비율/1000) Then { plot3(AA,"수식3"); } Else NoPlot(3); plot4(BB,"수식4"); FixPlotShift(4,midPeriod-1); plot5(CC,"수식5"); FixPlotShift(5,midPeriod-1);
프로필 이미지
조르바
2024-05-17
985
글번호 179638
지표
답변완료

문의 드립니다.

아래 식에서 시가 위에 있을 매수만 시가 아래에 있을 때 매도만 적용되도록 부탁드립니다. input : sto1(10),sto2(5); var : stok(0); stok = StochasticsK(sto1,sto2); if CrossDown(stok,20) Then Buy(); input : sto1(10),sto2(5); var : stok(0); stok = StochasticsK(sto1,sto2); if CrossUp(stok,80) Then Sell();
프로필 이미지
선물대장
2024-05-17
944
글번호 179637
시스템
답변완료

종목 검색식 문의입니다.

일봉 기준으로, 금일 누적 거래량이 '전일 동시간대 누적거래량'의 2배 이상이 되는 종목을 실시간으로 검색하는 종목검색식을 부탁드립니다. 감사합니다.^^
프로필 이미지
아폴로85
2024-05-17
921
글번호 179635
종목검색
답변완료

옵션수식

안녕하세요? 옵션 월물시가값을 구하는 수식을 부탁합니다. 월물 시작일 양옵션 data1과 data2의 종가값을 차트에 표시하는 수식을 알려주시기 바랍니다.
프로필 이미지
khkwon
2024-05-17
766
글번호 179631
지표

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

프로필 이미지
ryan1
2024-05-17
54
글번호 179625
시스템
답변완료

문의 드립니다

수식어 부탁드립니다. 해외선물 매매시간 0700 익일0600 익절100 손절100 , 진입청산 1회 1. 매수후 청산 전일 장중 하락폭을 100%로 가정했을때 당일 장중 그폭의 60%를 내려갔을때 매수후 당일 이전 고점의 95%의 지점에 청산 2. 매도후 청산 전일 장중 상승폭을 100%로 가정했을때 당일 그폭의 60%를 올라갔을때 매도후 당일 이전 저점의 95%의지점에 청산 *추가질문* 해외선물 시간설정이 밤12시로 시작되는 이유가 스타트시간이 스톱시간보다 낮은경우의 수 인지 문의 드립니다. 저번에 이야기 하셨는데 잘 정립이 되질 않네요.
프로필 이미지
푸른
2024-05-17
698
글번호 179624
시스템
답변완료

문의드립니다.

늘 고맙습니다. 청산식을 만들다보니 잘 이해가 안가는 부분이 있어 문의 드립니다. 아래와 같은 청산식을 돌려보았습니다. 그런데 아래 수식중 be11-2: bei12=index; 이것을 넣지않고 돌리니 진입후 바로 청산이 되어 버립니다. 왜 그런것인가요? 그 아래 if문이 없어서 그걸 다시 쓰지도 않는데 말이죠. var:be11(0),bei11(0),bei12(0),be11목표(0); if MarketPosition == 1 Then { be11=1; bei11=Index; be11목표=진폭[BarsSinceEntry]+LL50[BarsSinceEntry]; } if be11==1 and bei11>0 Then { be11=2; bei12=Index; ExitLong("장기정배열매수청산",AtLimit,be11목표,"장기정배열매수"); ExitLong("장기정배열매수청산2",AtLimit,EntryPrice+75,"장기정배열매수"); ExitLong("장기정배열매수손절",AtStop,EntryPrice-25,"장기정배열매수"); }
프로필 이미지
산골소년
2024-05-17
679
글번호 179623
시스템
답변완료

시스템 작성의뢰

수고 하십니다 ! Input : Period1(1), Period2(15), Period3(30), Period4(60), Period5(120),period6(240),Period7(480), Period8(960), Period9(1920), Period10(3840),period11(7680); var : Sma1(0),Sma2(0),Sma3(0),Sma4(0),Sma5(0),sma6(0),Sma7(0),Sma8(0),Sma9(0),Sma10(0),sma11(0),OBVV(0),PositiveVolumeIndex(0),dpo(0); input : FIPeriod(5); var : fval(0),fi(0); sma1 = ma(C,period1); sma2 = ma(C,period2); sma3 = ma(C,period3); sma4 = ma(C,period4); sma5 = ma(C,period5); sma6 = ma(C,period6); sma7 = ma(C,period7); sma8 = ma(C,period8); sma9 = ma(C,period9); sma10 = ma(C,Period10); sma11 = ma(C,Period11); 위수식을 적용하여 이동 평균선이 역배열 하고 960 이평선과 1920 이평선의 간격이 10 틱이상 벌어지고 3840 이평선과 7680 이평선의 간격이 20 틱이상 벌어지고 slope of volume 지표가 위아래 로 1 이상 움직이고 1 평균 거래량이 60 이상 증가하고 test1 지표가 1.08 로 하락 하고 er bear power 지표가 0.00 으로 상승 하고 120 이평선과 240 이평선이 업 크로스 할때 매수 하고 이동 평균선이 정배열 하고 960 이평선과 1920 이평선의 간격이 10 틱이상 벌어지고 3840 이평선과 7680 이평선의 간격이 20 틱이상 벌어지고 slope of volume 지표가 위아래 로 1 이상 움직이고 1 평균 거래량이 60 이상 증가하고 test1 지표가 1.09 로 상승 하고 er bear power 지표가 -0.00 으로 하락 하고 120 이평선과 240 이평선이 다운 크로스 할때 매도 하는 시스템을 부탁 드립니다 !
프로필 이미지
tnsflwls
2024-05-17
747
글번호 179622
시스템
답변완료

수식 문의드립니다.

안녕하세요. 다음 파인 스크립트 수식을 예스로 변환 부탁드립니다. 쓰기 금지단어 셀렉트&업데이트는 한글로 수정했습니다. 그리고 Table 과 Break-Even Curve는 시간이 걸리면 생략해도 됩니다. 다시 한번 감사드립니다^^ indicator(overlay=true,max_lines_count=500) //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~} // ~~ Settings { // ~~ Tooltips t1 = "셀렉트 the method used to calculate the trailing stop. 'Auto' dynamically calculates based on market conditions. 'Percentage' uses a fixed percentage for trailing. ₩n₩nThe second value defines the lookback period over which to calculate the highest high and lowest low for trailing stop calculations. Increasing this value will make the trailing stop less sensitive to price changes." t2 = "Sets the percentage step for the trailing stop when 'Percentage' method is 셀렉티드. Increasing this value will increase the distance of the trailing stop from the price." t3 = "Determines the bias of the trailing stop. 'Bullish' sets it to track only upward moves, 'Bearish' only downward, and 'Auto' adjusts dynamically based on price action." // ~~ Inputs step = input.string("Auto","Trailing Method",["Auto","Percentage","Pivot"], group="Trailing", inline="Trailing", tooltip="") prd = input.int(20,"Trailing Size", minval=2, group="Trailing", inline="Trailing", tooltip=t1) perc = input.float(.5,"Percentage Step",step=.01,group="Trailing", inline="", tooltip=t2)/100 bias = input.string("Auto","Set Bias",["Bullish","Bearish","Auto"], group="Bias", inline="", tooltip=t3) upcol = input.color(#089981 , title='', group='Style', inline="Style") dncol = input.color(#f23645, title='', group='Style', inline="Style") upcol1 = input.color(color.lime , title='', group='Style', inline="Style1") dncol1 = input.color(color.maroon, title='', group='Style', inline="Style1") showBE = input.bool(true,"Break-Even Curve",group="Table",inline="Table") showTable = input.bool(true, title='Show Table', group='Table', inline='Table') labels = input.bool(false, title='Show Labels', group='Table', inline='Table') tblSize = input.string("Auto","Table Size",["Auto","Tiny","Small","Normal","Large","Huge"], group="Table", inline="style") posi = input.string(position.top_right, title="",options =[position.top_right,position.top_center, position.top_left,position.bottom_right,position.bottom_center,position.bottom_left,position.middle_right,position.middle_left], group="Table",inline="style", tooltip="") Table_Text = input.color(color.new(color.white, 0), title='Text', inline='style', group='Table') Table_BG = input.color(color.new(#176cff, 0), title='BG', inline='style', group='Table') //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~} // ~~ General Variables { b = bar_index dot = label(na) var curve = array.new<line>() var labs = array.new<label>() //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~} // ~~ AutoMove calc { hi = ta.highest(high,prd*10) lo = ta.lowest(low,prd*10) var ph = high var pl = low var phL = b var plL = b var peaks = array.new<float>() ph := ta.highestbars(high, prd) == 0 ? high : ph pl := ta.lowestbars(low, prd) == 0 ? low : pl phL:= ta.highestbars(high, prd) == 0 ? b : phL plL:= ta.lowestbars(low, prd) == 0 ? b : plL dir = phL>plL ? 1 : -1 //Delayed if dir!=dir[1] peaks.push(dir>0 ? (ph[1]-pl)/ph[1] : (ph-pl[1])/pl[1]) //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~} // ~~ Functions { Switch(Los)=> autocalc = na(peaks.median())?0:peaks.median() output = switch step "Auto" => Los?low-(low*autocalc):high+(high*autocalc) "Percentage" => Los?low-(low*perc):high+(high*perc) "Pivot" => Los?pl:ph Cleaner(arr)=> if arr.size()>0 for a in arr a.delete() arr.clear() ts = switch tblSize "Tiny" => size.tiny "Small" => size.small "Normal" => size.normal "Large" => size.large "Huge" => size.huge "Auto" => size.auto //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~} // ~~ Trailing Mangement { var longtsl = Switch(true) var shorttsl = Switch(false) var pos = 0 if low<=longtsl longtsl := Switch(true) shorttsl := Switch(false) pos := -1 if high>=shorttsl longtsl := Switch(true) shorttsl := Switch(false) pos := 1 pos := bias=="Bullish"?1:bias=="Bearish"?-1:pos //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~} // ~~ Plots { active = longtsl==longtsl[1] lt1 = plot(longtsl,color=active?pos>0?dncol:upcol:na, title="TSL") st1 = plot(shorttsl,color=active?pos>0?upcol:dncol:na, title="TSL") p1 = plot(close,"",color(na),editable=false,display=display.none) mid = math.avg(longtsl,shorttsl) plot(mid,color=active?color.rgb(125, 196, 255):na, style=plot.style_steplinebr, title="Mid") PosOver = pos ==-1 and close>mid?na:upcol1 NegUnder = pos ==1 and close<mid?na:dncol1 fill(p1,lt1,pos>0 and active?color.new(PosOver,80):active?color.new(NegUnder,80):na, title="") fill(p1,st1,pos>0 and active?color.new(upcol,80):active?color.new(dncol,80):na, title="") //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~} // ~~ Table { if barstate.islast tpdist = pos>0?shorttsl-close:close-longtsl sldist = pos>0?close-longtsl:shorttsl-close distdiff = tpdist/sldist wr = (1/(1+distdiff))*100 if showTable var tbl = table.new(posi, 2, 5, frame_color=color.black, frame_width=3, border_width=2, border_color=color.new(color.white, 100)) tbl.cell(0, 0, 'Risk/Reward', text_halign=text.align_center, bgcolor=Table_BG, text_color=Table_Text, text_size=ts) tbl.cell(1, 0, "1:"+str.tostring(math.round(distdiff,2)), text_halign=text.align_center, bgcolor=Table_BG, text_color=Table_Text, text_size=ts) tbl.cell(0,1, 'Minimum Winrate', text_halign=text.align_center, bgcolor=Table_BG, text_color=Table_Text, text_size=ts) tbl.cell(1,1, str.tostring(wr,format.percent), text_halign=text.align_center, bgcolor=Table_BG, text_color=Table_Text, text_size=ts) tbl.cell(0, 2, 'Reward', text_halign=text.align_center, bgcolor=Table_BG, text_color=Table_Text, text_size=ts) tbl.cell(1, 2, str.tostring((tpdist/close)*100,format.percent), text_halign=text.align_center, bgcolor=Table_BG, text_color=Table_Text, text_size=ts) tbl.cell(0, 3, 'Risk', text_halign=text.align_center, bgcolor=Table_BG, text_color=Table_Text, text_size=ts) tbl.cell(1, 3, str.tostring((sldist/close)*100,format.percent), text_halign=text.align_center, bgcolor=Table_BG, text_color=Table_Text, text_size=ts) tbl.cell(0, 4, 'Bias', text_halign=text.align_center, bgcolor=Table_BG, text_color=Table_Text, text_size=ts) tbl.cell(1, 4, str.tostring(pos>0?"Bullish":"Bearish"), text_halign=text.align_center, bgcolor=pos>0?color.rgb(104, 218, 108):color.red, text_color=Table_Text, text_size=ts) //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~} // ~~ Break-Even Curve { if showBE Cleaner(curve) top = lo + (hi-lo)/3 float prev_y = top for j=b+100 to b+200 by 1 y = prev_y-((prev_y-lo)/14) curve.push(line.new(j,prev_y,j+1,y,color=color.blue, width=2)) prev_y := y //Create & 업데이트 Frame var box box_upper_left = box.new(na,na,na,na,na, text="Zone 2", text_color = color.white, bgcolor=color.new(color.lime, 80)) var box box_upper_right = box.new(na,na,na,na,na, text="The Magic Zone",text_color = color.white, bgcolor=color.new(color.lime, 70)) var box box_lower_left = box.new(na,na,na,na,na, text ="Zone 1", text_color = color.white,bgcolor=color.new(color.green, 70)) var box box_lower_right = box.new(na,na,na,na,na, text="Zone 3", text_color = color.white,bgcolor=color.new(color.green, 80)) box_upper_left.set_lefttop(b+100,top) box_upper_left.set_rightbottom(b+150,(top+lo)/2) box_upper_right.set_lefttop(b+150,top) box_upper_right.set_rightbottom(b+200,(top+lo)/2) box_lower_left.set_lefttop(b+100,(top+lo)/2) box_lower_left.set_rightbottom(b+150,lo) box_lower_right.set_lefttop(b+150,(top+lo)/2) box_lower_right.set_rightbottom(b+200,lo) // Delete & Add labels Cleaner(labs) for i=0 to 10 labs.push(label.new(chart.point.from_index(b+100,lo+i*(top-lo)/10), str.tostring(i*2)+"R", color=color(na), textcolor=chart.fg_color, style=label.style_label_right)) labs.push(label.new(chart.point.from_index(b+100+i*10, lo), str.tostring(i * 10) + "%", color=color(na), textcolor=chart.fg_color, style=label.style_label_up)) // Dot for the 'Break-Even Point' y = (top-lo)*(distdiff/20) dot := label.new(chart.point.from_index(b+100+int(wr),lo+y), style=label.style_circle,color=color.yellow,size=size.tiny) (dot[1]).delete() // ~~ labels { var label stopLossLabel = na var label riskRewardLabel = na stoploss = pos>0?longtsl:shorttsl riskreward = pos>0?shorttsl:longtsl if labels stopLossLabel := label.new(bar_index+5, stoploss, "Risk" + " " + str.tostring((sldist/close)*100,format.percent), color=dncol, textcolor=color.white, style=label.style_label_left, yloc=yloc.price) riskRewardLabel := label.new(bar_index+5, riskreward, "Reward" + " " + str.tostring((tpdist/close)*100,format.percent), color=upcol, textcolor=color.white, style=label.style_label_left, yloc=yloc.price) label.delete(stopLossLabel[1]) label.delete(riskRewardLabel[1]) //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~} // ~~ Trend Change switchUp = pos==1 switchDn = pos==-1 plotshape(switchUp and switchDn[1]?longtsl:na, location=location.absolute, style=shape.triangleup, color=upcol, size=size.small, title="Positive Trend") plotshape(switchDn and switchUp[1]?shorttsl:na, location=location.absolute, style=shape.triangledown ,color=dncol, size=size.small, title="Negative Trend") //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~}
프로필 이미지
cooparoo
2024-05-16
1044
글번호 179621
지표