커뮤니티

예스랭귀지 Q&A

글쓰기
답변완료

식수정

input : P1(5),P2(20); Input : short(12), long(26), signal(9); input : BBP(20),dv(2); input : StartTime(80000),EndTime(30000); var : mav1(0),mav2(0),bbup(0),bbdn(0); Var : MACDv(0), MACDs(0),macdo(0),T(0); var : Tcond(false); mav1 = ma(C,P1); mav2 = ma(C,P2); MACDv = MACD(short, long); MACDs = ema(MACDv,signal); macdo = MACDv-MACDs; bbup = BollBandUp(BBP,dv); bbdn = BollBandDown(BBP,dv); IF Endtime > starttime Then SetStopEndofday(Endtime); Else { if sDate != sDate[1] Then SetStopEndofday(Endtime); } if (sdate != sdate[1] and stime >= EndTime) or (sdate == sdate[1] and stime >= EndTime and stime[1] < EndTime) Then Tcond = False; if (sdate != sdate[1] and stime >= StartTime) or (sdate == sdate[1] and stime >= StartTime and stime[1] < StartTime) Then { Tcond = true; T = 0; var1 = 0; Var2 = 0; IF Endtime <= starttime Then { SetStopEndofday(0); } } if Tcond == true Then { var1 = var1+v; Var2 = Var2+1; Var3 = var1/Var2; if C < DayOpen and mav1 < mav1[1] Then T = 1; if T == 1 and MACDO > 0 and mav2 > mav2[1] Then { if (CrossUp(c,DayOpen) and C < BBup) or (C > DayOpen and C > bbup and CrossDown(C,mav1)) Then Buy(); } if C > DayOpen and mav1 > mav1[1] Then T = -1; if T == -1 and MACDO < 0 and mav2 < mav2[1] Then { if (CrossDown(c,DayOpen) and C > BBdn) or (C < DayOpen and C < bbdn and CrossUp(C,mav1)) Then Sell(); } if MarketPosition == 1 Then { # if CrossDown(C,DayOpen) Then # ExitLong(); # if v >= Var3[1]*5 then # ExitLong(); } if MarketPosition == -1 Then { # if CrossUp(C,DayOpen) Then # ExitShort(); # if v >= Var3[1]*5 then # ExitShort(); } } SetStopProfittarget(3.0,PercentStop); SetStopLoss(1.8,PercentStop); 안녕하세요 위 식에서 식추가 부탁드립니다. 익절.손절기능 삭제(SetStopProfittarget(3.0,PercentStop); SetStopLoss(1.8,PercentStop);) 추가 매수 당일 시가선위에서 매수 진입후 시가선 아래로 하향시 손절후 바로 매도 전환. 매도 당일 시가선아래서 매도 진입후 당일 시가선위로 상승시 손절후 바로 매수 진입전환.
프로필 이미지
아트정
2022-12-03
1485
글번호 164323
시스템
답변완료

문의

아래는 이평선을 터치했을 때 라인이 생기는 지표인데 이 지표를 3분봉에 설정하든 10분봉에 설정하든 무조건 5분봉의 이평선이 기준이 되도록 부탁드립니다. 예를 들면 3분봉에 이 지표를 설정했을 때 5분봉의 5,10,20,60,120 이평선을 터치시 라인이 생기도록 하고 싶습니다. 감사합니다. input : P1(5), P2(10), P3(20), P4(60), P5(120); var1 = ma(C,P1); Var2 = ma(C,p2); Var3 = ma(C,p3); Var4 = ma(C,p4); var5 = ma(C,p5); if (h >= var1 and H[1] < var1[1]) or (L <= var1 and L[1] > var1[1]) Then { value1 = var1; } if (h >= var2 and H[1] < var2[1]) or (L <= var2 and L[1] > var2[1]) Then { value2 = Var2; } if (h >= var3 and H[1] < var3[1]) or (L <= var3 and L[1] > var3[1]) Then { value3 = Var3; } if (h >= var4 and H[1] < var4[1]) or (L <= var4 and L[1] > var4[1]) Then { value4 = Var4; } if (h >= var5 and H[1] < var5[1]) or (L <= var5 and L[1] > var5[1]) Then { value5 = Var5; } if value1 > 0 Then Plot1(value1); if value2 > 0 Then Plot2(value2); if value3 > 0 Then Plot3(value3); if value4 > 0 Then Plot4(value4); if value5 > 0 Then Plot5(value5);
프로필 이미지
육각수
2022-12-03
1036
글번호 164322
지표
답변완료

부탁 드립니다

도움에 감사 드립니다. for .....to 를 사용 하여 간락히 부탁 드립니다. input : P(10); var : count(0),cnt(0); var1 = ma(c,P); Var99= iff(var1[1]>var1,1,0)+ iff(var1[2]>var1,1,0)+ iff(var1[3]>var1,1,0)+ iff(var1[4]>var1,1,0)+ iff(var1[5]>var1,1,0)+ iff(var1[6]>var1,1,0)+ iff(var1[7]>var1,1,0)+ iff(var1[8]>var1,1,0)+ iff(var1[9]>var1,1,0)+ iff(var1[10]>var1,1,0)+ '+ '+ '+ iff(var1[P]>var1,1,0);
프로필 이미지
yes
2022-12-03
853
글번호 164321
지표
답변완료

청산신호발생했음에도 잔고에 남은수량 처리 방법

주식 현물거래하려는데.. 5회차 분할매수중. 3회차까지 분할 매수하다가.. 청산(매도) 신호가 모두 동시에 떠서 신호상으로는 모두 청산된것으로 차트에는 표시됩니다. 그러나, 1회차 물량(또는 일부만) 만 청산주문이 들어가고..나머지는 가격조건이 급락으로 인해 맞지않아 주문이 들어가지 않아서, 결국 사람이 수동으로 시장가 또는 지정가로 전량 청산했습니다. 이럴경우, 청산신호가 모두 발생했으면 계좌잔고에는 수량이 남아있지않아야하는데, 청산가격 조건이 순간적인 요인(급락 등)이 맞지않아 잔량이 남는경우.... 수량이나 또는 잔고 잔량등을 체크해서 남아있는 물량을 모두 지정가 또는 시장가로 자동 청산할수 있는 방법이 있나요? if Marketposition == 0 and 계좌잔고 수량 > 0 then ;포지션이 무포지션일때 잔고수량이 있으면. 시장가매도 Sell(시장가) ; 대충 이런흐름이 될거같은데요..ㅠㅠ
프로필 이미지
포에니
2022-12-02
993
글번호 164320
시스템
답변완료

질문 드립니다.

지수가 특정 조건 만족시 파생상품에 대한 종가매매를 하고 싶은데요. 실제 시스템으로는 동시호가 매매가 지원되지 않는 것으로 알고 있습니다. 대안책으로 전략실행차트에 일봉 onclose로 전략을 경보후 주문으로 설정하고 금액 0원 계좌에 실행시키게 되면 15시 30분에 매수 충족 여부를 경보로 띄워주는가요? 이때 경보가 뜨면 이를 바탕으로 선물 동시호가 시간에 매수를 하려고 합니다. 답변 부탁드립니다.
프로필 이미지
마녀58
2022-12-02
1153
글번호 164319
시스템
답변완료

시스템식부탁드립니다

아래의 지표수식을 활용하여 지표[1] ( 타주기(15분) a < b or 타주기(5분) a < b ) and 현주기 a < b 이면 매수 ( 타주기(15분) a > b or 타주기(5분) a > b ) and 현주기 a > b 이면 매도 ##### 지표[2] ( 타주기(15분) dir == 1 or 타주기(5분) dor == 1 ) and 현주기 ▲ 이면 매수 ( 타주기(15분) dir == -1 or 타주기(5분) dir == -1 ) and 현주기 ▼ 이면 매도 //수식도움부탁드립니다. /////////지표[1] input : lengthh(22),k(true),gain(0.7); var : Price(0),hma(0),hma3(0),a(0),b(0),clr(0); var : kf1(0),dk1(0),smooth1(0),velo1(0),x1(0),g1(0); var : kf2(0),dk2(0),smooth2(0),velo2(0),x2(0),g2(0); price = (h+l)/2; hma = wma((2 * wma(price, lengthh / 2)) - wma(price, lengthh), round(sqrt(lengthh),0)); hma3= wma(wma(c, (lengthh/2)/3)*3 - wma(c, (lengthh/2)/2) - wma(c, (lengthh/2)), (lengthh/2)); x1 = hma; g1 = gain; kf1 = 0.0; dk1 = x1 - iff(isnan(kf1[1]) == False,kf1[1], x1); smooth1 = iff(isnan(kf1[1]) == False,kf1[1], x1)+dk1*sqrt(g1*2); velo1 = 0.0; velo1 = iff(isnan(velo1[1]) == False,velo1,0) + (g1*dk1); kf1 = smooth1+velo1; x2 = hma3; g2 = gain; kf2 = 0.0; dk2 = x2 - iff(isnan(kf2[1]) == False,kf2[1], x2); smooth2 = iff(isnan(kf2[1]) == False,kf2[1], x2)+dk2*sqrt(g2*2); velo2 = 0.0; velo2 = iff(isnan(velo2[1]) == False,velo2,0) + (g2*dk2); kf2 = smooth2+velo2; a = iff(k == true, kf1 , hma); b = iff(k == true, kf2 , hma3); clr = iff(b > a , red , lime); Plot1(kf1,"a",clr); Plot2(kf2,"b",clr); ////////// ////////지표[2] input : length(2),mult(2),useClose(true),크기(25); var : ATrv(0),longStop(0),longStopprev(0),shortStop(0),shortStopPrev(0); var : dir(1),longcolor(plum),shortcolor(lightblue),tx(0); atrv = mult * atr(length); longStop = IFf(useClose , highest(close, length) , highest(h,length)) - atrv; longStopPrev = longStop[1]; longStop = iff(close[1] > longStopPrev , max(longStop, longStopPrev) , longStop); shortStop = IFf(useClose , lowest(close, length) , lowest(L,length)) + atrv; shortStopPrev = shortStop[1]; shortStop = iff(close[1] < shortStopPrev , min(shortStop, shortStopPrev) , shortStop); dir = iff(close > shortStopPrev , 1 ,iff( close < longStopPrev , -1 , dir)); IF dir == 1 Then { plot1(longStop,"Long Stop",longColor); NoPlot(2); } Else { NoPlot(1); plot2(shortStop,"Short Stop",shortColor); } if dir == 1 and dir[1] == -1 Then { tx = Text_New(sDate,sTime,longStop,"▲"); Text_SetStyle(tx,2,0); Text_SetSize(tx, 크기); Text_SetColor(tx,longcolor); } if dir == -1 and dir[1] == 1 Then { tx = Text_New(sDate,sTime,shortStop,"▼"); Text_SetStyle(tx,2,1); Text_SetSize(tx, 크기); Text_SetColor(tx,shortcolor); } ////////////// 수고하세요
프로필 이미지
당일선물
2022-12-04
1099
글번호 164318
시스템

하늘거지 님에 의해서 삭제되었습니다.

프로필 이미지
하늘거지
2022-12-02
40
글번호 164311
시스템
답변완료

수식 바로 잡아 주세요.

수고하십니다. 거래시간을 두구간으로 나누어 거래하려고 아래와 같이 작성하였는데 첫구간은 적용 안되고 두번째 구간만 거래되고 있습니다. 두구간(시작시간~종료시간, 시작시간2~종료시간2) 모두 거래될수 있도록 정정 부탁드립니다. input : 시작시간(080700); input : 종료시간(120000); input : 시작시간2(210700); input : 종료시간2(050000); if (stime == 시작시간 or (stime > 시작시간 and stime[1] < 시작시간)) or (stime == 시작시간2 or (stime > 시작시간2 and stime[1] < 시작시간2)) Then{ Tcond = true; } if (stime == 종료시간 or (stime > 종료시간 and stime[1] < 종료시간)) or (stime == 종료시간2 or (stime > 종료시간2 and stime[1] < 종료시간2)) Then{ Tcond = false; if MarketPosition == 1 Then ExitLong(); if MarketPosition == -1 Then ExitShort(); } if Tcond == true then { 진입청산로직 }
프로필 이미지
고가행진
2022-12-02
854
글번호 164310
시스템
답변완료

문의드립니다

안녕하세요 영운문 기준 거래량 이평을 중심선으로 한 거래량 볼린저밴드 수식인데요 이를 예스랭귀지로 바꾼 수식을 구하고 싶습니다 중심:avg(ma(v,n,단순),period) 상한:avg(ma(v,n,단순),period)+d1*stdev(ma(v,n,단순),period) 하한:avg(ma(v,n,단순),period)-d1*stdev(ma(v,n,단순),period)
프로필 이미지
kns
2022-12-02
828
글번호 164309
지표
답변완료

진입제한

안녕하세요, 진입시 조건으로 아래의 경우 어떻게 되는지 궁금합니다. 진입시 최근 매도청산보다 낮은 경우 진입금지 진입시 최근 매수청산보다 높은 경우 진입금지 감사합니다.
프로필 이미지
huhboo99
2022-12-02
845
글번호 164307
시스템