커뮤니티

예스랭귀지 Q&A

글쓰기
답변완료

시스템식 문의

#ma위 롱진입 if 롱진입 조건 Then buy("롱",AtStop,C[0]); #ma아래 숏진입 if 숏진입 조건 Then sell("추세숏",AtStop,C[0]); 이와같은 형태의 수식을 통해 시스템식을 구성한다고 할때, ma위에서 롱진입하고, ma아래에서 숏진입을 하게 됩니다. 청산조건을 롱진입의 경우, ma를 (위에서 아래로)터치할경우 '시장가 청산' 숏진입의 경우, ma를 (아래에서 위로)터치할경우 '시장가 청산' 의 방식으로 하고 싶을때, 청산수식을 어떤식으로 해야 할까요? 종가기준 크로스업 크로스다운이 아닌, 장중 가격이 ma를 터치하기만 하면 시장가로 청산하고 싶습니다.
프로필 이미지
노인
2020-05-08
1093
글번호 138686
시스템
답변완료

수식 감사합니다. (수정 부탁 드립니다)

아래 수식 감사합니다. 그런데 수정을 좀 부탁 드려야 할것 같습니다. 지금 수식을 넣어보니 전고점을 갱신하지 않았는데도 고점의 위치가 바뀌네요. 고점을 갱신하지 못하면 기존 고점을 유지하게 부탁 드립니다. 저점도 저점을 갱신하지 못하면 기존 저점을 유지하게 부탁 드립니다. 고점이 생기고 그 고점을 돌파하면 최고점이 생겨서 2줄이 나오게 되는데.. 그다음 최고점을 돌파하면 전 최고점은 고점이 되고 현재 고점이 최고점이 되게 부탁 드립니다. 그리고 최고점이 갱신이 안되면 계속 지존값을 유지하려고 합니다. 저점도 같은 방법으로 부탁 드립니다. 감사합니다. 안녕하세요 예스스탁입니다. #data2 : 선물매수호가총건수 #data3 : 선물매도호가총건수 var : TL1(0,data1),TL2(0,data1),TL3(0,data1),TL4(0,data1); var : diff(0,data1),hh(0,data1),ll(0,data1); diff = data2(c)-data3(c); if bdate != bdate[1] Then { hh = diff; ll = diff; TL_Delete(TL1); TL_Delete(TL2); TL1 = TL_New(sdate,stime,H,NextBarSdate,NextBarStime,H); TL2 = TL_New(sdate,stime,L,NextBarSdate,NextBarStime,L); TL_Delete(TL3); TL_Delete(TL4); TL3 = TL_New(sdate,stime,H,Sdate,Stime,H); TL4 = TL_New(sdate,stime,L,Sdate,Stime,L); } else { if diff > hh Then { hh = diff; TL_SetBegin(TL3,sdate,stime,TL_GetValue(TL1,sdate,stime)); TL_Setend(TL3,NextBarSdate,NextBarStime,TL_GetValue(TL1,sdate,stime)); TL_SetBegin(TL1,sdate,stime,h); TL_Setend(TL1,NextBarSdate,NextBarStime,h); } if diff < ll Then { ll = diff; TL_SetBegin(TL4,sdate,stime,TL_GetValue(TL2,sdate,stime)); TL_Setend(TL4,NextBarSdate,NextBarStime,TL_GetValue(TL2,sdate,stime)); TL_SetBegin(TL2,sdate,stime,l); TL_Setend(TL2,NextBarSdate,NextBarStime,l); } } TL_SetExtRight(TL1,true); TL_SetExtLeft(TL1,true); TL_SetExtRight(TL2,true); TL_SetExtLeft(TL2,true); TL_SetColor(TL1,RED); TL_SetColor(TL2,BLUE); TL_SetExtRight(TL3,true); TL_SetExtLeft(TL3,true); TL_SetExtRight(TL4,true); TL_SetExtLeft(TL4,true); TL_SetColor(TL3,RED); TL_SetColor(TL4,BLUE); plot1(hh,"최고건수차",RED); plot2(ll,"최저건수차",blue); 즐거운 하루되세요 > 오늘도수익 님이 쓴 글입니다. > 제목 : Re : Re : 지표 수정 부탁 드립니다. > 수식 감사합니다. 현재 최저점과 최고점만 표시해서 챠트에 표시가 되는데.. 고점과 저점을 2개로 표시해서 차트에 표시 부탁 드립니다. 첫번째 고점이 생기고 그다음 고점이 생기면 첫번째 고저도 표시하고 새로 갱신한 고점도 표시를 했으면 합니다. 즉 2개를 다 표시했으면 합니다. 새로운 고점이 생기면 전고점과 현재의 고점 이렇게 2개를 표시했으면 합니다. 저점도 같은 방법으로 2개를 표시했으면 합니다. 부탁 드립니다. > 예스스탁 님이 쓴 글입니다. > 제목 : Re : 지표 수정 부탁 드립니다. > 안녕하세요 예스스탁입니다. #data2 : 선물매수호가총건수 #data3 : 선물매도호가총건수 var : TL1(0,data1),TL2(0,data1); var : diff(0,data1),hh(0,data1),ll(0,data1); diff = data2(c)-data3(c); if bdate != bdate[1] Then { hh = diff; ll = diff; TL_Delete(TL1); TL_Delete(TL2); TL1 = TL_New(sdate,stime,H,NextBarSdate,NextBarStime,H); TL2 = TL_New(sdate,stime,L,NextBarSdate,NextBarStime,L); } else { if diff > hh Then { hh = diff; TL_SetBegin(TL1,sdate,stime,h); TL_Setend(TL1,NextBarSdate,NextBarStime,h); } if diff < ll Then { ll = diff; TL_SetBegin(TL2,sdate,stime,l); TL_Setend(TL2,NextBarSdate,NextBarStime,l); } } TL_SetExtRight(TL1,true); TL_SetExtLeft(TL1,true); TL_SetExtRight(TL2,true); TL_SetExtLeft(TL2,true); TL_SetColor(TL1,RED); TL_SetColor(TL2,BLUE); plot1(hh,"최고건수차",RED); plot2(ll,"최저건수차",blue); 즐거운 하루되세요 > 오늘도수익 님이 쓴 글입니다. > 제목 : 지표 수정 부탁 드립니다. > 2 호가잔량건수이면 참조데이타를 이용하셔야 합니다. 차트에 선물매수호가총건수와 선물매도호가총건수를 참조데이타로 차트에 추가하고 아래식 적용하시면 됩니다. 참조데이타는 차트왼쪽 상단의 종목선택버튼 중 오른쪽 버튼 클릭하면 차트에 추가하실 수 있습니다. 참조데이타는 차트에 추가되는 순서로 data2부터 data99까지 데이타번호가 부여됩니다. 선물매수호가총건수를 먼저 추가하고 선물매도호가총건수를 나중에 추가하시면 됩니다. 해당 데이타는 종목선택화면 참조탭에 있습니다. #data2 : 선물매수호가총건수 #data3 : 선물매도호가총건수 var : diff(0,data1),hh(0,data1),ll(0,data1); diff = data2(c)-data3(c); if bdate != bdate[1] Then { hh = diff; ll = diff; } if diff > hh Then hh = diff; if diff < ll Then ll = diff; plot1(hh,"최고건수차",RED); plot2(ll,"최저건수차",blue); 제가 설명을 잘못 한것 같습니다. 최고건수차와 최저건수차가 나왔을때 90틱 지표에 수평선으로 표시하고 싶습다. 최고건수가 나온 시간에 90틱 챠트에 수평선으로표시하고 최저건수가 온 시간에 90틱 차트에 수평선으로 표시하고 싶습다.
프로필 이미지
오늘도수익
2020-05-08
1234
글번호 138685
지표
답변완료

문의드립니다.

prd = input(60, title="Period", minval=5) src = input(close, title="Source") threshold = input(80, title="Threshold %", minval =0 ) mkt = 0 for i = 0 to prd-1 for j = i + 1 to prd mkt := mkt + iff(src[i] > src[j], 1, iff(src[i] < src[j], -1, 0)) col = iff(mkt > (prd * (prd-1)) / 200 * threshold, red, iff(mkt < (prd * (prd-1)) / 200 * -threshold, lime, gray)) plot(mkt, color=col, style=columns) 변환 문의드립니다. 감사합니다.
프로필 이미지
물고기
2020-05-08
1125
글번호 138678
지표
답변완료

수평선

5분봉차트에서 오늘을 기준으로 직전일 최고점(전고점)을 오늘만 5분봉 차트에 수평선으로 표시했으면 좋겠습니다.
프로필 이미지
쓰임과이롬
2020-05-08
968
글번호 138677
지표
답변완료

지표문의

1.안녕하세요 아래는 rsi band 라는 지표 인데요 구현 해보구 싶은게요. UpBand와DnBand 양봉이구 확장이고 하면 매수 UpBand와DnBand 음봉이구 확장이고 하면 매도 시스템하고 지표 좀 부탁할께요. 지표는 빨강,파랑선으로요. 2.Input:Length(14),UpLevel(70),DnLevel(30); Var:Upband(0),DnBand(0),MidLine(0); RSI_BAND(Length,UpLevel,DnLevel,0,UpBand,DnBand,MidLine); // 현재 봉에서의 밴드 값 Plot1(UpBand); Plot2(MidLine); Plot3(DnBand); RSI_BAND.yfu Inputs: Length(NumericSimple),TargetUpLevel(NumericSimple),TargetDnLevel(NumericSimple), NxtYn(NumericSimple), // 다음 봉의 값을 구하려면 1을 아니면 0을 넣어준다. oUpBand(NumericRef), // 주소전달방식임을 선언 oDnBand(NumericRef), // 값을 입력받는게 아니라 여기에 결과값을 채워서 반환한다. oMidLine(NumericRef); // 변수명 앞에 소문자를 o를 붙인 것은 output 변수입을 나타냅니다. Variables: Counter(0), DownAmt(0), UpAmt(0), UpSum(0), DownSum(0), UpAvg(0), DownAvg(0),MidLevel(0); If CurrentBar == 1 AND Length > 0 Then Begin UpSum = 0; DownSum = 0; For Counter = 0 To Length - 1 Begin UpAmt = C[Counter] - C[Counter+1]; If UpAmt >= 0 Then DownAmt = 0; Else Begin DownAmt = -UpAmt; UpAmt = 0; End; UpSum = UpSum + UpAmt; DownSum = DownSum + DownAmt; End; UpAvg = UpSum / Length; DownAvg = DownSum / Length; End Else If CurrentBar > 1 AND Length > 0 Then Begin UpAmt = C[0] - C[1]; If UpAmt >= 0 Then DownAmt = 0; Else Begin DownAmt = -UpAmt; UpAmt = 0; End; UpAvg = (UpAvg[1] * (Length - 1) + UpAmt) / Length; DownAvg = (DownAvg[1] * (Length - 1) + DownAmt) / Length; End; If UpAvg + DownAvg <> 0 Then Value1 = 100 * UpAvg / (UpAvg + DownAvg); Else Value1 = 0; If nxtYn == 1 Then // 다음 봉 여부가 1일 경우 { If Value1 > TargetUpLevel Then // 상단밴드 oUpBand = (((TargetUpLevel - 100) / TargetUpLevel * UpAvg) + DownAvg) * (Length - 1) + C; Else oUpBand = ((TargetUpLevel / (100 - TargetUpLevel) * DownAvg) - UpAvg) * (Length - 1) + C; If Value1 > TargetDnLevel Then // 하단밴드 oDnBand = (((TargetDnLevel - 100) / TargetDnLevel * UpAvg) + DownAvg) * (Length - 1) + C; Else oDnBand = ((TargetDnLevel / (100 - TargetDnLevel) * DownAvg) - UpAvg) * (Length - 1) + C; MidLevel = (TargetUpLevel + TargetDnLevel) / 2; // 중간라인 If Value1 > MidLevel Then oMidLine = (((MidLevel - 100) / MidLevel * UpAvg) + DownAvg) * (Length - 1) + C; Else oMidline = ((MidLevel / (100 - MidLevel) * DownAvg) - UpAvg) * (Length - 1) + C; } Else // 다음 봉 여부가 0인 경우 { If Value1[1] > TargetUpLevel Then oUpBand = (((TargetUpLevel - 100) / TargetUpLevel * UpAvg[1]) + DownAvg[1]) * (Length - 1) + C[1]; Else oUpBand = ((TargetUpLevel / (100 - TargetUpLevel) * DownAvg[1]) - UpAvg[1]) * (Length - 1) + C[1]; If Value1[1] > TargetDnLevel Then oDnBand = (((TargetDnLevel - 100) / TargetDnLevel * UpAvg[1]) + DownAvg[1]) * (Length - 1) + C[1]; Else oDnBand = ((TargetDnLevel / (100 - TargetDnLevel) * DownAvg[1]) - UpAvg[1]) * (Length - 1) + C[1]; MidLevel = (TargetUpLevel + TargetDnLevel) / 2; If Value1[1] > MidLevel Then oMidLine = (((MidLevel - 100) / MidLevel * UpAvg[1]) + DownAvg[1]) * (Length - 1) + C[1]; Else oMidline = ((MidLevel / (100 - MidLevel) * DownAvg[1]) - UpAvg[1]) * (Length - 1) + C[1]; } RSI_BAND = 1; //사용자함수는 반환값이 있어야 한다고 했습니다. // oUpBand, oDnBand, oMidLine 는 메모리 주소이지 반환값이 아닙니다. // 그래서 마지막에 아무 값이나 넘겨 줘야 하기 때문에 그냥 1을 넣어 줬습니다. 3.그럼 수고하세요
프로필 이미지
성공예견
2020-05-08
975
글번호 138676
지표
답변완료

수평선 재질문

항상 감사합니다. 아래에서 오늘날짜는 수평선이 그어지지 않게 할수 있나요? ============ input : n(3); var : cnt(0),hh(0),ll(0),mm(0),tl(0); Array : dd[100](0),tt[100](0); if bdate != bdate[1] Then { dd[0] = bdate[1]; tt[0] = stime[1]; for cnt = 1 to 99 { dd[cnt] = dd[cnt-1][1]; tt[cnt] = tt[cnt-1][1]; } if dd[n] > 0 then { hh = DayHigh(1); ll = Daylow(1); for cnt = 1 to n { if DayHigh(cnt) > hh Then hh = DayHigh(cnt); if DayLow(cnt) < ll Then ll = Daylow(cnt); } mm = (hh+ll)/2; TL_Delete(tl); tl = TL_New(dd[n],tt[n],mm,sdate,stime,mm); TL_SetExtRight(tl,true); } }
프로필 이미지
쓰임과이롬
2020-05-08
848
글번호 138675
지표
답변완료

지표수식전환 요청

다음 수식을 예스지표로 부탁드립니다 수식1 StochasticsSlow(sto1,sto2) 수식2 eavg(StochasticsSlow(sto1,sto2),sto3) 수식3 eavg(StochasticsSlow(sto4,sto5),sto6) 수식4 eavg(StochasticsSlow(sto7,sto8),sto9) 조건추가설정 sto1 5 sto2 3 sto3 3 sto4 10 sto5 3 sto6 3 sto7 20 sto8 3 sto9 3 기준선 추가 50 과열70 침체30
프로필 이미지
이대표
2020-05-08
963
글번호 138674
지표
답변완료

수식도움 부탁드립니다.

종목 : KODEX코스닥150레버리지 로직 : 12시 가격이 당일 시가보다 높을 경우 종가에 매수->익일 시가 청산 <추가적으로> 위 로직에는 12시시가를 기준으로 했는데 <Input>값을 활용하여 9시 30분, 10시, 10시 30분...등등 30분 단위 기준으로 최적화를 시켜보고 싶습니다. 이 부분도 도와주시면 감사하겠습니다. 감사합니다.
프로필 이미지
와이시스
2020-05-07
921
글번호 138673
시스템
답변완료

문의드립니다.

아래식의 지표및 시스템식을 예스로 부탁합니다. sl_type = input("%", options = ["%", "ATR", "Absolute"]) sl_perc = input(4, title = "% SL", type = input.float) atr_length = input(10, title = "ATR Length") atr_mult = input(4, title = "ATR Mult", type = input.float) sl_absol = input(10, title = "Absolute SL", type = input.float) // BACKTESTING RANGE // From Date Inputs fromDay = input(defval = 1, title = "From Day", minval = 1, maxval = 31) fromMonth = input(defval = 1, title = "From Month", minval = 1, maxval = 12) fromYear = input(defval = 2016, title = "From Year", minval = 1970) // To Date Inputs toDay = input(defval = 1, title = "To Day", minval = 1, maxval = 31) toMonth = input(defval = 1, title = "To Month", minval = 1, maxval = 12) toYear = input(defval = 2100, title = "To Year", minval = 1970) // Calculate start/end date and time condition startDate = timestamp(fromYear, fromMonth, fromDay, 00, 00) finishDate = timestamp(toYear, toMonth, toDay, 00, 00) time_cond = time >= startDate and time <= finishDate ////////////////// // CALCULATIONS // // SL values sl_val = sl_type == "ATR" ? atr_mult * atr(atr_length) : sl_type == "Absolute" ? sl_absol : close * sl_perc / 100 // Init Variables pos = 0 trailing_sl = 0.0 // Signals long_signal = nz(pos[1]) != 1 and high > nz(trailing_sl[1]) short_signal = nz(pos[1]) != -1 and low < nz(trailing_sl[1]) // Calculate SL trailing_sl := short_signal ? high + sl_val : long_signal ? low - sl_val : nz(pos[1]) == 1 ? max(low - sl_val, nz(trailing_sl[1])) : nz(pos[1]) == -1 ? min(high + sl_val, nz(trailing_sl[1])) : nz(trailing_sl[1]) // Position var pos := long_signal ? 1 : short_signal ? -1 : nz(pos[1]) ////////////// // PLOTINGS // plot(trailing_sl, linewidth = 2, color = pos == 1 ? color.green : color.red) ////////////// // STRATEGY // if (time_cond and pos != 1) strategy.entry("long", true, stop = trailing_sl) if (time_cond and pos != -1) strategy.entry("short", false, stop = trailing_sl)
프로필 이미지
as8282
2020-05-07
950
글번호 138672
지표
답변완료

YesGlobalPro 해외선물차트에서

아래 자표식이 YesGlobalPro 해외선물차트에서는 작동이 안되는데 문제점이 무엇인지 해결해 주시면 감사 하겠습니다. var : BA(0); BA = bids - asks; If BA > 0 Then plot1(BA,"매수총잔량우위"); Else plot2(BA,"매도총잔량우위");
프로필 이미지
너무조아
2020-05-07
853
글번호 138671
지표