커뮤니티

예스랭귀지 Q&A

글쓰기
답변완료

수식 전환 부탁드립니다

trading view 수식, 예스트레이더 변환 부탁드립니다 study(title="Twin Range Filter", overlay=true) source = input(defval=close, title="Source") // Smooth Average Range per1 = input(defval=27, minval=1, title="Fast period") mult1 = input(defval=1.6, minval=0.1, title="Fast range") per2 = input(defval=55, minval=1, title="Slow period") mult2 = input(defval=2, minval=0.1, title="Slow range") smoothrng(x, t, m) => wper = t * 2 - 1 avrng = ema(abs(x - x[1]), t) smoothrng = ema(avrng, wper) * m smoothrng smrng1 = smoothrng(source, per1, mult1) smrng2 = smoothrng(source, per2, mult2) smrng = (smrng1 + smrng2) / 2 // Range Filter rngfilt(x, r) => rngfilt = x rngfilt := x > nz(rngfilt[1]) ? x - r < nz(rngfilt[1]) ? nz(rngfilt[1]) : x - r : x + r > nz(rngfilt[1]) ? nz(rngfilt[1]) : x + r rngfilt filt = rngfilt(source, smrng) upward = 0.0 upward := filt > filt[1] ? nz(upward[1]) + 1 : filt < filt[1] ? 0 : nz(upward[1]) downward = 0.0 downward := filt < filt[1] ? nz(downward[1]) + 1 : filt > filt[1] ? 0 : nz(downward[1]) hband = filt + smrng lband = filt - smrng longCond = bool(na) shortCond = bool(na) longCond := source > filt and source > source[1] and upward > 0 or source > filt and source < source[1] and upward > 0 shortCond := source < filt and source < source[1] and downward > 0 or source < filt and source > source[1] and downward > 0 CondIni = 0 CondIni := longCond ? 1 : shortCond ? -1 : CondIni[1] long = longCond and CondIni[1] == -1 short = shortCond and CondIni[1] == 1 // Plotting plotshape(long, title="Long", text="Long", style=shape.labelup, textcolor=color.black, size=size.tiny, location=location.belowbar, color=color.lime, transp=0) plotshape(short, title="Short", text="Short", style=shape.labeldown, textcolor=color.white, size=size.tiny, location=location.abovebar, color=color.red, transp=0) // Alerts alertcondition(long, title="Long", message="Long") alertcondition(short, title="Short", message="Short")
프로필 이미지
seayun1
2023-03-28
1501
글번호 167633
지표
답변완료

도움부탁드립니다

키움지표을 예스트레이드로변경부탁드립니다. 수식1:Ra=rsi(period1,이평종류); valuewhen(1,crossup(Ra,K1),가격1) 수식2:Ra=rsi(period2,이평종류); valuewhen(1,crossdown(Ra,K2),가격1) 수식3:Ra=rsi(period1,이평종류); valuewhen(1,crossup(Ra,K1),가격2) 수식4:Ra=rsi(period2,이평종류); valuewhen(1,crossdown(Ra,K2),가격2) 지표조건:Period1:14 Period2:14 k1:30 k2:70 가격1:(고가+저가)/2 가격2:(고가+저가+종가)/3 이평종류:단순
프로필 이미지
렉스턴
2023-03-28
1579
글번호 167632
지표
답변완료

문의

당일고점대비 3%인 가격을 차트에 표시하고 싶습니다.. 어찌해야 하나요?
프로필 이미지
엉덩공주
2023-03-28
1294
글번호 167631
지표
답변완료

지표 작성 부탁드릴게요

참조데이터를 사용하여 특정종목과 특정종목이 포함된 지수의 상대강도를 비교하고 싶습니다. 아래는 어떤 분의 질문에 운영자님이 작성해 주셨던 것인데요... input : N(20); var : RSD(0),MAV(0),MRS(0); RSD = Data1(c)/data2(c) * 100; mav = Data1(ma(RSD,N)); MRS = ((RSD /mav) - 1 ) * 100; Plot1(MRS); plot2(0); 위의 식은 20일의 기간 동안 2개종목의 비율과 해당 비율을 단순평균한 값으로 하나의 mrs가 계산되게 되어 있는데 트레이딩뷰에서 보니 63일(3달), 126일(6달), 252일(12달)로 세개의 RS를 나타내면서 단순평균이 아니라 설정한 기간값의 구간별로 가중값을 주어 가중평균하여 나타내는 지표가 있더라구요 아래는 트레이딩뷰에서 발췌한 것인데 예스트레이더에서 똑같이 구현해 보고 싶습니다. 바쁘시겠지만 지표 작성 꼭 좀 부탁드리겠습니다. //@version=3 study("IBD RS", overlay=true) src = security(ticker, "D", close) mo_12 = 0.4*((src)/src[63]) + 0.2*((src)/src[126]) + 0.2*((src)/src[189]) + 0.2*((src)/src[252]) mo_6 = 0.4*((src)/src[21]) + 0.2*((src)/src[63]) + 0.2*((src)/src[84]) + 0.2*((src)/src[126]) mo_3 = 0.4*((src)/src[11]) + 0.2*((src)/src[21]) + 0.2*((src)/src[42]) + 0.2*((src)/src[63]) plot(100*mo_12, style=line, linewidth=3, color=#1E90FF, transp=0) plot(100*mo_6, style=line, linewidth=2, color=#1E90FF, transp=0) plot(100*mo_3, style=line, linewidth=1, color=#1E90FF, transp=0) ※ 참고로 mo_12는 12개월을 의미하며 한달을 21일로 잡을때 63은 3개월, 126은 6개월의 기간을 의미하는 식입니다.
프로필 이미지
분노의물타기
2023-03-28
1566
글번호 167628
지표

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

프로필 이미지
2wnwn
2023-03-29
19
글번호 167625
지표
답변완료

질문 드립니다

답변에 정말 감사드립니다 ~~~~~~~~~~~~~~~~질문~1~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 아래 수식이 <81414>번의 2질문에 해당답변같으나 응용할려니 이해부족으로 수고쓰럽지만 각종 부호의뜻과 숫자 뜻!부연 좀 부탁드립니다~~ 그리고 ("매수2청",1)<--여기서 1 은 무엇을뜻하는지요?? if MarketPosition <= 0 and 5 > 50 Then buy("매수1진입"); if MarketPosition == 0 and IsExitName("매수2청",1) == true and 10 > 60 Then buy("매수2진입"); ~~~~~~~~~~~~~~~~~~질문~2~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 저는 매수2진입 수식을 아래처럼 별도로 작성해놓은 상태에서 (손실)매수2청때만은 매수2진입 하라는 명령을 하고싶은데 아래처럼해도 돠는지요??~~ if MarketPosition == 0 and IsExitName("매수2청",1) == true Then buy("매수2진입"); if 10 > 60 Then buy("매수2진입"); //////////////////////////////////////////////////////////////////////// <81414번>질문~2~ (손절된 2청산 때) ("매수2진입")진행은 직전 청산에서 ("매수2청")으로 청산된것만 매수2진입 적용!! ("매도2진입")진행은 직전 청산에서 ("매도2청")으로 청산된것만 매도2진입 적용!! ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ if 5 > 50 Then buy("매수1진입"); if 10 > 60 Then buy("매수2진입"); if 20 < 50 Then exitlong("매수1청"); if 30 < 60 Then exitlong("매수2청"); 꼭~부탁드립니다~~
프로필 이미지
째일
2023-03-29
753
글번호 167624
시스템

러블리 님에 의해서 삭제되었습니다.

프로필 이미지
러블리
2023-03-28
588
글번호 167621
지표
답변완료

문의합니다.

바쁜 업무에 항상 빠른 대응 감사합니다. 아래 지표식을 부탁합니다. 1) 일봉에서 월봉의 시가/저가/고가 2) 임의의 변수 AA,BB가 있으며 아래의 수식을 지표식으로 부탁합니다. LowestSince(1, CrossDown(BB,20), AA); 3) 임의의 변수 AA,BB가 있으며 아래의 수식을 지표식으로 부탁합니다. HighestSince(1, CrossUp(BB,20), AA); ■ LowestSince(n,condition,data) => condition이 n번째 만족된이후data의 최저가 ■ HighestSince(n,condition,data) => condition이 n번째 만족된이후data의 최고가 감사합니다.~~^^
프로필 이미지
배움이
2023-03-28
1068
글번호 167617
지표
답변완료

수식 문의 드립니다

매수: 5이평선 상향시 매수 매도 : RSI(9) 가 60 이상이고 매수 가격보다 당일 1415시 가격이 + 가격이면 아침 시가 즉시 매도 매도 : RSI(9) 가 60 이하이고 매수 가격보다 당일 1415시 가격이 - 가격이면 당일 1415시 즉시매도
프로필 이미지
기관장
2023-03-28
1163
글번호 167611
시스템

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

프로필 이미지
고성
2023-03-28
10
글번호 167610
지표