커뮤니티

예스랭귀지 Q&A

글쓰기
답변완료

시스템 수식 검증

아래 수식 들을 검증 부탁 드립니다.특히 중괄호 부분들이 잘 되어 있는지 검토 부탁드립니다.[수식1]input : 시작일(20260101),시작시간(090000);input : 이평1(180),이평2(15);input : 윌리엄스R기간값(14);input : 손절틱수(100),목표틱수(200),트레일링스탑틱수(100);var : mav1(0),WR(0);if sdate >= 시작일 and sTime >= 시작시간 Then{Condition1 = true;Condition2 = true;}MAV1 = MA(c,이평1);WR = WILLR(윌리엄스R기간값);if TotalTrades > TotalTrades and IsExitName("StopLoss",1) ==true ThenCondition2 = False;if Condition1 == true and Condition2 == true Then{if MarketPosition == 0 and c < mav1 and CrossDown(WR, -20) ThenSell("s");if MarketPosition == -1 Then{if lowest(L,BarsSinceEntry) <= EntryPrice-PriceScale*목표틱수 ThenExitShort("str",AtStop,EntryPrice-PriceScale*트레일링스탑틱수);}SetStopLoss(PriceScale*손절틱수,PointStop);}[수식2]input : 시작일(20260101),시작시간(090000);input : 이평1(180),이평2(15);input : 윌리엄스R기간값(14);input : 손절틱수(100),목표틱수(200),트레일링스탑틱수(100);var : mav1(0),WR(0);if sdate >= 시작일 and sTime >= 시작시간 Then{Condition1 = true;Condition2 = true;}MAV1 = MA(c,이평1);WR = WILLR(윌리엄스R기간값);if TotalTrades > TotalTrades and IsExitName("StopLoss",1) ==true ThenCondition2 = False;if Condition1 == true and Condition2 == true Then{if MarketPosition == 0 and c > mav1 and CrossUP(WR, -80) ThenBuy("b");if MarketPosition == 1 Then{if highest(H,BarsSinceEntry) >= EntryPrice+PriceScale*목표틱수 Then ExitLong("btr",AtStop,EntryPrice+PriceScale*트레일링스탑틱수); }SetStopLoss(PriceScale*손절틱수,PointStop);}[수식3]input : 시작일(20260101),시작시간(090000);input : 이평1(30);input : 윌리엄스R기간값(90);input : 손절틱수(140),청산틱수(240);var : mav1(0),WR(0);if sdate >= 시작일 and sTime >= 시작시간 Then{ Condition1 = true; Condition2 = true;}MAV1 = MA(c,이평1);WR = WILLR(윌리엄스R기간값);if TotalTrades > TotalTrades and IsExitName("StopLoss",1) ==true Then Condition2 = False;if Condition1 == true and Condition2 == true Then{ if MarketPosition == 0 and CrossUP(WR, -80) Then Buy("b"); if MarketPosition == 1 Then { if highest(H,BarsSinceEntry) >= EntryPrice+PriceScale*청산틱수 Then if CrossDown(C,mav1) Then ExitLong("bx"); } SetStopLoss(PriceScale*손절틱수,PointStop);}[수식4]input : 시작일(20260101),시작시간(090000);input : 이평1(30);input : 윌리엄스R기간값(90);input : 손절틱수(140),청산틱수(240);var : mav1(0),WR(0);if sdate >= 시작일 and sTime >= 시작시간 Then{ Condition1 = true; Condition2 = true;}MAV1 = MA(c,이평1);WR = WILLR(윌리엄스R기간값);if TotalTrades > TotalTrades and IsExitName("StopLoss",1) ==true Then Condition2 = False;if Condition1 == true and Condition2 == true Then{ if MarketPosition == 0 and CrossDown(WR, -20) Then Sell("s");}if MarketPosition == -1 Then{ if lowest(L,BarsSinceEntry) <= EntryPrice-PriceScale*청산틱수 Then if CrossUp(C,mav1) Then ExitShort("sx"); }SetStopLoss(PriceScale*손절틱수,PointStop);[수식5]input : 시작일(20251101),시작시간(090000);input : 이평1(30),이평2(240);input : 손절틱수(150),청산틱수(300);var : mav1(0),mav2(0);if sdate >= 시작일 and sTime >= 시작시간 Then{Condition1 = true;Condition2 = true;}MAV1 = MA(c,이평1);MAV2 = MA(c,이평2);if TotalTrades > TotalTrades and IsExitName("StopLoss",1) ==true ThenCondition2 = False;if Condition1 == true and Condition2 == true Then{if MarketPosition == 0 and CrossDown(c, mav1) ThenSell("s");if MarketPosition == 1 Then{if highest(H,BarsSinceEntry) <= EntryPrice+PriceScale*청산틱수 Thenif CrossDown(C,mav2) ThenExitLong("sx"); } SetStopLoss(PriceScale*손절틱수,PointStop);}[수식6]input : 시작일(20251101),시작시간(090000);input : 이평1(30),이평2(240);input : 손절틱수(150),청산틱수(300);var : mav1(0),mav2(0);if sdate >= 시작일 and sTime >= 시작시간 Then{Condition1 = true;Condition2 = true;}MAV1 = MA(c,이평1);MAV2 = MA(c,이평2);if TotalTrades > TotalTrades and IsExitName("StopLoss",1) ==true ThenCondition2 = False;if Condition1 == true and Condition2 == true Then{if MarketPosition == 0 and CrossUp(c, mav1) ThenBuy("b");if MarketPosition == 1 Then{if highest(H,BarsSinceEntry) >= EntryPrice+PriceScale*청산틱수 Thenif CrossDown(C,mav2) ThenExitLong("bx"); } SetStopLoss(PriceScale*손절틱수,PointStop);}[수식7]input : 시작일(20260101),시작시간(090000);input : 이평1(180),이평2(15);input : 윌리엄스R기간값(14);input : 손절틱수(100),목표틱수(200),트레일링스탑틱수(100);var : mav1(0),WR(0);if sdate >= 시작일 and sTime >= 시작시간 Then{Condition1 = true;Condition2 = true;}MAV1 = MA(c,이평1);WR = WILLR(윌리엄스R기간값);if TotalTrades > TotalTrades and IsExitName("StopLoss",1) ==true ThenCondition2 = False;if Condition1 == true and Condition2 == true Then{if MarketPosition == 0 and c < mav1 and CrossDown(WR, -20) ThenSell("s");if MarketPosition == -1 Then{if lowest(L,BarsSinceEntry) <= EntryPrice-PriceScale*목표틱수 ThenExitShort("str",AtStop,EntryPrice-PriceScale*트레일링스탑틱수);}SetStopLoss(PriceScale*손절틱수,PointStop);}[수식8]input : 시작일(20260101),시작시간(090000);input : 이평1(180),이평2(15);input : 윌리엄스R기간값(14);input : 손절틱수(100),목표틱수(200),트레일링스탑틱수(100);var : mav1(0),WR(0);if sdate >= 시작일 and sTime >= 시작시간 Then{Condition1 = true;Condition2 = true;}MAV1 = MA(c,이평1);WR = WILLR(윌리엄스R기간값);if TotalTrades > TotalTrades and IsExitName("StopLoss",1) ==true ThenCondition2 = False;if Condition1 == true and Condition2 == true Then{if MarketPosition == 0 and c > mav1 and CrossUP(WR, -80) ThenBuy("b");if MarketPosition == 1 Then{if highest(H,BarsSinceEntry) >= EntryPrice+PriceScale*목표틱수 Then ExitLong("btr",AtStop,EntryPrice+PriceScale*트레일링스탑틱수); }SetStopLoss(PriceScale*손절틱수,PointStop);}이상입니다.수고하세요..
프로필 이미지
블루3
2026-01-23
78
글번호 230007
시스템
답변완료

수고하십니다

항상 좋은 일만 있으시기 바랍니다psar지표를 연결psar로 색상을변경 요청 합니다현재는 음구간청색 양구간적색인데직전구간고가첫점을 돌파 하지 않으면 음구간 청색유지직전구간저가첫점을 이탈 하지 않으면 양구간 적색유지하게 색상을 변경 요청 합니다
프로필 이미지
2wnwn
2026-01-23
44
글번호 230006
지표
답변완료

경과봉 조정

아래수식은 국내지수선물데이트레이딩 수식입니다.진입명 b1,b2로 2회 거래합니다.요청사항b2진입시 경과봉 필터가 있습니다.이 경과봉에 조건을 하나 추가하고 싶습니다.기존 경과봉은 그대로 수행됩니다.단, b1이 트레일링스탑으로 포지션이 청산되었을 경우b2의 기존 경과봉이 새로운 경과봉으로 조정되는 수식입니다.ex)input : 경과봉(150), 조정경과봉(200),b2(1),진입눌림2(0),진입돌파2(0);항상 고맙습니다.****************************************************************************************************************************input : 진입시간(084500),진입제한시간(150000);input : 거래횟수(2),누적패수(2),연속패수(2),누적패수조정(2);input : b1(1),진입눌림1(0),진입돌파1(0);input : 경과봉(150),b2(1),진입눌림2(0),진입돌파2(0);input : als(21),atr1(0),atr2(999999);input : bls(40),btr1(0),btr2(999999);var : T1(0),entry(0),LL(0),EH(0),E1(0),H1(0),i1(0),S1(0),L1(0),V1(0);var : Tcond(false);var : loss(0),consecLoss(0),패수(0);//영업일변경if bdate != bdate[1] Then{//손실횟수 초기화 0loss = 0;//연속손실횟수 초기화 0consecLoss = 0;//패수는 누적패수패수 = 누적패수;}//청산발생if TotalTrades > TotalTrades[1] Then{//손실이면if PositionProfit(1) < 0 Then{//loss 1씩 증가loss = loss+1;//consecLoss 1씩 증가consecLoss = consecLoss+1;//consecLoss이 3이면 패수를 누적패수에서 누적패수조정으로 변경if consecLoss == 연속패수 Then{패수 = 누적패수조정;}}Else //손실이 아니면 consecLoss으로 초기화consecLoss = 0;}if (sdate != sdate[1] and stime >= 진입시간) or (sdate == sdate[1] and stime >= 진입시간 and stime[1] < 진입시간) Then Tcond = true; if (sdate != sdate[1] and stime >= 진입제한시간) or (sdate == sdate[1] and stime >= 진입제한시간 and stime[1] < 진입제한시간) Then Tcond = false; if (sdate != sdate[1] and stime >= 진입시간) or (sdate == sdate[1] and stime >= 진입시간 and stime[1] < 진입시간) Then{ T1 = TotalTrades; E1 = 0; LL = L;}if stime >= 진입시간 then{ if L < LL Then LL = L; if MarketPosition == 0 Then entry = TotalTrades-T1; Else entry = (TotalTrades-T1)+1; if MarketPosition == 0 and entry == 0 Then{ if E1 == 0 and C >= LL+PriceScale*B1 Then{ E1 = 1; H1 = H; i1 = index; V1 = LL; //시작점 종가 } if E1 == 1 and index > i1 then{ if H > H1 Then H1 = H; #저가가 시작봉종가보다 클때만 눌림체크 if L >= V1 and L <= H1-PriceScale*진입눌림1 Then{ E1 = 2; i1 = index; S1 = H1; } } //시작점 종가보다 낮은 가격이 발생하면 초기화 if E1 >= 1 and L < V1 Then{ E1 = 0; LL = L; } if loss < 패수 and E1 == 2 and index > i1 and C >= S1+PriceScale*진입돌파1 and Tcond == true Then{ buy("b1"); } } if TotalTrades > TotalTrades[1] Then{ E1 = 0; LL = L; } if L < LL Then LL = L; if MarketPosition == 0 and entry >= 1 and entry < 거래횟수 Then{ if E1 == 0 and C >= LL+PriceScale*B2 Then{ E1 = 1; H1 = H; i1 = index; V1 = LL; //시작점 종가 } if E1 == 1 and index > i1 then{ if H > H1 Then H1 = H; #저가가 시작봉종가보다 클때만 눌림체크 if L >= V1 and L <= H1-PriceScale*진입눌림2 Then{ E1 = 2; i1 = index; S1 = H1; } } //시작점 종가보다 낮은 가격이 발생하면 초기화 if E1 >= 1 and L < V1 Then{ E1 = 0; LL = L; } if loss < 패수 and (TotalTrades == 0 or (TotalTrades >= 1 and BarsSinceExit(1) > 경과봉)) and loss < 누적패수 and E1 == 2 and index > i1 and C >= S1+PriceScale*진입돌파2 and Tcond == true Then{ buy("b2"); } }}if MarketPosition== 1 Then{ if IsEntryName("b1") == true Then { SetStopLoss(PriceScale*als,PointStop); SetStopTrailing(PriceScale*atr2,PriceScale*atr1,PointStop,1); } Else if IsEntryName("b2") == true Then { SetStopLoss(PriceScale*bls,PointStop); SetStopTrailing(PriceScale*btr2,PriceScale*btr1,PointStop,1); } Else { SetStopLoss(0);SetStopTrailing(0,0); }}
프로필 이미지
목마와숙녀
2026-01-23
57
글번호 230004
시스템
답변완료

수정을 부탁드립니다.

안녕하세요?아래 수식중 Plot1, Plot17 "당일매수거래량을 0을 기준으로 RGB를 표기하도록 되어있는데요이것을 피보나티비울 50% 기준으로 추가하거나 수정해 주세요늘 도와주심에 감사드립니다.오늘 남은시간도 즐거운시간되세요===========================input : Change(500), 캔들수(-12);var : HH(0),LL(0);var : HD(0),HT(0),HV(0);var : LD(0),LT(0),LV(0);var : UpTrend(false),DownTrend(False),Trend(0);var : TX1(0),TX2(0),TX3(0),TX4(0);if Bdate != Bdate[1] Then{ var1 = 0; Var2 = Upvol-DownVol;}var1 = var1 + (Upvol-DownVol);if Bdate != Bdate[1] Then{ HD = sDate; HT = sTime; HV = var1; LD = sDate; LT = sTime; LV = var1; trend = 0; if CurrentDate == sDate Then { tx1 = Text_New_Self(HD,HT,HV,"----------------"); Text_SetStyle(tx1,2,0); Text_SetColor(tx1,Magenta); tx3 = Text_New(HD,HT,H,"고----------------"); Text_SetStyle(tx3,2,0); Text_SetColor(tx3,Magenta); tx2 = Text_New_Self(LD,LT,LV,"----------------"); Text_SetStyle(tx2,2,0); Text_SetColor(tx2,blue); tx4 = Text_New(LD,LT,L,"저----------------"); Text_SetStyle(tx4,2,0); Text_SetColor(tx4,blue); } hh = var1; ll = var1;}Else{ if var1 > hh Then hh = var1; if var1 < ll Then ll = var1; UpTrend = var1 >= LV[0]+Change; DownTrend = var1 <= HV[0]-Change; if trend <= 0 and UpTrend == true Then { trend = 1; HD = sDate; HT = sTime; HV = var1; if CurrentDate == sDate Then { tx1 = Text_New_Self(HD,HT,HV,"----------------"); Text_SetStyle(tx1,2,0); Text_SetColor(tx1,Magenta); tx3 = Text_New(HD,HT,H,"----------------"); Text_SetStyle(tx3,2,0); Text_SetColor(tx3,Magenta); } } Else if trend >= 0 and DownTrend Then { trend = -1; LD = sDate; LT = sTime; LV = var1; if CurrentDate == sDate Then { tx2 = Text_New_Self(LD,LT,LV,"----------------"); Text_SetStyle(tx2,2,0); Text_SetColor(tx2,blue); tx4 = Text_New(LD,LT,L,"----------------"); Text_SetStyle(tx4,2,0); Text_SetColor(tx4,blue); } } Else { if trend == 1 Then { if var1 > HV Then { HD = sDate; HT = sTime; HV = var1; if CurrentDate == sDate Then { Text_SetLocation(TX1,HD,HT,HV); Text_SetLocation(TX3,HD,HT,H); } } } if trend == -1 Then { if var1 < LV Then { LD = sDate; LT = sTime; LV = var1; if CurrentDate == sDate Then { Text_SetLocation(TX2,LD,LT,LV); Text_SetLocation(TX4,LD,LT,L); } } } if trend == 0 Then { if var1 > HV Then { HD = sDate; HT = sTime; HV = var1; if CurrentDate == sDate Then { Text_SetLocation(TX1,HD,HT,HV); Text_SetLocation(TX3,HD,HT,H); } } if var1 < LV Then { LD = sDate; LT = sTime; LV = var1; if CurrentDate == sDate Then { Text_SetLocation(TX2,LD,LT,LV); Text_SetLocation(TX4,LD,LT,L); } } } }} if CurrentDate == sDate Then{ Plot1(var1,"당일실매수거래량",iff(var1 > 0,RGB(200,0,0),RGB(0,0,0))); FixPlotShift(1,캔들수); Plot17(var1,"당일실매수거래량2",iff(var1 > 0,RGB(255,0,0),RGB(0,0,255))); Plot3(hh,"최고"); plot4(ll,"최저"); plot5(ll+(hh-ll)*0.25,"25.0%"); plot6(ll+(hh-ll)*0.382,"38.2%"); plot7(ll+(hh-ll)*0.500,"50.0%"); plot8(ll+(hh-ll)*0.505,"50.05%"); plot9(ll+(hh-ll)*0.515,"51.5%"); plot10(ll+(hh-ll)*0.495,"49.5%"); plot13(ll+(hh-ll)*0.485,"48.5%"); plot14(ll+(hh-ll)*0.618,"61.8%"); plot15(ll+(hh-ll)*0.75,"75.0%"); plot18(ll+(hh-ll)*0.125,"12.5%"); plot19(ll+(hh-ll)*0.875,"87.5%"); plot20(ll+(hh-ll)*0.127,"12.7%"); plot21(ll+(hh-ll)*0.877,"87.7%"); plot22(ll+(hh-ll)*0.755,"75.5%"); plot23(ll+(hh-ll)*0.255,"25.5%"); plot40((Var2/2),"첫봉종가50%");} if CurrentDate == sDate Then{ PlotBaseLine2(1000); PlotBaseLine3(500); PlotBaseLine4(100); } PlotBaseLine1(0);
프로필 이미지
포보스
2026-01-22
75
글번호 230002
지표
답변완료

종목 검색식 부탁드립니다.

항상 고맙고 감사 드립니다.양봉캔들이 1.Envelope저항선 돌파 2.캔들이동평균선 5일선 돌파-3.캔들볼린저 상단선돌파 정배열종목 검색 수식어 부탁드립니다.1.볼린저 상단선 수식-BBandsUp(Period,D1)지표조건설정-Period 30 D1-1.52.가격이동평균선 5일선3.Envelope 수식-저항선 EnvelopeUp(Period,Percent)지표조건설정-Period 20 Percent 5
프로필 이미지
치치야
2026-01-22
60
글번호 230001
종목검색
답변완료

수식 요청드립니다.

안녕하세요. 피라미딩으로 누적 5계약까지 매수 또는 매도 진입 후 청산조건이 달성되면 한번에 청산이 되는 시스템을 운용하고 있습니다.위와 같은 시스템에다가 청산 후 20분간은 재진입되지 않도록 하는 조건식을 추가하고자 합니다.청산 후 20분간은 재진입되지 않도록 하는 수식을 부탁드립니다. 감사합니다.
프로필 이미지
트레이더365
2026-01-22
48
글번호 230000
시스템
답변완료

수식추가

안녕하세요, 전일봉의 영향을 배제(즉 당일봉)으로 아래의 조건을 유지하려면 어떤 수식을 추가해야하나요?var : HH(0),HL(0);if Data1(DayOpen) >= Data2(DayOpen) Then HH=(Data1(-DayOpen+C)+Data2(-DayOpen+C)*Data1(dayopen)/Data2(DayOpen)) ;Else HL= (Data1(-DayOpen+C)*Data2(DayOpen)/Data1(DayOpen)+Data2(-DayOpen+C))=HL ;If ( HH<0 or HL<0) then buy("P1",onclose);감사합니다.
프로필 이미지
huhboo99
2026-01-22
45
글번호 229999
시스템
답변완료

조건검색 문의

//@version=5indicator("신호 변환: 고가 돌파 시스템", overlay=true)// 1. 변수 설정shin = high - lowho = math.max(close, open) - low// 2. 조건 설정 (분모가 0이 되는 것을 방지하기 위해 ho > 0 체크 추가)// 조건: (전체길이/몸통상단-저가 > 2) AND (당일 고가가 전일 종가 대비 15% 이상 상승)cond = (ho > 0 ? (shin / ho > 2) : false) and (high / close[1] > 1.15)// 3. 기준선 설정 (valuewhen 구현)var float base_line = naif cond base_line := high// 4. 신호 발생 (종가가 기준선을 상향 돌파할 때)signal = ta.crossover(close, base_line)// --- 시각화 ---// 기준선 그리기 (조건이 발생한 적이 있을 때만 표시)plot(base_line, title="기준선", color=color.new(color.gray, 50), style=plot.style_linebr, linewidth=2)// 돌파 신호 표시plotshape(series=signal, title="신호 발생", style=shape.triangleup, location=location.belowbar, color=color.red, size=size.small, text="돌파")// (옵션) 조건이 만족된 캔들 강조 표시 (노란색)bgcolor(cond ? color.new(color.yellow, 80) : na)일봉상 위 신호가 발생한 모든 종목을 검출할 수 있도록 해주시면 감사드리겠습니다 (__)
프로필 이미지
사공하늘
2026-01-22
77
글번호 229990
검색
답변완료

엔돌핀 중심선

안녕하세요엔돌핀 중심선 상승돌파 하였다다시하락하다가다시또상승돌파이면 10분이네로 되는경우 강제손절반대로엔돌핀 하락돌파 하였다가 다시상승돌파이후 다시 하라돌파 10분이네로되면강제청산감사합니다
프로필 이미지
놀이터
2026-01-22
56
글번호 229987
시스템
답변완료

안녕하세요

안녕하세요수고 많으십니다.추운날씨에 수고가 많으십니다.항상 감사한 마음으로 문의를 드립니다.아래 제공 되는 수식을 정정 해주시면 감사 하겠습니다.1.기준선 ( B1 or B2 )를(오늘 1번 이라도 1봉전대비 5%이상 돌파한 봉 ) 최고가 기준 or ( B1 or B2 ) +- 0.5% 이내에서 (오늘 1번 이라도 1봉전대비 5%이상 상승한 봉 ) 최고가 기준 나와야함.2. 현재봉이 1봉전 종가 대비 5% 이상 상승중이면서 (1번의 종가보다 현재가가 높다거나) or (오늘의 최고 종가) 로 검색이 되게 하고 싶습니다.if CrossDown(C, A2) Then B2 = A2[1];// 현재봉이 B2를 상향 돌파하는지 확인isCrossNow = false;if CurrentBar > 1 and B2 > 0 Thenbegin if C[1] <= B2 and C > B2 Then isCrossNow = true;end;// B2 위 0.5% 이내 근접 여부isNearB2 = false;if CurrentBar > 1 and B2 > 0 Thenbegin if C >= B2 and C <= B2 * 1.05 Then isNearB2 = true;end;// 오늘 돌파 발생 시 카운트 증가if isCrossNow and C > O Then todayCrossCount = todayCrossCount + 1;// 거래량 증가율 계산var: volumeIncrease(0);if V[1] > 0 Then volumeIncrease = ((V - V[1]) / V[1]) * 100;// 현재가와 B2의 차이율 계산 (0.5% 이내 지지 확인용)var : priceDiffPct(0);if B2 > 0 Then priceDiffPct = ((C - B2) / B2) * 100;if firstSignalTriggered = true and ( // B1 ±1% 근처 + 5% 상승 (B1 > 0 and C >= B1 * 0.95 and C <= B1 * 1.01 and C >= B1 * 1.05) or // B2 ±1% 근처 + 5% 상승 (B2 > 0 and C >= B2 * 0.95 and C <= B2 * 1.01 and C >= B2 * 1.05) ) and C > O and C > C[1] Thenbegin Find(1);end;항상 감사 드립니다.수고 하십시오,
프로필 이미지
하루삼프로
2026-01-22
122
글번호 229986
종목검색