커뮤니티

예스랭귀지 Q&A

글쓰기
답변완료

전환추세 고저라인 연장

Input : 전환(0.45); Var:j(0),jj(0),HH(0),LL(0),hiBar(0),loBar(0),최종꼭지점(""),처리구분(""), TL(0),TX(0); Array:고[10,4](0),저[10,4](0); var : TL1(0),TL2(0), TL3(0),TL4(0),TL5(0),TL6(0); HH = H; LL = L; If Index == 0 Then { 고[1,1] = HH; 고[1,2] = 0; 고[1,3] = sDate; 고[1,4] = sTime; 저[1,1] = LL; 저[1,2] = 0; 저[1,3] = sDate; 저[1,4] = sTime; } If Index > 0 Then { hiBar = hiBar + 1; loBar = loBar + 1; } If HH[hiBar] < HH Then hiBar = 0; If LL[loBar] > LL Then loBar = 0; Condition1 = 저[1,1]+전환 <= HH and hiBar == 0; Condition2 = 고[1,1]-전환 >= LL and loBar == 0; 처리구분 = ""; If Condition1 and Condition2 Then { If 최종꼭지점 == "저점" Then { If 저[1,1] > LL Then 처리구분 = "저점처리"; Else 처리구분 = "고점처리"; } Else If 최종꼭지점 == "고점" Then { If 고[1,1] < HH Then 처리구분 = "고점처리"; Else 처리구분 = "저점처리"; } } Else If Condition1 Then 처리구분 = "고점처리"; Else If Condition2 Then 처리구분 = "저점처리"; If 처리구분 == "고점처리" Then { If 최종꼭지점 == "저점" Then { For j = 10 DownTo 2 { For jj = 1 To 4 { 고[j,jj] = 고[j-1,jj]; } } 고[1,1] = HH[hiBar]; 고[1,2] = Index - hiBar; 고[1,3] = sDate[hiBar]; 고[1,4] = sTime[hiBar]; hiBar = -1; loBar = -1; TL = TL_New(저[1,3],저[1,4],저[1,1],고[1,3],고[1,4],고[1,1]); TL_SetSize(TL,1); TL_SetColor(TL,Red); TL1 = TL_New_Self(고[1,3],고[1,4],고[1,1]+0.5,NextBarSdate,NextBarStime,고[1,1]+0.5); TL_SetSize(TL1,1); TL_SetColor(TL1,Magenta); TL3 = TL_New_Self(고[1,3],고[1,4],고[1,1]+1,NextBarSdate,NextBarStime,고[1,1]+1); TL_SetSize(TL3,1); TL_SetColor(TL3,Red); TL5 = TL_New_Self(고[1,3],고[1,4],고[1,1]+1.5,NextBarSdate,NextBarStime,고[1,1]+1.5); TL_SetSize(TL5,1); TL_SetColor(TL5,Magenta); } If 고[1,1] < HH[hiBar] Then { 고[1,1] = HH[hiBar]; 고[1,2] = Index - hiBar; 고[1,3] = sDate[hiBar]; 고[1,4] = sTime[hiBar]; hiBar = -1; loBar = -1; TL_SetEnd(TL,고[1,3],고[1,4],고[1,1]); TL_SetBegin(TL1,고[1,3],고[1,4],고[1,1]+0.5); TL_SetBegin(TL3,고[1,3],고[1,4],고[1,1]+1); TL_SetBegin(TL5,고[1,3],고[1,4],고[1,1]+1.5); TL_SetEnd(TL2,고[1,3],고[1,4],저[1,1]-0.5); TL_SetEnd(TL4,고[1,3],고[1,4],저[1,1]-1); TL_SetEnd(TL6,고[1,3],고[1,4],저[1,1]-1.5); } TL_SetEnd(TL1,NextBarSdate,NextBarStime,고[1,1]+0.5); TL_SetEnd(TL3,NextBarSdate,NextBarStime,고[1,1]+1); TL_SetEnd(TL5,NextBarSdate,NextBarStime,고[1,1]+1.5); 최종꼭지점 = "고점"; Plot1(고[1,1]); NoPlot(2); } If 처리구분 == "저점처리" Then { If 최종꼭지점 == "고점" Then { For j = 10 DownTo 2 { For jj = 1 To 4 { 저[j,jj] = 저[j-1,jj]; } } 저[1,1] = LL[loBar]; 저[1,2] = Index - loBar; 저[1,3] = sDate[loBar]; 저[1,4] = sTime[loBar]; hiBar = -1; loBar = -1; TL = TL_New(고[1,3],고[1,4],고[1,1],저[1,3],저[1,4],저[1,1]); TL_SetSize(TL,1); TL_SetColor(TL,Blue); TL2 = TL_New_Self(저[1,3],저[1,4],저[1,1]-0.5,NextBarSdate,NextBarStime,저[1,1]-0.5); TL_SetSize(TL2,1); TL_SetColor(TL2,Green); TL4 = TL_New_Self(저[1,3],저[1,4],저[1,1]-1,NextBarSdate,NextBarStime,저[1,1]-1); TL_SetSize(TL4,1); TL_SetColor(TL4,Blue); TL6 = TL_New_Self(저[1,3],저[1,4],저[1,1]-1.5,NextBarSdate,NextBarStime,저[1,1]-1.5); TL_SetSize(TL6,1); TL_SetColor(TL6,Green); } If 저[1,1] > LL[loBar] Then { 저[1,1] = LL[loBar]; 저[1,2] = Index - loBar; 저[1,3] = sDate[loBar]; 저[1,4] = sTime[loBar]; hiBar = -1; loBar = -1; TL_SetEnd(TL,저[1,3],저[1,4],저[1,1]); TL_SetEnd(TL1,저[1,3],저[1,4],고[1,1]+0.5); TL_SetEnd(TL3,저[1,3],저[1,4],고[1,1]+1); TL_SetEnd(TL5,저[1,3],저[1,4],고[1,1]+1.5); TL_SetBegin(TL2,저[1,3],저[1,4],저[1,1]-0.5); TL_SetBegin(TL4,저[1,3],저[1,4],저[1,1]-1); TL_SetBegin(TL6,저[1,3],저[1,4],저[1,1]-1.5); } 최종꼭지점 = "저점"; TL_SetEnd(TL2,NextBarSdate,NextBarStime,저[1,1]-0.5); TL_SetEnd(TL4,NextBarSdate,NextBarStime,저[1,1]-1); TL_SetEnd(TL6,NextBarSdate,NextBarStime,저[1,1]-1.5); Plot2(저[1,1]); NoPlot(1); } 저가라인 끝을 고점에서 다음 저점까지 연장. 고가라인은 다음 고점까지 연장. 감사합니다.
프로필 이미지
고성
2023-11-27
878
글번호 174368
지표
답변완료

수고하십니다

1) (일) 거래대금 500 억 이상 종목을 찾고 싶습니다 2) 주가 등락률 (일) 0봉전 (중) 시가대비 0봉전 종가 등락률 10% 이상 종목을 찾고싶습니다 1. 2 따로 따로 수식 부탁 드립니다 수고하세요. 항상 감사드립니다~~
프로필 이미지
쌍둥이
2023-11-27
888
글번호 174361
종목검색
답변완료

수식작성 부탁드립니다

아래 조건에 대한 수식을 부탁드립니다. 국내 선물 10분봉 기준 1.매수 : 분봉이 20일선 위에 있으며 macd 상승돌파시 청산 : 20일선 하락돌파 또는 macd 하락돌파시 2.매도 : 분봉이 20일선 아래 있으며 macd 하락돌파시 청산 : 20일선 상승돌파 또는 macd 상승돌파시 감사합니다.
프로필 이미지
시나리오
2023-11-27
798
글번호 174355
시스템
답변완료

문의드립니다

오늘 "매수5"라는 진입명으로 진입이 있었다면 추가매수를 여기서 하겠다 이렇게 표현할때 -오늘 "매수5"라는 진입명으로 진입이 있었다면- 이 부분을 수식으로 만들어 주시면 감사하겠습니다.
프로필 이미지
시고르시고르
2023-11-27
962
글번호 174354
시스템
답변완료

Super trend 수식 문의 드립니다.

항상 많은 도움 감사드립니다. 많은 수의 트레이더들이 사용하는 supertrend는 버전이 상당히 많은데요. 이 버전은 아직 Q&A에 올라와 있는것을 찾지 못해 수식 변경 문의 드립니다. study("Supertrend", overlay = true, format=format.price, precision=2, resolution="") Periods = input(title="ATR Period", type=input.integer, defval=10) src = input(hl2, title="Source") Multiplier = input(title="ATR Multiplier", type=input.float, step=0.1, defval=3.0) changeATR= input(title="Change ATR Calculation Method ?", type=input.bool, defval=true) showsignals = input(title="Show Buy/Sell Signals ?", type=input.bool, defval=true) highlighting = input(title="Highlighter On/Off ?", type=input.bool, defval=true) atr2 = sma(tr, Periods) atr= changeATR ? atr(Periods) : atr2 up=src-(Multiplier*atr) up1 = nz(up[1],up) up := close[1] > up1 ? max(up,up1) : up dn=src+(Multiplier*atr) dn1 = nz(dn[1], dn) dn := close[1] < dn1 ? min(dn, dn1) : dn trend = 1 trend := nz(trend[1], trend) trend := trend == -1 and close > dn1 ? 1 : trend == 1 and close < up1 ? -1 : trend upPlot = plot(trend == 1 ? up : na, title="Up Trend", style=plot.style_linebr, linewidth=2, color=color.green) buySignal = trend == 1 and trend[1] == -1 plotshape(buySignal ? up : na, title="UpTrend Begins", location=location.absolute, style=shape.circle, size=size.tiny, color=color.green, transp=0) plotshape(buySignal and showsignals ? up : na, title="Buy", text="Buy", location=location.absolute, style=shape.labelup, size=size.tiny, color=color.green, textcolor=color.white, transp=0) dnPlot = plot(trend == 1 ? na : dn, title="Down Trend", style=plot.style_linebr, linewidth=2, color=color.red) sellSignal = trend == -1 and trend[1] == 1 plotshape(sellSignal ? dn : na, title="DownTrend Begins", location=location.absolute, style=shape.circle, size=size.tiny, color=color.red, transp=0) plotshape(sellSignal and showsignals ? dn : na, title="Sell", text="Sell", location=location.absolute, style=shape.labeldown, size=size.tiny, color=color.red, textcolor=color.white, transp=0) mPlot = plot(ohlc4, title="", style=plot.style_circles, linewidth=0) longFillColor = highlighting ? (trend == 1 ? color.green : color.white) : color.white shortFillColor = highlighting ? (trend == -1 ? color.red : color.white) : color.white fill(mPlot, upPlot, title="UpTrend Highligter", color=longFillColor) fill(mPlot, dnPlot, title="DownTrend Highligter", color=shortFillColor) alertcondition(buySignal, title="SuperTrend Buy", message="SuperTrend Buy!") alertcondition(sellSignal, title="SuperTrend Sell", message="SuperTrend Sell!") changeCond = trend != trend[1] alertcondition(changeCond, title="SuperTrend Direction Change", message="SuperTrend has changed direction!")
프로필 이미지
비정성시
2023-11-27
1203
글번호 174335
지표
답변완료

문의드립니다

키움수식인데 예스로 변환 부탁드립니다 (valuewhen(1, C>C(1), C)+ valuewhen(2, C>C(1), C)+ valuewhen(3, C>C(1), C))/3
프로필 이미지
삼손감자
2023-11-27
738
글번호 174332
지표
답변완료

문의드립니다.

수고 많으십니다. [전략개요] 시가를 상향 돌파하면 매수, 하향 돌파하면 매도하는 돌파 매매와 시가를 지지하면 매수, 저항 받으면 매도하는 지지저항 매매를 합친 전략입니다. [전제조건] 1. 시가기준 50틱 이상 시가 위나 아래로 반드시 1번은 갔다가 내려오거나 올라가서 1. 시가에 근접하거나 2. 시가를 완전히 돌파할 때만 작동해야 합니다. 2. 1번 50틱 변동성이 생긴후 되돌림이 나와 진입이 1회 되었다면 그다음 다시 50틱 이상 위나 아래로 변동성이 생기기 전까진 진입 신호가 나오지 않아야 합니다. [진입/손청조건] 1. [시가에서 50틱 이상 빠졌다가 올라와서] 시가 바로 3틱 아래에서 1계약, 시가에서 추가로 1계약, 총 2계약을 "매도"진입합니다. 만일 시가를 뚫고 10틱을 올라가 버리면 모두 손청합니다. 2. [시가에서 50틱 이상 빠졌다가 올라와서] 시가를 돌파해 15틱 올라가면 1계약, 25틱 올라가면 추가로 1계약 더 "매수"합니다. 만일 이후 익절되지 못하고 되돌림이 나와 시가를 뚫고 5틱 빠져버리면 모두 손청합니다. [익절조건] 진입가에서 30틱 이상 수익나면 1계약 먼저 익절 후 나머지 1계약은 진입가에서 30틱 이상 올라간 시점부터 최고점대비 15틱이 밀리면 익절합니다. ★ 위의 [진입/손청조건]과 반대로도 적용되게 수식 부탁드립니다. 덕분에 실력이 조금씩 늘고 있습니다. 노고에 늘 진심으로 감사드립니다.
프로필 이미지
카르마다
2023-11-26
984
글번호 174330
시스템
답변완료

캔들검색

*안녕하세요 해외선물 5분봉에서 22시 35분 캔들을 노랑으로 구분(검색 혹은 강조)가능 수식 부탁드립니다.
프로필 이미지
루루
2023-11-26
891
글번호 174329
검색

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

프로필 이미지
파워
2023-11-26
1213
글번호 174328
지표
답변완료

CT를 YT로 변환 요청합니다.

1 Input: len(10), len1(70), len2(0.37), s1(2.7), method(1), delay(8) If method=1 Then Var1=atr(len) Var2=atr(len1) Elseif method=2 Then Var20=high-low Var1=mov(Var20,len,s) Var2=mov(Var20,len1,s) End If Cond1=tdate=exitdate(1) And position(1)=1 Cond2=tdate=exitdate(1) And position(1)=-1 If Var1<var2 Then Var10=1 Else Var10=0 End If If hhv(1,Var10,delay)=1 Then If ttime<1500 Then If Cond1=False And high<opend+(highd(1)-lowd(1))*len2 Then Call buy("매수",Atstop,Def,opend+(highd(1)-lowd(1))*len2) End If IfCond2=False And low>opend-(highd(1)-lowd(1))*len2 Then Call sell("매도",Atstop,Def,opend-(highd(1)-lowd(1))*len2) End If If Cond1=False And high>opend+(highd(1)-lowd(1))*len2 Then Call buy("매수1",Atstop,Def,hhv(1,high,delay)) End If If Cond2=False And low<opend-(highd(1)-lowd(1))*len2 Then Callsell("매도1",Atstop,Def,llv(1,low,delay)) End If End if End If If position<>0then Call exitlong("매수청산",Atstop,hhv(1,high,barnumsinceentry+1)-atr(20)*s1) Call exitshort("매도청산",Atstop,llv(1,low,barnumsinceentry+1)+atr(20)*s1) End If 2 Input: len(40), len1(1), len2(30), multi(5), delay(5), s1(0.37), s2(2.7) Var50=bbandtop(close,len,len1,s) Var49=bbandbot(close,len,len1,s) Var1=var50-var49 Var2=high-low Var3=mov(Var2,len2,s)*multi Cond1= tdate=exitdate(1) And position(1)=1 Cond2= tdate=exitdate(1) And position(1)=-1 If Var1<var3 Then Var10=1 Else Var10=0 End If If hhv(1,Var10,delay)=1 then If ttime<1500 Then If Cond1=False And bbandmid(close,len,len1,s)>bbandmid(close,len,len1,s,1) Then Call buy("매수",Atstop,Def,opend+(highd(1)-lowd(1))*s1) End If If Cond2=False And bbandmid(close,len,len1,s)<bbandmid(close,len,len1,s,1) Then Call sell("매도",Atstop,Def,opend-(highd(1)-lowd(1))*s1) End If End If End If If position<>0 Then Call exitlong("매수청산",Atstop,hhv(1,high,barnumsinceentry+1)-atr(20)*s2) Call exitshort("매도청산",Atstop,llv(1,low,barnumsinceentry+1)+atr(20)*s2) End If 3(그물망) Input :len(20), cont(10), stepp(2), multi(2), delay(5), s1(0.37), s2(2.7) Var50=mov(close,len,s) Var49=mov(close,len,s) For i = 1 To cont If Var50<mov(close,len+stepp*i,s) Then Var50=mov(close,len+stepp*i,s) End If If Var49>mov(close,len+stepp*i,s) Then Var49=mov(close,len+stepp*i,s) End If Next Var1=var50-var49 Var2=high-low Var3=mov(Var2,len,s)*multi Cond1= tdate=exitdate(1) And position(1)=1 Cond2= tdate=exitdate(1) And position(1)=-1 If Var1<var3 Then Var10=1 Else Var10=0 End If If hhv(1,Var10,delay)=1 And hhb(1,Var10,delay)=delay-1 Then If ttime<1500 Then If Cond1=False Then Call buy("매수",Atstop,Def,opend+(highd(1)-lowd(1))*s1) End If If Cond2=False Then Call sell("매도",Atstop,Def,opend-(highd(1)-lowd(1))*s1) End If End If End If If position<>0 Then Call exitlong("매수청산",Atstop,hhv(1,high,barnumsinceentry+1)-atr(20)*s2) Call exitshort("매도청산",Atstop,llv(1,low,barnumsinceentry+1)+atr(20)*s2) End If 4(adx) Input: len(21), level(30), delay(2), s1(0.37), s2(2.7) Var1=adx(len) Cond1= tdate=exitdate(1) And position(1)=1 Cond2= tdate=exitdate(1) And position(1)=-1 If Var1<level And Var1>var1(delay) Then If ttime<1500 Then If Cond1=False Then Call buy("매수",Atstop,Def,opend+(highd(1)-lowd(1))*s1) End If If Cond2=False Then Call sell("매도",Atstop,Def,opend-(highd(1)-lowd(1))*s1) End If End If End If If position<>0 Then Call exitlong("매수청산",Atstop,hhv(1,high,barnumsinceentry+1)-atr(20)*s2) Call exitshort("매도청산",Atstop,llv(1,low,barnumsinceentry+1)+atr(20)*s2) End If 5(ID) Input: delay(9), s1(0.2), s2(2.7), s3(0.49) Var1=high-low Var2=mov(Var1,delay,s) Cond12=False If ttime<1500 Then Cond12=high(1)>=high And low(1)<=low And tdate=tdate(1) End If If Cond12=True Then Var10=1 Else Var10=0 End If Cond1= tdate=exitdate(1) And position(1)=1 Cond2= tdate=exitdate(1) And position(1)=-1 If hhv(1,Var10,delay)=1 And tdate(hhb(1,Var10,delay))= tdate Then If ttime<1500 And Cond1=False Then If opend+(highd(1)-lowd(1))*s1<close Then Call buy("매수",Atstop,Def,high+var2*s3) End If End If If ttime<1500 And Cond2=False Then If opend-(highd(1)-lowd(1))*s1>close Then Call sell("매도",Atstop,Def,low-var2*s3) End If End If End If If position<>0 Then Call exitlong("매수청산",Atstop,hhv(1,high,barnumsinceentry+1)-atr(20)*s2) Call exitshort("매도청산",Atstop,llv(1,low,barnumsinceentry+1)+atr(20)*s2) End If 6(NR) Var1=high-low Cond11=False Cond11= Var1=llv(1,Var1,len) And ttime<1500 Cond1= tdate=exitdate(1) And position(1)=1 Cond2= tdate=exitdate(1) And position(1)=-1 If ttime<1500 Then If Cond1=False Then If Cond11=True And Cond11(1)=False Then If opend+(highd(1)-lowd(1))*s1<close Then Call buy("매수",Atstop,Def,high+var1*s3) End If End If End If If Cond2=False Then If Cond11=True And Cond11(1)=False Then If opend-(highd(1)-lowd(1))*s1>close Then Call sell("매도",Atstop,Def,low-var1*s3) End If End If End If End If If position<>0 Then Call exitlong("매수청산",Atstop,hhv(1,high,barnumsinceentry+1)-atr(20)*s2) Call exitshort("매도청산",Atstop,llv(1,low,barnumsinceentry+1)+atr(20)*s2) End If 7(++) Input: s1(0.37), s2(2.7) 'NR2 If highd(1)-lowd(1)=min(highd(1)-lowd(1),highd(2)-lowd(2)) Then Cond11=True Else Cond11=False End If 'ID,ID2 If (highd(2)>=highd(1) And lowd(2)<=lowd(1)) _ Or (highd(3)>=highd(2) And lowd(3)<=lowd(2) And _ highd(2)>=highd(1) And lowd(2)<=lowd(1))Then Cond12=True Else Cond12=False End If Cond1= tdate=exitdate(1) And position(1)=1 Cond2= tdate=exitdate(1) And position(1)=-1 If ttime<1500 Then If Cond1=False Then If Cond11=True Or Cond12=True Then Call buy("매수",Atstop,Def,opend+(highd(1)-lowd(1))*s1) end if End If If Cond2=False Then If Cond11=True Or Cond12=True Then Call sell("매도",Atstop,Def,opend-(highd(1)-lowd(1))*s1) End If End If End If If position<>0 Then Call exitlong("매수청산",Atstop,hhv(1,high,barnumsinceentry+1)-atr(20)*s2) Call exitshort("매도청산",Atstop,llv(1,low,barnumsinceentry+1)+atr(20)*s2) End If 항상 감사드립니다.
프로필 이미지
마녀58
2023-11-26
1645
글번호 174325
시스템