커뮤니티

예스랭귀지 Q&A

글쓰기
답변완료

문의

아래 수식은 국내 데이트레이딩 하루 2회 거래하는 수식입니다. 첫번째 진입(b1)에서 익절로 포지션을 청산했을 경우 거래를 중지하는 수식을 추가해주십시요. b1 익절 이후 b2 진입은 성공율이 낮기 때문입니다. 항상 고맙습니다. ************************************************************************************** Input : 최대(99999),최소(0),거래횟수(2); input : lock1(103000),b1(9),진입눌림1(4),진입돌파1(2); input : lock2(113000),b2(18),진입눌림2(3),진입돌파2(1); input : als(50),atr1(0),atr2(32),agl(128); input : bls(38),btr1(0),btr2(90),bgl(108); var : T1(0,data1),entry(0,data1); var : LL(0,data2),EH(0,data2),E1(0,data2),H1(0,data2); var : i1(0,data2),S1(0,data2),L1(0,data2); var : DH2(0,data2),DL2(0,data2); if data1(Bdate != Bdate[1]) Then T1 = TotalTrades; if data2(Bdate != Bdate[1]) Then{ E1 = 0; DH2 = data2(H); DL2 = data2(L); } if data2(H > DH2) Then DH2 = data2(H); if data2(L < DL2) Then DL2 = data2(L); if MarketPosition == 0 Then entry = TotalTrades-T1; Else entry = (TotalTrades-T1)+1; if MarketPosition == 0 and entry == 0 Then{ if data2(E1 == 0 and C >= DL2+PriceScale*B1) Then{ E1 = 1; H1 = data2(H); i1 = data2(index); } if data2(E1 == 1 and index > i1) then{ if data2(H > H1) Then H1 = data2(H); if data2(L <= H1-PriceScale*진입눌림1) Then{ E1 = 2; i1 = data2(index); S1 = H1; } } if stime<lock1 and 최대 >= C and C >= 최소 and data2(E1 == 2 and index > i1 and C >= S1+PriceScale*진입돌파1) Then{ buy("b1"); } } if TotalTrades > TotalTrades[1] Then LL = data2(L); if data2(L < LL) Then LL = data2(L); if MarketPosition == 0 and entry >= 1 and entry < 거래횟수 Then{ if data2(E1 == 0 and C >= LL+PriceScale*B2 and C[1] < LL+PriceScale*B2) Then{ E1 = 1; H1 = data2(H); i1 = data2(index); } if data2(E1 == 1 and index > i1) then{ if data2(H > H1) Then H1 = data2(H); if data2(L <= H1-PriceScale*진입눌림2) Then{ E1 = 2; i1 = data2(index); S1 = H1; } } if stime<lock2 and data2(E1 == 2 and index > i1 and C >= S1+PriceScale*진입돌파2) Then{ buy("b2"); } } if MarketPosition== 1 Then { if IsEntryName("b1") == true Then { SetStopLoss(PriceScale*als,PointStop); SetStopTrailing(PriceScale*atr2,PriceScale*atr1,PointStop,1); SetStopProfittarget(PriceScale*agl,PointStop); } Else if IsEntryName("b2") == true Then { SetStopLoss(PriceScale*bls,PointStop); SetStopTrailing(PriceScale*btr2,PriceScale*btr1,PointStop,1); SetStopProfittarget(PriceScale*bgl,PointStop); } Else { SetStopLoss(0); SetStopTrailing(0,0); SetStopProfittarget(0); } }
프로필 이미지
목마와숙녀
2025-07-11
167
글번호 192448
시스템
답변완료

문의드립니다

차트가 주야 복합차트로 쓸때 dayopen 과 금일 평균값이 야걍 거래가 포함되내요.. 주간 아침장 개장시의 시가와 평균값을 계산하고 싶습니다 수식 좀 알려 주세요
프로필 이미지
야할라
2025-07-11
145
글번호 192446
지표
답변완료

문의드립니다

예를 들어 삼성전자 1분 통합차트에서 KRX 차트에서 나오는 dayclose 지표를 만들고 싶습니다 감사합니다
프로필 이미지
여름가을
2025-07-11
142
글번호 192444
지표
답변완료

문의드립니다

input: starttime(90000); var : D1(0,data1),D2(0,data2); D1 = data1((C-CloseD(1))/CloseD(1)*100); D2 = data2((C-CloseD(1))/CloseD(1)*100); if (sDate != sDate[1] and sTime >= StartTime) Then D1 > D2 Then Buy(); D1 < D2 Then ExitLong(); ----------------- 수식이 잘못되서 ㅜㅜ 신호가 안나옵니다 당일용이고 9시 이후 데이타를 참조해서 신호가 나오게 하려고 하고 오후 3시에 청산하는 수식으로 부탁드립니다 감사합니다
프로필 이미지
러블리
2025-07-11
121
글번호 192442
시스템

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

프로필 이미지
요타
2025-07-11
37
글번호 192441
지표
답변완료

신고가 신저가 수식문의

수고 많으십니다. 종가가 아닌 고가와 저가 기준으로 라인을 만들어 보려 하는데 고가는 그려지는데 저가 라인이 그려지질 않네요. 수정 부탁드립니다. 그리고 기간(26)의 저가와 고가가 동시에 상승하는 구간/저가와 고가가 동시에 하락하는 구간에 RED 와 BLUE로 색을 넣는 식도 부탁드립니다. input : 기간(26); if H > highest(H,기간)[1] Then var1 = H; if L < Lowest(L,기간)[1] Then var2 = L; if var1 > 0 Then Plot1(var1,"신고가라인",ReD); if var2 < 0 Then Plot2(var2,"신저가라인",Blue);
프로필 이미지
나도부자1
2025-07-11
137
글번호 192429
지표
답변완료

지표 수식 부탁드립니다.

yt에서 배열을 어떻게 하는지 궁금하군요. // @version=5 indicator("Liquidity Weighted Moving Averages [AlgoAlpha]", overlay = true, timeframe = "", timeframe_gaps = false) // Define liquidity based on volume and price movement priceMovementLiquidity = volume / math.abs(close - open) outlierThreshold = input.int(10, "Outlier Threshold Length") fastMovingAverageLength = input.int(50, "Fast MA length") slowMovingAverageLength = input.int(100, "Slow MA length") // Calculate the boundary for liquidity to identify outliers liquidityBoundary = ta.ema(priceMovementLiquidity, outlierThreshold) + ta.stdev(priceMovementLiquidity, outlierThreshold) // Initialize an array to store liquidity values when they cross the boundary var liquidityValues = array.new_float(5) // Check if the liquidity crosses above the boundary and up-date the array if ta.crossover(priceMovementLiquidity, liquidityBoundary) array.in-sert(liquidityValues, 0, close) // Calculate the Exponential Moving Averages for the close price at the last liquidity crossover fastEMA = ta.ema(array.get(liquidityValues, 0), fastMovingAverageLength) slowEMA = ta.ema(array.get(liquidityValues, 0), slowMovingAverageLength) // Plot the EMAs with dynamic coloring based on their crossover status fastPlot = plot(fastEMA, color = fastEMA > slowEMA ? color.new(#ff1100, 50) : color.new(#00ffbb, 50)) slowPlot = plot(slowEMA, color = fastEMA > slowEMA ? color.new(#ff1100, 50) : color.new(#00ffbb, 50)) // Create a fill between the fast and slow EMA plots with appropriate color based on crossover fill(fastPlot, slowPlot, fastEMA, slowEMA, fastEMA > slowEMA ? color.new(#ff1100, 50) : color.new(#00ffbb, 50), color.new(chart.bg_color, 80))
프로필 이미지
고도산
2025-07-11
194
글번호 192424
지표
답변완료

수식수정

더운 날씨에수고많으십니다. 이전에 작성해주신 수식인데 수정부탁드립니다. 이전의 조건은 - 국내선물 120틱 사용 - 장 운용시간: 09:30~15:10 이후 진입금지/ 15:30 강제청산 - 60이평 상승추세 and 20이평 3봉연속 추세유지(하락)후 2봉연속 상승시 매수 / 2봉연속 하락시 매수청산(60이평 상승추세에서는 매도진입 금지) - 60이평 하락추세 and 20이평 3봉연속 추세유지(하락)후 2봉연속 하락시 매도 / 2봉연속 상승시 매도청산(60이평 하락추세에서는 매수진입 금지) * 이 수식에 추가로 3봉연속 추세유지 와 2봉 연속 상승을 변수로 지정할 수 있게 부탁 드립니다. input : StartTime(93000),EndTime(151000),P1(20),P2(60); var : Tcond(false),mav1(0),mav2(0),T(0),S(0); if (sdate != sdate[1] and stime >= StartTime) or (sdate == sdate[1] and stime >= StartTime and stime[1] < StartTime) Then { Tcond = true; } if (sdate != sdate[1] and stime >= EndTime) or (sdate == sdate[1] and stime >= EndTime and stime[1] < EndTime) Then { Tcond = False; } mav1 = ma(c,P1); mav2 = ma(c,P2); if mav1 > mav1[1] Then T = 1; if mav1 < mav1[1] Then T = -1; if mav2 > mav2[1] Then S = 1; if mav2 < mav2[1] Then S = -1; if Tcond == true Then { if MarketPosition <= 0 and S == 1 and CountIf(T == 1,2) == 2 and CountIf(T== -1,3)[2] == 3 Then Buy("b"); if MarketPosition >= 0 and S == -1 and CountIf(T == -1,2) == 2 and CountIf(T== 1,3)[2] == 3 Then Sell("s"); if MarketPosition == 1 and CountIf(T == -1,2) == 2 Then ExitLong("bx"); if MarketPosition == -1 and CountIf(T == 1,2) == 2 Then ExitShort("sx"); } SetStopEndofday(153000); 감사합니다
프로필 이미지
나도부자1
2025-07-11
141
글번호 192423
시스템
답변완료

수식 수정을 부탁드립니다

트레이딩뷰의 UT BOT 지표를 시스템용 매수 매도로 전환한 식입니다 검증 결과 이상이 없다고 확인되는데 구동하면 논리값이나 논리표현이 와야 한다는 메세지가 뜹니다 늘 건강하세요. Input: Key_Value(1), // Key Vaule. 'This changes the sensitivity' ATR_Period(10), // ATR Period UseHeikinAshi(False); // Signals from Heikin Ashi Candles (이 기능은 예스트레이더에서 별도 구현 필요) Var: xATR(0), // ATR 값 nLoss(0), // 손실 한도 xATRTrailingStop(0),// 트레일링 스톱 값 pos(0), // 추세 방향 (1:상승, -1:하락, 0:중립) src(0), // 계산에 사용될 가격 데이터 (종가 또는 Heikin Ashi 종가) ema(0), // EMA 값 above(False), // 상향 돌파 여부 below(False), // 하향 돌파 여부 BuySignal(False), // 매수 신호 발생 여부 SellSignal(False); // 매도 신호 발생 여부 // 모든 변수를 수식 시작점에서 명확하게 초기화합니다. // 이렇게 하면 컴파일러가 변수들이 사용되기 전에 항상 초기화되었다고 인식할 수 있습니다. xATR = 0; nLoss = 0; xATRTrailingStop = 0; pos = 0; src = Close; // 기본적으로 현재 봉의 종가로 초기화 ema = 0; above = False; below = False; BuySignal = False; SellSignal = False; // Heikin Ashi 캔들 사용 여부에 따라 src 값 결정 // 예스트레이더에서 Heikin Ashi 캔들 데이터를 직접 가져오는 기능이 없으므로, // 이 부분은 일반 종가(Close)를 사용하거나, Heikin Ashi 캔들 계산 로직을 별도로 구현해야 합니다. If UseHeikinAshi Then Begin // Heikin Ashi 캔들 데이터 가져오기 (예스트레이더에서 직접 지원하지 않음, 별도 구현 필요) // 예시: src = HAKENASHI_CLOSE(); 또는 Heikin Ashi 계산 로직 삽입 src = Close; // UseHeikinAshi가 True여도 일단 Close를 사용합니다. (이 부분은 사용자 정의 함수로 대체되어야 합니다.) End Else Begin src = Close; // UseHeikinAshi가 False이면 현재 봉의 종가 사용 End; // ATR 계산 xATR = ATR(ATR_Period); nLoss = Key_Value * xATR; // xATRTrailingStop 계산 // 첫 봉에서는 xATRTrailingStop[1] 값이 없으므로 초기값을 설정해야 합니다. If CurrentBar == 1 Then Begin xATRTrailingStop = src - nLoss; // 첫 봉 초기값 설정 End Else Begin If src > xATRTrailingStop[1] And src[1] > xATRTrailingStop[1] Then Begin xATRTrailingStop = Max(xATRTrailingStop[1], src - nLoss); End Else If src < xATRTrailingStop[1] And src[1] < xATRTrailingStop[1] Then Begin xATRTrailingStop = Min(xATRTrailingStop[1], src + nLoss); End Else If src > xATRTrailingStop[1] Then Begin xATRTrailingStop = src - nLoss; End Else Begin xATRTrailingStop = src + nLoss; End; End; // pos (추세 방향) 계산 If CurrentBar == 1 Then Begin pos = 0; // 첫 봉 초기값 End Else Begin If src[1] < xATRTrailingStop[1] And src > xATRTrailingStop[1] Then Begin pos = 1; // 상승 추세 전환 End Else If src[1] > xATRTrailingStop[1] And src < xATRTrailingStop[1] Then Begin pos = -1; // 하락 추세 전환 End Else Begin pos = pos[1]; // 이전 추세 유지 End; End; // EMA (period 1은 사실상 src와 동일) ema = src; // EMA(src, 1)은 src와 동일합니다. // 교차 신호 // 'Cross' 대신 'CrossUp'과 'CrossDown' 함수를 사용합니다. // 라인 81: ema가 xATRTrailingStop을 상향 돌파 above = CrossUp(ema, xATRTrailingStop); // 라인 82: xATRTrailingStop이 ema를 상향 돌파 == ema가 xATRTrailingStop을 하향 돌파 below = CrossDown(ema, xATRTrailingStop); // 매수/매도 신호 조건 BuySignal = (src > xATRTrailingStop) And above; SellSignal = (src < xATRTrailingStop) And below; // 매수/매도 명령 If BuySignal Then Begin Buy("UT_Buy"); End; If SellSignal Then Begin Sell("UT_Sell"); End;
프로필 이미지
장보고153
2025-07-11
166
글번호 192422
시스템
답변완료

문의 드립니다.

기준가 매수 로직에서 청산가도 입력할 수 있도록 추가 부탁드립니다. 매도용도 각각 나누어서 부탁드립니다. input : Price(13641.50); if crossup(C,price) Then buy(); if CrossDown(C,price) Then ExitLong();
프로필 이미지
선물대장
2025-07-10
147
글번호 192421
시스템