커뮤니티

예스랭귀지 Q&A

글쓰기
답변완료

수식작성 부탁드립니다.

안녕하세요. 운영자님 이번에 부탁드릴 조건은 매수진입/청산조건 : RSI(7) > RSI(14) > RSI(21) 인경우 매수 진입하고 조건 불만족될때 청산 매도진입/청산조건 : RSI(7) < RSI(14) < RSI(21) 인경우 매도 진입하고 조건 불만족될때 청산 무더운 여름 건강에 유의하세요
프로필 이미지
고박사122
2025-08-31
134
글번호 193618
시스템
답변완료

조건검색식으로 구현이 안됩니다 ls 증권

조건검색 해볼려 했는데 안되네요 cci 과매도이탈 기간 20 , 기준값 -100 willams r 과매도진입 기간 14 기준값 -82 이 두 지표가 일봉기준으로 같은 날짜에 겹치거나 둘중에 하나만 만족되면 조건검색에서 종목을 찾으려고 하는데 적용이 안되네요 1892 화면에서 어떻게 설정해야 만족이 되는지 모르겠어요
프로필 이미지
dla1224
2025-08-31
404
글번호 193617
검색
답변완료

RSI 이용한 진입식 부탁 드립니다.

최근 XX봉 중에 RSI가 30 이하로 3번이상 빠졌다가 30이상으로 상향돌파시에 매수하는 시스템 진입식 좀 부탁드립니다. 주말이라 다른 분들도 요청이 많아서...죄송합니다. ^^;;
프로필 이미지
uncle
2025-08-31
129
글번호 193616
시스템

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

프로필 이미지
요타
2025-08-31
4
글번호 193615
지표

느와르 님에 의해서 삭제되었습니다.

프로필 이미지
느와르
2025-08-31
0
글번호 193614
종목검색
답변완료

종목 검색 부탁드립니다.

신=H-L; 호=MAX(C,O)-L; 조건=신/호>2 && H/C(1)>(1+15/100); valuewhen(1,조건,H); 돌파 검색식 부탁 드립니다
프로필 이미지
골든도라도
2025-08-31
182
글번호 193613
종목검색
답변완료

문의드립니다.

수고많으십니다. 제가 질문을 잘 못한거 같아 다시 문의드립니다. 연속 2양봉후 3번째 양봉에서 매수(즉, 진입봉 포함 연속 3양봉시 매수)진입후 이어서 연속 3음봉일 때 청산하는 식도 구하고 싶습니다. 즉, 3양봉이라서 매수신호가 나왔는데 바로 3음봉으로 꺽이면 청산하는 식입니다. 결국 양봉, 양봉, 양봉(매수신호 발생)후 이어서 음봉, 음봉, 음봉이 연달아 나오면 청산입니다.
프로필 이미지
카르마다
2025-08-31
113
글번호 193612
시스템
답변완료

지표작성부탁드립니다

사용지표: 볼린져밴드(20 2)와 덧붙임 지표 지표식조건 : 붙임지표의 상단선이 볼린져밴드(20) 상단선 위에 있으면 차트바탕에 노란색으로 표시되는 지표식 부탁합니다 덧붙임 : 붙임 지표식 input : period(10),multiplier(3); var : src(0), AtrV(0),upperBand(0),lowerBand(0), prevLowerBand(0), prevUpperBand(0); var : prevSuperTrend(0), direction(0),alpha(0),source(0),SuperTrend(C); if CurrentBar > 1 Then { src = (H+L)/2; alpha = 1 / period ; source = max(high - low, abs(high - close[1]), abs(low - close[1])); ATrV = alpha * source + (1 - alpha) * ATrV[1]; //지수가중이평방식 //ATrV = ma(source,AtrPeriod); //단순이평방식 upperBand = src + multiplier * AtrV; lowerBand = src - multiplier * AtrV; prevLowerBand = lowerBand[1]; prevUpperBand = upperBand[1]; if lowerBand > prevLowerBand or close[1] < prevLowerBand Then lowerBand = lowerBand; Else lowerBand = prevLowerBand; if upperBand < prevUpperBand or close[1] > prevUpperBand Then upperBand = upperBand; Else upperBand = prevUpperBand; if C > UpperBand Then direction = 1; if C < LowerBand Then direction = -1; if direction == 1 Then SuperTrend = lowerband; Else SuperTrend = upperband; Plot1(SuperTrend,"SuperTrend",IFF(direction==1,Red,Blue)); }
프로필 이미지
파워
2025-08-30
197
글번호 193611
지표
답변완료

어떻게 고쳐야 할까요?

Inputs: UseRealMBO(False), { True: 실 Bid/Ask 체결량 함수 사용, False: 업틱/다운틱 근사 } MBOLen(30), { MBO 누적 길이(분) } MBOSmooth(10), ATR_Len(14), ST_ATRMult(2.0), { SuperTrend ATR 배수 } EMA_Len(20), { 추세평균(EMA) } RSI_Len(14), CCI_Len(20), LearnRate(0.02), { 학습률 η } L2Decay(0.001), { L2 정규화 λ } ScoreThreshold(0.15), { 관망 데드존 |score|<=thr } MaxLots(3), { 최대 계약수 (미니 기준) } BaseLots(1), { 최소 계약수 } RiskATR_SL(2.0), { 고정 손절: ATR x N } RiskATR_Trail(3.0), { 트레일링: ATR x N } DayLossLimit_KRW(300000), { 1일 손실한도 } DayProfitTarget_KRW(200000), { 1일 이익목표 } PointValue(100000), { 미니선물 1pt=100,000원 } TickSize(0.05), CostPerRt_KRW(10000), { 왕복 비용(수수료+슬리피지) 가정값/계약 } UseVWAPFilter(True), UseTimeFilter(True); { 09:15~09:45, 13:30~14:30만 진입 } Vars: { --- Intraday VWAP --- } CumPV(0), CumV(0), VWAP(0), { --- MBO (업틱-다운틱 근사 or 실체결량) --- } UpV(0), DownV(0), AskV(0), BidV(0), MBO_1m(0), MBO_30(0), MBO_30_S(0), { --- SuperTrend --- } atr(0), basicU(0), basicL(0), finalU(0), finalL(0), STdir(0), { --- 기타 인디케이터 --- } ema(0), rsi(0), cci(0), { --- AI 가중치 (features 1..6) --- } w1(0), w2(0), w3(0), w4(0), w5(0), w6(0), x1(0), x2(0), x3(0), x4(0), x5(0), x6(0), score(0), action(0), { action ∈ {-1,0,1} } ret_pt(0), reward_pt(0), { --- P&L/리스크 관리 --- } DayPnL_KRW(0), LastClose(0), Lots(0), StopPx(0), TrailPx(0), canEnter(False), inTime(False), { --- 유틸 --- } i(0); /* ========= 0) 일중 리셋 ========= */ If Date <> Date[1] then begin CumPV = 0; CumV = 0; DayPnL_KRW = 0; TrailPx = 0; StopPx = 0; end; /* ========= 1) VWAP 업데이트 ========= */ atr = AvgTrueRange(ATR_Len); If CumV = 0 then begin CumPV = Close * Volume; CumV = Volume; end else begin CumPV = CumPV + Close * Volume; CumV = CumV + Volume; end; If CumV > 0 then VWAP = CumPV / CumV else VWAP = Close; /* ========= 2) SuperTrend 계산 (기본형) ========= */ basicU = (High + Low) * 0.5 + ST_ATRMult * atr; basicL = (High + Low) * 0.5 - ST_ATRMult * atr; If CurrentBar = 1 then begin finalU = basicU; finalL = basicL; STdir = 1; end else begin finalU = minlist(basicU, IFF(Close[1] > finalU[1], basicU, finalU[1])); finalL = maxlist(basicL, IFF(Close[1] < finalL[1], basicL, finalL[1])); If Close > finalU[1] then STdir = 1 else if Close < finalL[1] then STdir = -1 else STdir = STdir[1]; If STdir > 0 then finalL = maxlist(finalL, finalL[1]); If STdir < 0 then finalU = minlist(finalU, finalU[1]); end; /* ========= 3) EMA/RSI/CCI ========= */ ema = XAverage(Close, EMA_Len); rsi = RSI(RSI_Len); cci = CCI(CCI_Len); /* ========= 4) MBO (1분 단위 근사) ========= UseRealMBO = True일 때 AskV/BidV를 실 함수명으로 교체 */ If UseRealMBO then begin { 예: AskV = AskTradeVol; BidV = BidTradeVol; <-- 플랫폼 함수명으로 교체 } AskV = 0; BidV = 0; MBO_1m = AskV - BidV; end else begin If Close >= Close[1] then UpV = Volume else UpV = 0; If Close < Close[1] then DownV = Volume else DownV = 0; MBO_1m = UpV - DownV; end; MBO_30 = Summation(MBO_1m, MBOLen); MBO_30_S = Average(MBO_30, MBOSmooth); /* ========= 5) 피처 벡터 x ========= 안정화를 위해 ATR/Close 등으로 정규화하고, -3~+3으로 클리핑 */ { x1: 모멘텀(수익률/ATR) } x1 = (Close - Close[1]) / MaxList(atr, 0.00001); { x2: RSI 정규화 } x2 = (rsi - 50) / 50; { x3: CCI 정규화 } x3 = cci / 100; { x4: VWAP 위치 (상회=+, 하회=-) } x4 = (Close - VWAP) / MaxList(atr, 0.00001); { x5: 변동성 레짐 (ATR/Close) } x5 = (atr / MaxList(Close, 0.00001)); { x6: 수급(MBO 30분, 스무딩) 정규화 } x6 = MBO_30_S / MaxList(Average(Volume, MBOLen), 1); { 클리핑 } x1 = MaxList(-3, MinList(3, x1)); x2 = MaxList(-3, MinList(3, x2)); x3 = MaxList(-3, MinList(3, x3)); x4 = MaxList(-3, MinList(3, x4)); x5 = MaxList(-3, MinList(3, x5)); x6 = MaxList(-3, MinList(3, x6)); /* ========= 6) 정책 점수 score = w·x ========= */ score = w1*x1 + w2*x2 + w3*x3 + w4*x4 + w5*x5 + w6*x6; /* ========= 7) 시간대 필터 ========= */ inTime = True; If UseTimeFilter then begin inTime = (Time >= 0950 ; end; /* ========= 8) 액션 선택 (롱/숏/관망) ========= */ action = 0; If inTime then begin If score > ScoreThreshold then action = 1; If score < -ScoreThreshold then action = -1; end; /* ========= 9) 포지션 사이징 (간단 켈리풍; 변동성 억제) ========= */ Lots = BaseLots; If atr > 0 then begin { 위험회피: 변동성 높을수록 수량 축소 } Lots = BaseLots + IFF(atr/Close < 0.007, 1, 0); { 대략 0.7% 미만이면 +1 } Lots = MinList(Lots, MaxLots); end; /* ========= 10) 1일 손익 한도 체크 ========= */ { 직전 바 대비 손익 업데이트 (보유 포지션 기반) } If MarketPosition = 1 then DayPnL_KRW = DayPnL_KRW + (Close - Close[1]) * PointValue * CurrentContracts else if MarketPosition = -1 then DayPnL_KRW = DayPnL_KRW + (Close[1] - Close) * PointValue * CurrentContracts; canEnter = (DayPnL_KRW > -DayLossLimit_KRW) and (DayPnL_KRW < DayProfitTarget_KRW); /* ========= 11) 진입/청산 로직 ========= */ { 신호와 반대 포지션 보유 시 우선 청산 } If MarketPosition = 1 and action <= 0 then Sell ("ExitLongSig") all contracts next bar at market; If MarketPosition = -1 and action >= 0 then BuyToCover ("ExitShortSig") all contracts next bar at market; { 신규 진입 (한 방향만) } If canEnter then begin If MarketPosition <> 1 and action = 1 then begin If (not UseVWAPFilter) or (Close > VWAP) then Buy ("AI-Long") Lots contracts next bar at market; end; If MarketPosition <> -1 and action = -1 then begin If (not UseVWAPFilter) or (Close < VWAP) then SellShort ("AI-Short") Lots contracts next bar at market; end; end; /* ========= 12) 리스크 관리: ATR 손절 + 트레일링 ========= */ If MarketPosition = 1 then begin StopPx = EntryPrice - RiskATR_SL * atr; TrailPx = MaxList(TrailPx, Close - RiskATR_Trail * atr); If Low <= StopPx then Sell ("SL-L") all contracts next bar at market else if Low <= TrailPx then Sell ("TR-L") all contracts next bar at market; end; If MarketPosition = -1 then begin StopPx = EntryPrice + RiskATR_SL * atr; TrailPx = MinList(TrailPx, Close + RiskATR_Trail * atr); If High >= StopPx then BuyToCover ("SL-S") all contracts next bar at market else if High >= TrailPx then BuyToCover ("TR-S") all contracts next bar at market; end; /* ========= 13) 보상 계산(온라인 학습) ========= - 포지션 방향 × (당일 한 바 수익) [포인트 단위] - 비용 차감(왕복비용을 바 단위로 균등 가정 - 근사) */ ret_pt = (Close - Close[1]); { 해당 바의 포인트 변화 } If MarketPosition = 1 then reward_pt = ret_pt else if MarketPosition = -1 then reward_pt = -ret_pt else reward_pt = 0; { 비용 근사: 포지션 있을 때만 소폭 차감 } If MarketPosition <> 0 then reward_pt = reward_pt - (CostPerRt_KRW/PointValue) * 0.05; /* ========= 14) 가중치 업데이트: w <- (1-λ)w + η * reward * x ========= */ w1 = (1 - L2Decay) * w1 + LearnRate * reward_pt * x1; w2 = (1 - L2Decay) * w2 + LearnRate * reward_pt * x2; w3 = (1 - L2Decay) * w3 + LearnRate * reward_pt * x3; w4 = (1 - L2Decay) * w4 + LearnRate * reward_pt * x4; w5 = (1 - L2Decay) * w5 + LearnRate * reward_pt * x5; w6 = (1 - L2Decay) * w6 + LearnRate * reward_pt * x6; 예스시스템 언어로 어떻게 고쳐야 할까요?
프로필 이미지
드림365
2025-08-30
273
글번호 193610
시스템
답변완료

부틱드립니다

수고하십니다 키움수식을 예스로 부탁드립니다 수식1 x=sum(c*v); z=valuewhen(1,date != date(1) , x(1)); x1=sum(v); z1=valuewhen(1,date != date(1) , x(1)); (x-z)/(x1-z1) 수식2 x=sum(((h+l+c)/3)*v); z=valuewhen(1,date != date(1) , x(1)); x1=sum(v); z1=valuewhen(1,date != date(1) , x(1)); (x-z)/(x1-z1)
프로필 이미지
파생돌이
2025-08-30
164
글번호 193609
지표