커뮤니티

예스랭귀지 Q&A

글쓰기
답변완료

수식질문

아래와 같은 함수 수식이 있다고 했을 때 TTL값을 구하는 For문 형태의 수식을 부탁 드립니다. EN(n) = if(Sum(C-C(1),n) > 0, Sum(C-C(1),n)*(100)/ Sum(if(C>C(1), C-C(1),0),n),Sum(C-C(1),n)*(-100)/Sum(if(C < C(1), C-C(1),0),n)); TTL=EN(1)+EN(2)+EN(3)+EN(4)+EN(5);
프로필 이미지
파크에버뉴
2025-06-16
164
글번호 191740
사용자 함수

사공하늘 님에 의해서 삭제되었습니다.

프로필 이미지
사공하늘
2025-06-15
53
글번호 191739
검색

사공하늘 님에 의해서 삭제되었습니다.

프로필 이미지
사공하늘
2025-06-15
54
글번호 191738
검색
답변완료

수식 작성 문의

input : Price(52300),진입횟수(1); var : entry(0); if Bdate != Bdate[1] Then entry = 0; if (MarketPosition != 0 and MarketPosition != MarketPosition[1]) or (MarketPosition == MarketPosition[1] and TotalTrades > TotalTrades[1]) Then entry = entry+1; if (NextBarSdate != sDate and NextBarSdate == CurrentDate and NextBarOpen < Price) or (NextBarSdate == sDate and CurrentDate == sDate and H < price and entry < 진입횟수 and DayOpen < Price) Then Buy("b",AtStop,price); ------------------------------------------------------------------------------------ 09:00에 시초가가 52,300원보다 높은 가격에서 시작하였으나, 장중 가격이 내려와서 52,300원 하회 후 재차 52,300원을 돌파하는 경우에는 매수할 수 있도록 수식 조정 부탁드립니다. 늘 노고에 감사드립니다.
프로필 이미지
autotra
2025-06-15
157
글번호 191737
시스템
답변완료

수식 부탁드립니다

지표식 부탁드립니다. //@version=5 indicator("Parabolic SAR MARSI, Adaptive MACD [Loxx]", shorttitle ="PSAR_MARSI_A_MACD [Loxx]", overlay = false, timeframe="", timeframe_gaps=true) _maRSI(src, price, rsiperiod, speed) => tprice = ta.sma(src, 1) workMaRsi = 0.0 rsi = ta.rsi(src, rsiperiod) if bar_index < rsiperiod workMaRsi := tprice else workMaRsi := workMaRsi[1] + (speed * math.abs(rsi/100.0-0.5)) * (tprice-workMaRsi[1]) workMaRsi variant(type, src, len) => sig = 0.0 if type == "SMA" sig := ta.sma(src, len) else if type == "EMA" sig := ta.ema(src, len) else if type == "DEMA" sig := 2 * ta.ema(src, len) - ta.ema(ta.ema(src, len), len) else if type == "TEMA" sig := 3 * (ta.ema(src, len) - ta.ema(ta.ema(src, len), len)) + ta.ema(ta.ema(ta.ema(src, len), len), len) else if type == "WMA" sig := ta.wma(src, len) else if type == "TRIMA" sig := ta.sma(ta.sma(src, math.ceil(len / 2)), math.floor(len / 2) + 1) else if type == "RMA" sig := ta.rma(src, len) else if type == "VWMA" sig := ta.vwma(src, len) sig rsiSource = input.source(close, "RSI Source", group = "MARSI MACD") rsiPeriod1 = input.int(14, "Fast RSI Period", minval = 0, group = "MARSI MACD") speed1 = input.float(1.2, "Fast MARSI Speed", minval = 0.0, group = "MARSI MACD") rsiPeriod2 = input.int(34, "Slow RSI Period", minval = 0, group = "MARSI MACD") speed2 = input.float(0.8, "Slow MARSI Speed", minval = 0.0, group = "MARSI MACD") start = input.float(0.01, "Start", minval = 0.0, group = "Parabolic SAR") accel = input.float(0.01, "Acceleration", minval = 0.0, group = "Parabolic SAR") finish = input.float(0.1, "Maximum", minval = 0.0, group = "Parabolic SAR") signal_ma = input.string("EMA", title='Signal MA Type', options=["DEMA", "EMA", "RMA", "SMA", "TEMA", "TRIMA", "VWMA", "WMA"], group='MACD') signalPer = input.int(9,"Signal Period", minval = 0, group = "MACD") greencolor = #2DD204 redcolor = #D2042D lightgreencolor = #96E881 lightredcolor = #DF4F6C darkGreenColor = #1B7E02 darkRedColor = #93021F psarUp = input(greencolor, "PSAR Uptrend&#8195;&#8196;", group="Color Settings", inline="MACD") psarDown = input(redcolor, "PSAR Downtrend&#8195;&#8196;", group="Color Settings", inline="MACD") col_signal = input(color.white, "Signal Line&#8195;&#8198;", group="Color Settings", inline="Signal") col_grow_above = input(color.new(lightgreencolor, 60), "Above&#8196;&#8196;&#8197;Grow", group="Histogram of MACD", inline="Above") col_fall_above = input(color.new(darkGreenColor, 60), "Fall", group="Histogram of MACD", inline="Above") col_grow_below = input(color.new(darkRedColor, 60), "Below&#8195;Grow", group="Histogram of MACD", inline="Below") col_fall_below = input(color.new(lightredcolor, 60), "Fall", group="Histogram of MACD", inline="Below") macdHi = _maRSI(rsiSource, high, rsiPeriod1, speed1) - _maRSI(rsiSource, high, rsiPeriod2, speed2) macdLo = _maRSI(rsiSource, low, rsiPeriod1, speed1) - _maRSI(rsiSource, low, rsiPeriod2, speed2) macdMid = (macdHi + macdLo) * 0.5 macd = _maRSI(rsiSource, macdMid, rsiPeriod1, speed1) - _maRSI(rsiSource, macdMid, rsiPeriod2, speed2) signal= variant(signal_ma, macd, signalPer) pine_sar(start, inc, max, cutoff, _high, _low, _close) => var float result = na var float maxMin = na var float acceleration = na var bool isBelow = na bool isFirstTrendBar = false if bar_index < cutoff + cutoff * 0.2 if _close > _close[1] isBelow := true maxMin := _high result := _low[1] else isBelow := false maxMin := _low result := 0 isFirstTrendBar := true acceleration := start result := result + acceleration * (maxMin - result) if isBelow if result > _low isFirstTrendBar := true isBelow := false result := math.max(_high, maxMin) maxMin := _low acceleration := start else if result < _high isFirstTrendBar := true isBelow := true result := math.min(_low, maxMin) maxMin := _high acceleration := start if not isFirstTrendBar if isBelow if _high > maxMin maxMin := _high acceleration := math.min(acceleration + inc, max) else if _low < maxMin maxMin := _low acceleration := math.min(acceleration + inc, max) if isBelow result := math.min(result, _low[1]) if bar_index > 1 result := math.min(result, _low[2]) else result := math.max(result, _high[1]) if bar_index > 1 result := math.max(result, _high[2]) result sar = pine_sar(start, accel, finish, math.max(rsiPeriod2, rsiPeriod1), macdHi, macdLo, macd) plot(0, "Zero line", style = plot.style_circles, color = color.gray) plot(macd, "Historgram of MACD", style=plot.style_columns, color=(macd>=0 ? (macd[1] < macd ? col_grow_above : col_fall_above) : (macd[1] < macd ? col_grow_below : col_fall_below))) plot(sar, "PSAR", style=plot.style_cross, linewidth=1, color = sar > signal ? psarDown : psarUp) plot(signal,"Signal", linewidth=1, color = col_signal) plotshape(sar < signal and sar[1] > signal ? sar : na, title='PSAR Long Start', location=location.absolute, style=shape.circle, size=size.tiny, color=greencolor) plotshape(sar > signal and sar[1] < signal ? sar : na, title='PSAR Long Start', location=location.absolute, style=shape.circle, size=size.tiny, color=redcolor)
프로필 이미지
사노소이
2025-06-15
229
글번호 191736
지표

와우리 님에 의해서 삭제되었습니다.

프로필 이미지
와우리
2025-06-15
38
글번호 191735
지표

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

프로필 이미지
onlypsn
2025-06-15
1
글번호 191734
종목검색
답변완료

문의 드립니다.

안녕하세요 현재 종가가 아래의 2 조건을 돌파 또는 우상향 하는 종목 검색식 부탁 드립니다. 1. A라인 ; S = sar(af,maxAf); 조건 = CrossUp(C, S); 시작가 = Valuewhen(1, 조건, O); bs = BarsSince(조건); 라인2 = if(조건, 시작가, 시작가 + 시작가 * (비율2 / 100) * bs); if(S < C && S < 라인2, 라인2, S) 지표조건 af 0.01 maxAf 0.2 비율2 1 2. B라인 ; A=avg(c,17); ATR=avg(max(max(h-L,abs(c(1)-h)),abs(c(1)-L)),17); B=ATR*2; D=A+B; E=Bbandsup(17,2); e1=crossup(E,D); e2=crossdown(E,D); e3=crossdown(c,E); valuewhen(1,e1 or e2 or e3,o) 감사합니다.
프로필 이미지
ikksoo
2025-06-15
195
글번호 191733
검색
답변완료

수식 문의 드립니다

항상 감사 드리니다. 아래 수식작성 요청식이 즉시 매수나 즉시매도식이 불가능할 시에는 봉 완성후 매입 매도 하는식으로 부탁 드립니다. 1. 일반식 1). Input : Period(5) ; var : DMIv(0),DP(0),DM(0); DMIv = DMI(Period); DP = DIPlus(Period); DM = DIMinus(Period); 2). volumn ratio(10) 1) 매수: DMIv가 20 이상 이고 volume ratio가 90 상향시 에서 즉시 매수 2) 매수: volume ratio가 90 이상 이고 DMIv가 20 상향시 즉시 매수 2) 매도: Volume ratio가 90 이하로 하락시 즉시매도 3) 매도: DMIv가 20 이하로 하락시 즉시 매도 2 data2를 이용항식 1). Input : Period(5) ; var : DMIv(0),DP(0),DM(0); DMIv = DMI(Period); DP = DIPlus(Period); DM = DIMinus(Period); 2). volumn ratio(10) 1) 매수: data2(DMIv)가 20 이상이고 DMIv가 20 이상 이고 volume ratio가 90 상향시 에서 즉시 매수 2) 매수: data2(Volume Ratio)가 20 이상이고, volume ratio가 90 이상 이고 DMIv가 20 상향시 즉시 매수 2) 매도: Volume ratio가 90 이하로 하락시 즉시매도 3) 매도: DMIv가 20 이하로 하락시 즉시 매도
프로필 이미지
기관장
2025-06-15
193
글번호 191732
시스템
답변완료

전환부탁드립니다.

수식전환부탁드립니다 수식1 m1=ma(C,이평기간); m2=Highest(M1,봉수); m3=Lowest(M1,봉수); EU=M1; EC=(M2+M3)/2; ED=M3; EH=EC(2)<=EC(1) &&EC(1)>EC; EL=EC(2)>=EC(1) &&EC(1)<EC; EU; Valuewhen(1,M2>M2(1),M2); 이평기간 20/ 봉수 20 수식2 a=bbandsup(period1,d1); b=bbandsup(period2,d2); (a+b)/2; period1/20 d1/2 period2/30 d2/2 수식3 m1=ma(C,이평기간); m2=Highest(M1,봉수); m3=Lowest(M1,봉수); EU=M1; EC=(M2+M3)/2; ED=M3; EH=EC(2)<=EC(1) &&EC(1)>EC; EL=EC(2)>=EC(1) &&EC(1)<EC; ED; 이평기간 20/ 봉수 20 수식4 (highest(high,period1)+lowest(low,period1))/2; period1/20
프로필 이미지
이대표
2025-06-15
195
글번호 191731
지표