커뮤니티

예스랭귀지 Q&A

글쓰기

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

프로필 이미지
chochobo
2023-09-12
138
글번호 172367
지표
답변완료

수식 변환 부탁드립니다.

수식 변화 부탁드립니다. LL=Lowest(L(1),기간); HH=Highest(H(1),기간); NH=valuewhen(1,H>HH(1),H); 고상 = Valuewhen(1,barsSince(H>HH(1))==(기간 - k), NH); 저상 = Valuewhen(1,BarsSince(L<LL(1))==(기간 - K), HH); 조건 = 고상==저상; Valuewhen(1, 조건, 저상) 기간 5 k 3 항상 감사드립니다.
프로필 이미지
손느린주식
2023-09-11
484
글번호 172366
지표
답변완료

횡보장 진입 제한 관련 문의 드립니다.

항상 많은 도움 감사드립니다. 횡보장에서 같은 매수 조건이 자주 등장해서 계속 진입하는 경우에 손해가 많이 나서요. if A then buy "A매수"; if B then buy "B매수"; 이 조건을 사용할때 "A매수"로 30분 (지금 기준으로 앞 30분동안)동안에 진입한 적이 있으면 진입하지 않게히려면 어떻게 해야 할까요? 바꾸어서 말씀드리면 "A매수"로 진입한 이후 30분 동안은 "A매수"는 다시 진입하지 않았으면 합니다. 1분봉 거래 기준이기 때문에 거래 봉수로 30봉을 해도 괜찮습니다. 단 "A매수" 이후 30분 사이에 "B매수"의 조건이 나타난다면 "B매수"의 실행에는 관여하지 않고 "B매수"는 실행이 되는 조건문이여야 합니다. 모든 진입을 30분동안 제한하는 시스템식이 아니라 "A매수"만 30분 동안 재진입을 막는 시스템식 부탁드립니다.
프로필 이미지
비정성시
2023-09-11
491
글번호 172365
시스템

배움이 님에 의해서 삭제되었습니다.

프로필 이미지
배움이
2023-09-11
21
글번호 172364
시스템

천지고원 님에 의해서 삭제되었습니다.

프로필 이미지
천지고원
2023-09-11
1
글번호 172363
종목검색
답변완료

수식작성요청

1.분봉챠트에 지수이동평균선을 표시하고 특정조건의 종목검색식을 만들어 보았으나 내부함수의 입력값이 2개 필요합니다 선언되지않은 이름 nPredayclose가 사용되었습니다며 검증이 안되네요. 하나는 사용자함수를 등록하면 될듯한데 키움이라면 어렵지 않지만 이건 어렵군요.10일 20일 지수이동평균도 맞는건지 삐리하고요 ㅋ. 수식작성좀 부탁드립니다^^ 2.작성해본 검색식인데 참조해주시기 바랍니다 VAR : LL(0),M10(0),M20(0); LL = Lowest(L, 60); if LL[1]>L Then M10=ema((DayClose()+npredayclose(1)+npredayclose(2)+npredayclose(3)+,,npredayclose(9))/10); if LL[1]>L Then M20=ema((dayclose()+npredayclose(1)+npredayclose(2)+npredayclose(3)+npredayclose(4)+npredayclose(5) +npredayclose(6)+npredayclose(7)+npredayclose(8)+,,,npredayclose(19))/20); IF M10 < M20 && CrossUp(DayClose(), M20) && DayClose()>O TheN Find(1);
프로필 이미지
트라이
2023-09-12
998
글번호 172362
종목검색
답변완료

추세선 시작점

input : Period(180); Var:j(0),T(0),tl(0),TL1(0),tx(0) ,box(0); Var: date11(0),date12(0),time11(0),time12(0), date21(0),date22(0),time21(0),time22(0), date31(0),date32(0),time31(0),time32(0); Array: HiVal[20](0),LoVal[20](0),HiBar[20](0),LoBar[20](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,Blue); TL_SetSize(TL1,2); date21 = date[HiBar[0]]; time21 = stime[HiBar[0]]; date22 = date[0]; time22 = stime[0]; box = Box_New(date11,time11,Value11,date12,time12,Value12); Text_SetSize(tx,25); Text_SetColor(Tx,Red); Text_SetStyle(tx,1,1); Text_SetBold(tx,1); if abs(value12[1]-value11[1]) < 0.7 Then Text_Delete(tx); tx = Text_New(sDate,stime,value12,NumToStr(value11-value12,2)); Text_SetColor(Tx,Blue); Text_SetStyle(tx,1,0); Text_SetSize(tx,25); Text_SetBold(tx,1); } 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]; Box_SetEnd(box,date12,time12,Value12); Text_SetString(tx,NumToStr(value11-value12,2)); Text_SetLocation(tx,sDate,sTime,value12); } if value12 > value11-0.7 Then { Box_SetColor(box,Cyan); Box_SetFill(box,true,50); } else if value12 <= value11-0.7 and value12 > value11-0.9 Then { Box_SetColor(box,Yellow); Box_SetFill(box,true,90); } else if value12 <= value11-0.9 and value12 > value11-1.3 Then { Box_SetColor(box,Lime); Box_SetFill(box,true,80); } else if value12 <= value11-1.3 and value12 > value11-1.6 Then { Box_SetColor(box,Cyan); Box_SetFill(box,true,50); } else if value12 <= value11-1.6 and value12 > value11-2 Then { Box_SetColor(box,Blue); Box_SetFill(box,true,25); } else { Box_SetColor(box,Lime); Box_SetFill(box,true,35); } } 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,Red); TL_SetSize(TL1,2); date31 = date[LoBar[0]]; time31 = stime[LoBar[0]]; date32 = date[0]; time32 = stime[0]; box = Box_New(date11,time11,Value11,date12,time12,Value12); Text_SetSize(tx,25); Text_SetColor(Tx,Blue); Text_SetStyle(tx,1,0); Text_SetBold(tx,1); if abs(value12[1]-value11[1]) < 0.7 Then Text_Delete(tx); tx = Text_New(sDate,stime,value12,NumToStr(value12-value11,2)); Text_SetColor(Tx,Red); Text_SetStyle(tx,1,1); Text_SetSize(tx,25); Text_SetBold(tx,1); } 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]; Box_SetEnd(box,date12,time12,Value12); Text_SetString(tx,NumToStr(value12-value11,2)); Text_SetLocation(tx,sDate,sTime,value12); } if Value12 > value11+1.1 Then { Box_SetColor(box,Pink); Box_SetFill(box,true,90); } else if value12 >= value11+0.8 and value12 <= value11+1.1 Then { Box_SetColor(box,Magenta); Box_SetFill(box,true,40); } Else { Box_SetColor(box,Orange); Box_SetFill(box,true,60); } } 추세선, 박스, 추세선크기, 세가지 시작점 변경. 선물 15틱 차트에서 여러봉의 고점이 같을 때, 마지막 최고가봉이 하락추세선 시작점인것을, 첫 최고가봉이 하락추세선의 시작점으로 변경. 그림1의 아래쪽은 83322와 동일한 수식이고, 그림2는 82425에서 알려주신 상기 수식의 상하대칭 지점인데 모두 첫 최고가봉이 기준점으로 되어 있습니다. 참고해서 첫 최고가봉으로 변경 부탁드립니다.
프로필 이미지
고성
2023-09-12
1042
글번호 172361
지표
답변완료

문의 드립니다.

1. input : StartTime(190000),EndTime(30000),진입횟수(0); input : 익절틱수(850),손절틱수(60); Input:Length(1),Pval(0.01); var : Tcond(False),entry(0); Variables: Mom(0); Var : N1(0),dayPl(0),당일수익(0),당일손실(0),Xcond(false); IF Endtime > starttime Then SetStopEndofday(Endtime); Else { if sDate != sDate[1] Then SetStopEndofday(Endtime); } if (sdate != sdate[1] and stime >= StartTime) or (sdate == sdate[1] and stime >= StartTime and stime[1] < StartTime) Then { Tcond = true; entry = 0; Xcond = false; N1 = NetProfit; IF Endtime <= starttime Then { SetStopEndofday(0); } } if (sdate != sdate[1] and stime >= EndTime) or (sdate == sdate[1] and stime >= EndTime and stime[1] < EndTime) Then { Tcond = False; } if TotalTrades > TotalTrades[1] then { if daypl >= 당일수익 or daypl <= -당일손실 Then Xcond = true; if (IsExitName("dbp",1) == true or IsExitName("dbl",1) == true ) then Xcond = true; } if (MarketPosition != 0 and MarketPosition != MarketPosition[1]) or (MarketPosition == MarketPosition[1] and TotalTrades > TotalTrades[1]) Then entry = entry+1; Buy("CBI_LE",AtStop,Highest(High,Length)+Pval); ExitLong("CBI_SE",AtStop,Lowest(High,Length)+Pval); if MarketPosition < 1 then { ExitLong("dbp",atStop,EntryPrice+((당일수익-daypl)/CurrentContracts)); ExitLong("dbl",AtStop,EntryPrice-((당일손실+daypl)/CurrentContracts)); } SetStopProfittarget(PriceScale*익절틱수,PointStop); SetStopLoss(PriceScale*손절틱수,PointStop); 2. input : StartTime(190000),EndTime(30000),진입횟수(0); input : 익절틱수(850),손절틱수(60); Input:Length(1),Pval(0.01); var : Tcond(False),entry(0); Variables: Mom(0); Var : N1(0),dayPl(0),당일수익(0),당일손실(0),Xcond(false); IF Endtime > starttime Then SetStopEndofday(Endtime); Else { if sDate != sDate[1] Then SetStopEndofday(Endtime); } if (sdate != sdate[1] and stime >= StartTime) or (sdate == sdate[1] and stime >= StartTime and stime[1] < StartTime) Then { Tcond = true; entry = 0; Xcond = false; N1 = NetProfit; IF Endtime <= starttime Then { SetStopEndofday(0); } } if (sdate != sdate[1] and stime >= EndTime) or (sdate == sdate[1] and stime >= EndTime and stime[1] < EndTime) Then { Tcond = False; } if TotalTrades > TotalTrades[1] then { if daypl >= 당일수익 or daypl <= -당일손실 Then Xcond = true; if (IsExitName("dbp",1) == true or IsExitName("dbl",1) == true ) then Xcond = true; } if (MarketPosition != 0 and MarketPosition != MarketPosition[1]) or (MarketPosition == MarketPosition[1] and TotalTrades > TotalTrades[1]) Then entry = entry+1; ExitShort("CBI_LE",AtStop,Highest(High,Length)-Pval); Sell("CBI_SE",AtStop,Lowest(Low,Length)-Pval); if MarketPosition < 1 then { ExitShort("dbp",AtStop,EntryPrice-((당일수익-daypl)/CurrentContracts)); ExitShort("dbl",AtStop,EntryPrice-((당일손실+daypl)/CurrentContracts)); } SetStopProfittarget(PriceScale*익절틱수,PointStop); SetStopLoss(PriceScale*손절틱수,PointStop); 질의를 드렸던 내용인데요. 매수는 앞 캔들의 고가를 0.01 이상일때 진입신호로 되어있습니다. 매도는 앞 캔들의 저가를 0.01 이상일때 진입신호로 되어있습니다. 아래로 수정을 부탁드립니다. 매수는 앞 캔들의 종가를 0.01 이상일때 진입신호로 수정을 부탁드립니다. 매도는 앞 캔들의 종가를 0.01 이하일때 진입신호로 수정을 부탁드립니다. 미리 감사드립니다.
프로필 이미지
푸른
2023-09-11
1111
글번호 172359
시스템
답변완료

문의 드립니다.

//@version=3 study(title="Money Flow Index") // Typical price = (high price + low price + closing price) / 3 // Raw money flow = typical price x volume // Money flow ratio = (14-day Positive Money Flow) / (14-day Negative Money Flow) // Positive money flow is calculated by summing up all of the money flow on the days in the period // where the typical price is higher than the previous typical price. This same logic applies for the negative money flow. // MFI = 100 - 100 / (1 + money flow ratio) length = input(title="Period Length", type=integer, defval=10, minval=1) show_value = input(title="Show which value", type=string, options=["Raw Money Flow", "Money Flow Ratio", "Money Flow Index"], defval="Money Flow Index") show_raw = (show_value == "Raw Money Flow") show_ratio = (show_value == "Money Flow Ratio") show_index = (show_value == "Money Flow Index") show_sma = input(title="Show MFI SMA", type=bool, defval=true) avg_len = input(title="SMA Length", type=integer, defval=5, minval=1) mfi_high = 80 mfi_mid = 50 mfi_low = 20 prc = avg(high, low, close) raw = prc * volume pos_day = (prc[0] >= prc[1]) ? raw : 0 neg_day = (prc[0] <= prc[1]) ? raw : 0 pos_period = sum(pos_day, length) neg_period = sum(neg_day, length) mf_ratio = (pos_period / neg_period) mf_index = 100 - (100 / (1 + mf_ratio)) mfi_sma = sma(mf_index, avg_len) plot(show_raw ? pos_period : na, "Positive Flow", green, linewidth=2, transp=0) plot(show_raw ? neg_period : na, "Negative Flow", red, linewidth=2, transp=0) plot(show_ratio ? mf_ratio : na, "Money Flow Ratio", black, linewidth=2, transp=0) plot(show_index ? mf_index : na, "Money Flow Index", blue, linewidth=2, transp=0) plot(show_index and show_sma ? mfi_sma : na, "Money Flow SMA", gray, linewidth=1, transp=0) plot(show_index ? mfi_high : na, "High Line", green) plot(show_index ? mfi_mid : na, "Mid Line", silver) plot(show_index ? mfi_low : na, "Low Line", red) 트레이딩뷰 수식인데 위 수식에서 Money Flow Index선과 시그널선 그리고 기준선만 예스로 좀 바꿔주세요.
프로필 이미지
신대륙발견
2023-09-11
1451
글번호 172347
지표
답변완료

수식오류수정 부탁드립니다

당일 두번째 진입(b2)부터는 직전 청산후 5봉 경과후 진입식 입니다.그런데 어떤날은 첫번째 진입인 데도 두번째이후 진입명인 b2가 표시가 됩니다. 어떤 표현이 잘못된건지 수정 부탁드립니다. input : left(5),right(5),ln(3),dn(12),ts(30),loss(20),scl(3),LAT(5); var : ii(0),entry(0),T1(0); if Bdate != Bdate[1] Then{ T1 = TotalTrades; } if MarketPosition == 0 Then entry = TotalTrades-T1; Else entry = TotalTrades-T1+1;//당일 진입 3회까지만 if bdate != Bdate[1] Then { var1 = 0; ii = 0; } ii = ii +1; if ii >= 11 and Swinglow(1,L,5,5,11) != -1 Then { var2 =L[5]; } if date != date[1] then{ var3 = 0;// 당일 첫번째 진입 } if MarketPosition==0 and NextBarSdate == sDate AND Var3<1 and var2>0 and entry< 3 Then//var3<1 당일 첫번째진입은 { Buy("b1",AtLimit,var2+PriceScale*scl);//첫번째 진입은 b1 var3=1; } if MarketPosition==0 and BarsSinceExit(1)>5 and NextBarSdate == sDate and var2>0 and entry< 3 Then// 당일 두 번재 진입부터는 직전 청산후 5봉 경과후 진입 { Buy("b2",AtLimit,var2+PriceScale*scl);//2번째봉부터는 청산후 5본 경과 } SetStopLoss(LOSS,PercentStop); SetStopTrailing(dn,ts,PercentStop,1); SetStopEndofday(151500);
프로필 이미지
피카2
2023-09-11
982
글번호 172345
시스템