커뮤니티

예스랭귀지 Q&A

글쓰기
답변완료

함수요청

안녕하세요? 아래의 전략에 대해 스크립트 작성 요청드립니다. 국내선물 1분봉으로 일중거래를 하고자 합니다. 1. data2 전영업일 종가 > data1의 시가 > data1의 전영업일 종가이면 당일 시가선 기준으로 2번 연속 돌파되면 익봉 시가 매수 당일 시가선 기준으로 2번 연속 이탈되면 익봉 시가 매수청산 당일 시가선 기준으로 4번 연속 돌파되면 익봉 시가 매수청산 100ma 돌파 및 이탈시 익봉 시가 매수청산 2. data2 전영업일 종가 < data1의 시가 < data1의 전영업일 종가이면 당일 시가선 기준으로 2번 연속 이탈되면 익봉 시가 매도 당일 시가선 기준으로 2번 연속 돌파되면 익봉 시가 매도청산 당일 시가선 기준으로 4번 연속 이탈되면 익봉 시가 매도청산 100ma 돌파 및 이탈시 익봉 시가 매도청산 3. data1의 시가 > data2 전영업일 종가 > data1의 전영업일 종가이면 당일 시가선 기준으로 2번 연속 돌파되면 익봉 시가 매도 당일 시가선 기준으로 2번 연속 이탈되면 익봉 시가 매도청산 당일 시가선 기준으로 4번 연속 돌파되면 익봉 시가 매도청산 100ma 돌파 및 이탈시 익봉 시가 매도청산 4.data1의 시가 < data2 전영업일 종가 < data1의 전영업일 종가이면 당일 시가선 기준으로 2번 연속 이탈되면 익봉 시가 매수 당일 시가선 기준으로 2번 연속 돌파되면 익봉 시가 매수청산 당일 시가선 기준으로 4번 연속 이탈되면 익봉 시가 매수청산 100ma 돌파 및 이탈시 익봉 시가 매수청산 아침에 시가가 결정되면 1~4번 가운데 1개의 시나리오를 적용할 것입니다. 청산조건은 or이며 15:20에는 강제청산입니다.
프로필 이미지
흰둥이아빠
2023-02-02
579
글번호 165934
시스템
답변완료

지표문의

1.누적upvol ,누적downvol 5분봉에서 누적upvol-누적downvol 가감해서 매시간마다누적 표시 되게끔 작성 좀해 주세요 9시에서 10시 그다음 초기화 하고 10시에서 11시 매시간 마다 오후4시 까지 2.그럼 즐거운 하루 되세요
프로필 이미지
성공예견
2023-02-02
647
글번호 165933
지표
답변완료

최고가발생종목검색

일봉에서 10봉이내에 5봉최고가가 발생한 종목 검색 부탁드립니다
프로필 이미지
팔보채
2023-02-02
620
글번호 165932
종목검색
답변완료

문의 드립니다.

아래는 게시판 80595 질답 내용입니다. 180분 캔들을 매매에 사용중인데 180분봉 완성시 그다음 시가 청산후 30분후에 진입신호가 적용되질 않습니다. 보완해야할 것이 있는지 문의 드립니다. 1 현재 진입이 완성봉에서 값이 셋팅되서 다음봉 미완성시에 발생하는 내용입니다. atstop,atlimit으로 봉완성시 값이 셋팅이 되면 다음봉 미완성시에 신호발생을 제어할 수 없습니다. 또한 if문이 봉완성기준입니다. 미완성시에 청산시점에서 30분이후로 지정이 불가능합니다. 문의하신 내용이면 시가에 청산이 발생하면 봉단위로 30분이후 봉부터 진입이 발생하게만 작성이 됩니다. 올리신 식이 봉완성시 진입이 있으면 다음봉 시가에서 청산을 모두 하므로 봉완성시 진입이 있으면 다음진입은 30분봉 이상 경과한 다음봉부터 신호가 발생하게 됩니다. input : starttime(160000),endtime(80000),n(30); var : Tcond(false),hh(0),h1(0),ll(0),l1(0); var : s1(0),d1(0),tm(0),trade(False),tt(0); IF Endtime > starttime Then SetStopEndofday(Endtime); Else { if sDate != sDate[1] Then SetStopEndofday(Endtime); } if (sdate != sdate[1] and stime >= endtime) or (sdate == sdate[1] and stime >= endtime and stime[1] < endtime) then { Tcond = false; } if (sdate != sdate[1] and stime >= starttime) or (sdate == sdate[1] and stime >= starttime and stime[1] < starttime) then { Tcond = true; hh = h; ll = l; h1 = hh[1]; l1 = ll[1]; IF Endtime <= starttime Then { SetStopEndofday(0); } } if Bdate != Bdate[1] Then { S1 = TimeToMinutes(stime); D1 = sdate; Trade = true; } if D1 > 0 then { if NextBarSdate == D1 Then TM = TimeToMinutes(NextBarStime)-S1; Else TM = TimeToMinutes(NextBarStime)+1440-S1; } input : 익절틱수(0),손절틱수(0); if MarketPosition != 0 Then { Trade = False; TT = TM; } Else { Trade = true; } if Trade == False and TM >= TT+30 Then Trade = true; if NextBarSdate != sDate and Trade == true Then { if NextBarOpen != C Then { Buy("b",AtStop,NextBarOpen+PriceScale*5); } } ExitLong("bx",AtMarket); if NextBarOpen != C and Trade == true Then { Buy("b1",AtStop,NextBarOpen+PriceScale*5); } ExitLong("bx1",AtMarket); if NextBarOpen != C and Trade == true Then { Buy("b2",AtStop,NextBarOpen+PriceScale*5); } ExitLong("bx2",AtMarket); if NextBarOpen != C and Trade == true Then { Buy("b3",AtStop,NextBarOpen+PriceScale*5); } ExitLong("bx3",AtMarket); if NextBarOpen != C and Trade == true Then { Buy("b4",AtStop,NextBarOpen+PriceScale*5); } ExitLong("bx4",AtMarket); if NextBarOpen != C and Trade == true Then { Buy("b5",AtStop,NextBarOpen+PriceScale*5); } ExitLong("bx5",AtMarket); if NextBarOpen == C and Trade == true Then { Buy("b6",AtStop,NextBarOpen+PriceScale*5); } ExitLong("bx6",AtMarket); if NextBarOpen == C and Trade == true Then { Buy("b7",AtStop,NextBarOpen+PriceScale*5); } ExitLong("bx7",AtMarket); if NextBarOpen == C and Trade == true Then { Buy("b8",AtStop,NextBarOpen+PriceScale*5); } ExitLong("bx8",AtMarket); if NextBarOpen == C and Trade == true Then { Buy("b9",AtStop,NextBarOpen+PriceScale*5); } ExitLong("bx9",AtMarket); if NextBarOpen == C and Trade == true Then { Buy("b10",AtStop,NextBarOpen+PriceScale*5); } ExitLong("bx10",AtMarket); if NextBarOpen == C and Trade == true Then { Buy("b11",AtStop,NextBarOpen+PriceScale*5); } ExitLong("bx11",AtMarket); if NextBarSdate != sDate and Trade == true Then { if NextBarOpen != C Then { Sell("s",AtStop,NextBarOpen-PriceScale*5); } } ExitShort("sx",AtMarket); if NextBarOpen != C and Trade == true Then { Sell("s1",AtStop,NextBarOpen-PriceScale*5); } ExitShort("sx1",AtMarket); if NextBarOpen != C and Trade == true Then { Sell("s2",AtStop,NextBarOpen-PriceScale*5); } ExitShort("sx2",AtMarket); if NextBarOpen != C and Trade == true Then { Sell("s3",AtStop,NextBarOpen-PriceScale*5); } ExitShort("sx3",AtMarket); if NextBarOpen != C and Trade == true Then { Sell("s4",AtStop,NextBarOpen-PriceScale*5); } ExitShort("sx4",AtMarket); if NextBarOpen != C and Trade == true Then { Sell("s5",AtStop,NextBarOpen-PriceScale*5); } ExitShort("sx5",AtMarket); if NextBarOpen == C and Trade == true Then { Sell("s6",AtStop,NextBarOpen-PriceScale*5); } ExitShort("sx6",AtMarket); if NextBarOpen == C and Trade == true Then { Sell("s7",AtStop,NextBarOpen-PriceScale*5); } ExitShort("sx7",AtMarket); if NextBarOpen == C and Trade == true Then { Sell("s8",AtStop,NextBarOpen-PriceScale*5); } ExitShort("sx8",AtMarket); if NextBarOpen == C and Trade == true Then { Sell("s9",AtStop,NextBarOpen-PriceScale*5); } ExitShort("sx9",AtMarket); if NextBarOpen == C and Trade == true Then { Sell("s10",AtStop,NextBarOpen-PriceScale*5); } ExitShort("sx10",AtMarket); if NextBarOpen == C and Trade == true Then { Sell("s11",AtStop,NextBarOpen-PriceScale*5); } ExitShort("sx11",AtMarket); SetStopProfittarget(PriceScale*익절틱수,PointStop); SetStopLoss(PriceScale*손절틱수,PointStop); ------------------ input : starttime(160000),endtime(80000),n(30); var : Tcond(false),hh(0),h1(0),ll(0),l1(0); var : s1(0),d1(0),tm(0),trade(False),tt(0); IF Endtime > starttime Then SetStopEndofday(Endtime); Else { if sDate != sDate[1] Then SetStopEndofday(Endtime); } if (sdate != sdate[1] and stime >= endtime) or (sdate == sdate[1] and stime >= endtime and stime[1] < endtime) then { Tcond = false; } if (sdate != sdate[1] and stime >= starttime) or (sdate == sdate[1] and stime >= starttime and stime[1] < starttime) then { Tcond = true; hh = h; ll = l; h1 = hh[1]; l1 = ll[1]; IF Endtime <= starttime Then { SetStopEndofday(0); } } if Bdate != Bdate[1] Then { S1 = TimeToMinutes(stime); D1 = sdate; Trade = true; } if D1 > 0 then { if NextBarSdate == D1 Then TM = TimeToMinutes(NextBarStime)-S1; Else TM = TimeToMinutes(NextBarStime)+1440-S1; } input : 익절틱수(0),손절틱수(0); if MarketPosition != 0 Then { Trade = False; TT = TM; } Else { Trade = true; } if Trade == False and TM >= TT+30 Then Trade = true; if NextBarSdate != sDate and Trade == true Then { if NextBarOpen != C Then { Buy("b",AtStop,NextBarOpen+PriceScale*5); } } ExitLong("bx",AtMarket); if NextBarOpen != C and Trade == true Then { Buy("b1",AtStop,NextBarOpen+PriceScale*5); } ExitLong("bx1",AtMarket); if NextBarOpen != C and Trade == true Then { Buy("b2",AtStop,NextBarOpen+PriceScale*5); } ExitLong("bx2",AtMarket); if NextBarOpen != C and Trade == true Then { Buy("b3",AtStop,NextBarOpen+PriceScale*5); } ExitLong("bx3",AtMarket); if NextBarOpen != C and Trade == true Then { Buy("b4",AtStop,NextBarOpen+PriceScale*5); } ExitLong("bx4",AtMarket); if NextBarOpen != C and Trade == true Then { Buy("b5",AtStop,NextBarOpen+PriceScale*5); } ExitLong("bx5",AtMarket); if NextBarOpen == C and Trade == true Then { Buy("b6",AtStop,NextBarOpen+PriceScale*5); } ExitLong("bx6",AtMarket); if NextBarOpen == C and Trade == true Then { Buy("b7",AtStop,NextBarOpen+PriceScale*5); } ExitLong("bx7",AtMarket); if NextBarOpen == C and Trade == true Then { Buy("b8",AtStop,NextBarOpen+PriceScale*5); } ExitLong("bx8",AtMarket); if NextBarOpen == C and Trade == true Then { Buy("b9",AtStop,NextBarOpen+PriceScale*5); } ExitLong("bx9",AtMarket); if NextBarOpen == C and Trade == true Then { Buy("b10",AtStop,NextBarOpen+PriceScale*5); } ExitLong("bx10",AtMarket); if NextBarOpen == C and Trade == true Then { Buy("b11",AtStop,NextBarOpen+PriceScale*5); } ExitLong("bx11",AtMarket); if NextBarSdate != sDate and Trade == true Then { if NextBarOpen != C Then { Sell("s",AtStop,NextBarOpen-PriceScale*5); } } ExitShort("sx",AtMarket); if NextBarOpen != C and Trade == true Then { Sell("s1",AtStop,NextBarOpen-PriceScale*5); } ExitShort("sx1",AtMarket); if NextBarOpen != C and Trade == true Then { Sell("s2",AtStop,NextBarOpen-PriceScale*5); } ExitShort("sx2",AtMarket); if NextBarOpen != C and Trade == true Then { Sell("s3",AtStop,NextBarOpen-PriceScale*5); } ExitShort("sx3",AtMarket); if NextBarOpen != C and Trade == true Then { Sell("s4",AtStop,NextBarOpen-PriceScale*5); } ExitShort("sx4",AtMarket); if NextBarOpen != C and Trade == true Then { Sell("s5",AtStop,NextBarOpen-PriceScale*5); } ExitShort("sx5",AtMarket); if NextBarOpen == C and Trade == true Then { Sell("s6",AtStop,NextBarOpen-PriceScale*5); } ExitShort("sx6",AtMarket); if NextBarOpen == C and Trade == true Then { Sell("s7",AtStop,NextBarOpen-PriceScale*5); } ExitShort("sx7",AtMarket); if NextBarOpen == C and Trade == true Then { Sell("s8",AtStop,NextBarOpen-PriceScale*5); } ExitShort("sx8",AtMarket); if NextBarOpen == C and Trade == true Then { Sell("s9",AtStop,NextBarOpen-PriceScale*5); } ExitShort("sx9",AtMarket); if NextBarOpen == C and Trade == true Then { Sell("s10",AtStop,NextBarOpen-PriceScale*5); } ExitShort("sx10",AtMarket); if NextBarOpen == C and Trade == true Then { Sell("s11",AtStop,NextBarOpen-PriceScale*5); } ExitShort("sx11",AtMarket); SetStopProfittarget(PriceScale*익절틱수,PointStop); SetStopLoss(PriceScale*손절틱수,PointStop); 위 수식어의 캔들이 180분봉으로 가정했을때 시가청산후 진입신호를 매수는 동일상품의 캔들 1분봉 골든(5,20) 3회시 주문, 청산은 180분봉 완성후 시가청산 매도는 동일상품의 캔들 1분봉 데드(20,5) 3회시 주문, 청산은 180분봉 완성후 시가청산 으로 된 수식어를 추가로 부탁드리고자 합니다.
프로필 이미지
푸른
2023-02-02
778
글번호 165931
시스템
답변완료

수식 변환 요청드립니다

아래는 트레이딩 뷰에서 Mansfield Relative Strength지표입니다. 변환 부탁드립니다 //@version=3 // Use this indicator to compare how security is performing in compare with prefered index (SPX by default). // > 0 outperforming // < 0 underperforming // Works best for weekly, but can be applied to monthly and daily charts. It will be rather useless to use it in smaller timeframes // Apply it to SPX, industry index, sector index or other security in similar sector // UPDAT E 1: Added sector and industry as optional params. Leave them same as index if you don't want to use them study("Mansfield Relative Strength indicator") index = input(title="Index", type=symbol, defval="SP:SPX") sector = input(title="Sector (optional)", type=symbol, defval="SP:SPX") industry = input(title="Industry (optional)", type=symbol, defval="SP:SPX") ma_type = input(title="Which moving average to use?", defval="SMA", options=["SMA", "WMA", "EMA"]) len_daily = input(title="MA length for Daily", defval=200) len_weekly = input(title="MA length for Weekly", defval=52) len_monthly = input(title="MA length for Monthly", defval=10) len_other = input(title="MA length for all other periods", defval=52) val = close len = period == "W" ? len_weekly : (period == "D" ? len_daily : (period == "M" ? len_monthly : len_other)) ma_func(x, length) => ma_type == "WMA" ? wma(x, length) : (ma_type == "SMA" ? sma(x, length) : ema(x, length)) calc_mrs_func(x, ind, length) => ((x / security(ind, period, x)) / ma_func((x / security(ind, period, x)), length) - 1) * 10 mrs_index = calc_mrs_func(val, index, len) mrs_sector = calc_mrs_func(val, sector, len) mrs_industry = calc_mrs_func(val, industry, len) c = sign(mrs_index) + sign(mrs_sector) + sign(mrs_industry) bgcolor(c == 3 ? color(green, 80) : c == 2 ? color(green, 75) : c == 1 ? color(green, 70) : c == -1 ? color(red, 70) : c == -2 ? color(red, 75) : c == -3 ? color(red, 80) : gray) plot(mrs_index, linewidth=3, title="MRS index") plot(mrs_sector != mrs_index ? mrs_sector : na, linewidth=2, title="MRS sector") plot(mrs_industry != mrs_index ? mrs_industry : na, linewidth=1, title="MRS industry") hline(price=0, linestyle=dashed, title="Zero baseline")
프로필 이미지
dqzero
2023-02-02
905
글번호 165930
지표
답변완료

수식요청합니다.

지그재그차트에서 상승변곡점(상승후 하락시 꼭지점)을 돌파하는 종목검색식 요청합니다. (첨부자료) Input:전환비율(5); Var:j(0),jj(0),HH(0),LL(0),hiBar(0),loBar(0),최종꼭지점(""),처리구분(""),TL1(0),Text1(0),ADXV1(0); Array:고[10,4](0),저[10,4](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]*(1+(전환비율/100))<HH and hiBar==0; Condition2=고[1,1]*(1-(전환비율/100))>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; TL1=TL_New(저[1,3],저[1,4],저[1,1],고[1,3],고[1,4],고[1,1]); TL_SetSize(TL1,1); TL_SetColor(TL1,RED); } Else If 고[1,1]<HH[hiBar] Then//1번고점보다높은고가출현 { 고[1,1]=HH[hiBar]; 고[1,2]=Index-hiBar; 고[1,3]=sDate[hiBar]; 고[1,4]=sTime[hiBar]; hiBar=-1; loBar=-1; TL_SetEnd(TL1,고[1,3],고[1,4],고[1,1]); } 최종꼭지점="고점"; } 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; TL1=TL_New(고[1,3],고[1,4],고[1,1],저[1,3],저[1,4],저[1,1]); TL_SetSize(TL1,1); TL_SetColor(TL1,BLUE); } Else 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(TL1,저[1,3],저[1,4],저[1,1]); } 최종꼭지점="저점"; }
프로필 이미지
구호리
2023-02-01
1186
글번호 165929
종목검색
답변완료

지표 의뢰 드립니다

안녕하세요! 아래수식은 지난번에 만들어 주신 수식으로 현재 매매에 사용하고 있습니다! 다름이 아니라 아래 수식처럼 강세약세 패턴을 만들고 싶습니다! 예스에서 제공해주시는 파라볼릭 과 DMI 지표를 이용한 강세약세 패턴을 만들고 싶습니다! 강세약세 조건> 1. DMI+가 DMI-를 골든크로스 할때 파라볼릭이 상승시 = 두가지 조건이 일치할때만 강세패턴 2. DMI-가 DMI+를 데드크로스 할때 파라볼릭이 하락시 = 두가지 조건이 일치할때만 약세패턴 배경색은 제가 변경 할 수 있도록 부탁드립니다. 항상 노고에 감사드립니다. ----------------------------------------------- input : P1(5),P2(20); Var : mav1(0),mav2(0); mav1 = ma(c,P1); mav2 = ma(c,P2); if mav1 > mav2 Then{ plot1(99999999,"라인1"); plot2(0,"라인2"); } else{ plot1(0,"라인1"); plot2(99999999,"라인2"); } ------------------------------------------------ data2 ~ data11 의 콜과 풋의 옵션교차차트에서 동일가가 1번이라도 발생하면 같은시각 data1의 선물차트에 수평선이 발생하는 수식을 만들어 주시길 부탁드립니다!
프로필 이미지
qha71
2023-02-02
1059
글번호 165928
지표
답변완료

추세선 고저가라인

input : Period(35),선두께(2); Var:상승색(Red), 하락색(Blue); Var:j(0),T(0); Var: date11(0),date12(0),time11(0),time12(0),TL1(0),TL(0),tl9(0), date21(0),date22(0),time21(0),time22(0), date31(0),date32(0),time31(0),time32(0),tx(0),tx1(0),tl4(0); Array:HiVal[20](0),LoVal[20](0),HiBar[20](0),LoBar[20](0); Array:r[7](0),fr[7](0),TL2[7](0),TL3[7](0),TX2[7](0),TX3[7](0); Plot1(0); For j = 0 To 19 { HiBar[j] = HiBar[j] + 1; LoBar[j] = LoBar[j] + 1; } if crossup(c,highest(H,Period)[1]) Then T = 1; if CrossDown(c,Lowest(L,Period)[1]) Then T = -1; If T == -1 Then { If T[1] != -1 Then { For j = 18 DownTo 0 { LoVal[j+1] = LoVal[j]; LoBar[j+1] = LoBar[j]; } LoVal[0] = L; LoBar[0] = 0; date11 = date[HiBar[0]]; time11 = stime[HiBar[0]]; Value11 = HiVal[0]; date12 = date[LoBar[0]]; time12 = stime[LoBar[0]]; Value12 = LoVal[0]; TL_Delete(tl); TL = TL_New(sdate,stime,Value12,NextBarSdate,NextBarStime,NextBarOpen); TL1 = TL_New(date11,time11,Value11,date12,time12,Value12); TL_SetColor(TL1,하락색); date21 = date[HiBar[0]]; time21 = stime[HiBar[0]]; date22 = date[0]; time22 = stime[0]; for j = 0 to 6 { fr[j] = LoVal[1] + ((HiVal[0] - LoVal[1]) * r[j]); } } If LoVal[0] > L Then { LoVal[0] = L; LoBar[0] = 0; date12 = date[LoBar[0]]; time12 = stime[LoBar[0]]; Value12 = LoVal[0]; TL_SetEnd(TL1, date12,time12,Value12); date22 = date[0]; time22 = stime[0]; TL_Delete(tl); TL = TL_New(sdate,stime,Value12,NextBarSdate,NextBarStime,NextBarOpen); } } If T == 1 Then { If T[1] != 1 Then { For j = 18 DownTo 0 { HiVal[j+1] = HiVal[j]; HiBar[j+1] = HiBar[j]; } HiVal[0] = H; HiBar[0] = 0; date11 = date[LoBar[0]]; time11 = stime[LoBar[0]]; Value11 = LoVal[0]; date12 = date[HiBar[0]]; time12 = stime[HiBar[0]]; Value12 = HiVal[0]; TL_Delete(tl); TL = TL_New(sdate,stime,Value12,NextBarSdate,NextBarStime,NextBarOpen); TL1 = TL_New(date11,time11,Value11,date12,time12,Value12); TL_SetColor(TL1,상승색); date31 = date[LoBar[0]]; time31 = stime[LoBar[0]]; date32 = date[0]; time32 = stime[0]; for j = 0 to 5 { fr[j] = LoVal[0] + ((HiVal[1] - LoVal[0]) * r[j]); } } If HiVal[0] < H Then { HiVal[0] = H; HiBar[0] = 0; date12 = date[HiBar[0]]; time12 = stime[HiBar[0]]; Value12 = HiVal[0]; TL_SetEnd(TL1, date12,time12,Value12); date32 = date[0]; time32 = stime[0]; TL_Delete(tl); TL = TL_New(sdate,stime,Value12,NextBarSdate,NextBarStime,NextBarOpen); } } TL_SetSize(TL1,선두께); 당일 추세선의 고저가 갱신될 때마다 새로운 고저 수평라인 부탁드립니다.
프로필 이미지
고성
2023-02-01
1180
글번호 165927
지표
답변완료

식 부탁드립니다.

안녕하세요? 1)10.20,60 이평선이 정배열로 봉이 진행 중 2) 20이평선이 60이평선 위에 있는 동안 최초로 봉의 저점이 20이평선을 하회했을때 그 봉에서의 20이평선 가격을 sp라 하고 3) 그 뒤 60이평선이 상향 진행되어 sp 가격까지 도달된 이후 4) 두번째로 봉의 저점이 20이평선을 하회하게 되면 그 선에서 매도 1계약하고 그 때의 20이평선 가격을 sp2라 하고 5) 그 후 만일 봉의 저점이 60이평선을 하회하지 못한 채 봉의 저점이 20이평선 위로 올라가 최소한 10봉을 진행하게 되고 다시 60 이평선이 또 상향하여 sp2가격에 이르면 매도 1계약 6)...그 식으로 누적시켜 가다가 상황이 반전되어 그 다음엔 반대로 역배열이 되면 독같은 방식으로 일단 최초의 역sp에서 매도진입분 전량청산하고 매수 1계약, 그 다음 sp2에서 또 매수 1계약...하는 식 좀 부탁드립니다. 번번이 부탁드려 죄송합니다. 감사합니다.
프로필 이미지
음양조파
2023-02-01
808
글번호 165921
시스템
답변완료

문의드립니다

안녕하세요? 아래지표식을 챠트에적용시 첨부사진처럼 선으로적용시와 막대로적용시 봉1개의 색상차이가있습니다 막대그래프는 무시하여주시고 선그래프기준으로 사진에표시한것과 같이(선의기울기,양선음선에따라) 매수매도 시스템식을 구합니다 (신호발생은 사진과달리 1봉 다음 에 발생하도록 부탁드립니다 ) 감사드립니다 input : inp_Sensitivity(0.01),inp_HiLo_Lookback(5), inp_Slow_MA_Period(26),inp_Slow_MA_Method("EMA"), inp_Fast_MA_Period(12),inp_Fast_MA_Method("EMA"), inp_Signal_MA_Period(9),inp_Signal_MA_Method("EMA"); var : inp_Source(0),Hbarssince(-1),Lbarssince(-1),HiLo_Range(0),MA_Slow_Deviation(0); var : MA_Fast(0),MA_Slow(0),MA_Slow_ATR(0); Var : SumSqrt(0), Avgv(0), cnt(0),Histogrm(0),Main_Line(0),Signal_Line(0),Histogrm_Color(0); inp_Source = close; if inp_Fast_MA_Method == "SMA" Then MA_Fast = ma(inp_Source, inp_Fast_MA_Period); Else MA_Fast = ema(inp_Source, inp_Fast_MA_Period); if High == highest(H,inp_HiLo_Lookback) Then Hbarssince = 0; Else { if Hbarssince >= 0 Then Hbarssince = Hbarssince+1; } if low == Lowest(L,inp_HiLo_Lookback) Then Lbarssince = 0; Else { if Lbarssince >= 0 Then Lbarssince = Lbarssince+1; } HiLo_Range = abs(Hbarssince-Lbarssince) * PriceScale * 100000; if inp_Slow_MA_Method == "SMA" Then MA_Slow = ma(inp_Source, inp_Slow_MA_Period); Else MA_Slow = ema(inp_Source, inp_Slow_MA_Period); If inp_Slow_MA_Period != 0 Then { Avgv = MA_Slow; SumSqrt = 0; For cnt = 0 To inp_Slow_MA_Period - 1 Begin SumSqrt = SumSqrt + (C[cnt] - Avgv) * (C[cnt] - Avgv); End; MA_Slow_Deviation = SquareRoot(SumSqrt / inp_Slow_MA_Period); } Else MA_Slow_Deviation = 0; MA_Slow_ATR = atr(inp_Slow_MA_Period); Histogrm = MA_Slow_Deviation - MA_Slow_ATR; Main_Line = Histogrm; if inp_Signal_MA_Method == "SMA" Then Signal_Line = ma(inp_Source, inp_Signal_MA_Period); Else Signal_Line = ema(inp_Source, inp_Signal_MA_Period); Histogrm_Color = green; if MA_Fast >= MA_Fast[1] then { if HiLo_Range >= inp_Sensitivity then Histogrm_Color = Red; else Histogrm_Color = yellow; } else { if HiLo_Range >= inp_Sensitivity Then Histogrm_Color = Blue; else Histogrm_Color = White; } var : T(0); if Histogrm > Histogrm[1] Then T = 1; if Histogrm < Histogrm[1] Then T = -1; plot1(Histogrm,"BBMACD막대", Histogrm_Color);//속성에서 막대
프로필 이미지
새벽에
2023-02-01
832
글번호 165909
시스템