커뮤니티

예스랭귀지 Q&A

글쓰기
답변완료

문의 드립니다.

수고많으십니다~ 10시 30분 이후 거래는 익절 50틱으로 되어 있는데, 실제 거래에서는 30틱 수익으로 청산되었습니다.어디에 문제가 있는지 확인 부탁드립니다. 거래내역 올려드립니다. 확인부탁드립니다~~^^ input : StartTime(101500),EndTime(114000); input : Length(20), D1(2); input : 익절1(30),손절1(30),청산구분시간(103000),익절2(50),손절2(30),익절연속횟수(3),손절연속횟수(2); var : Tcond(false),profit(0),loss(0); 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; profit = 0; loss = 0; } if TotalTrades > TotalTrades[1] Then { if IsExitName("bp.",1) or IsExitName("bp1",1) or IsExitName("bp2",21) or IsExitName("sp.",1) or IsExitName("sp1",1) or IsExitName("sp2",1) Then profit = profit+1; Else profit = 0; if IsExitName("bl.",1) or IsExitName("bl1",1) or IsExitName("bl2",1) or IsExitName("sl.",1) or IsExitName("sl1",1) or IsExitName("sl2",1) Then loss = loss+1; Else loss = 0; } var1 = BollBandUp(Length,D1); var2 = BollBandDown(Length,D1); if Tcond == true Then { If CrossUP(H,var1) and c > o and profit < 익절연속횟수 and loss < 손절연속횟수 then { Buy("b",OnClose,DEF,1); ExitLong("bp.",AtLimit,C+PriceScale*익절1,"",1,1); ExitLong("bl.",AtStop,C-PriceScale*손절1,"",1,1); } If CrossDown(L,Var2) and C < O and profit < 익절연속횟수 and loss < 손절연속횟수 then { Sell("s",OnClose,DEF,1); ExitShort("sp.",AtLimit,C-PriceScale*익절1,"",1,1); ExitShort("sl.",AtStop,C+PriceScale*손절1,"",1,1); } } if MarketPosition == 1 Then { if sTime >= StartTime and sTime < 청산구분시간 Then { ExitLong("bp1",AtLimit,EntryPrice+PriceScale*익절1,"",1,1); ExitLong("bl1",AtStop,EntryPrice-PriceScale*손절1,"",1,1); } if sTime >= 청산구분시간 and sTime < Endtime Then { ExitLong("bp2",AtLimit,EntryPrice+PriceScale*익절2,"",1,1); ExitLong("bl2",AtStop,EntryPrice-PriceScale*손절2,"",1,1); } } if MarketPosition == -1 Then { if sTime >= StartTime and sTime < 103000 Then { ExitShort("sp1",AtLimit,EntryPrice-PriceScale*익절1,"",1,1); ExitShort("sl1",AtStop,EntryPrice+PriceScale*손절1,"",1,1); } if sTime >= 103000 and sTime < Endtime Then { ExitShort("sp2",AtLimit,EntryPrice-PriceScale*익절2,"",1,1); ExitShort("sl2",AtStop,EntryPrice+PriceScale*손절2,"",1,1); } } IF Endtime > starttime Then SetStopEndofday(Endtime); Else { if sDate != sDate[1] Then SetStopEndofday(Endtime); } if (sdate != sdate[1] and stime >= StartTime) or (sdate == sdate[1] and stime >= StartTime and stime[1] < StartTime) Then { IF Endtime <= starttime Then { SetStopEndofday(0); } }
프로필 이미지
에리카
2021-10-15
1227
글번호 152900
시스템
답변완료

문의드립니다.

안녕하세요. 언제나 감사합니다. 매수: 무포지션애서 음봉뒤에 양봉이 연속 2번 발생하면 매수합니다. 이 때 양봉이 2번 발생할 때의 첫번째 양봉의 시가를 손절가라고 정의합니다. 청산 매수후에 양봉이 먼저 발생하면 청산합니다. 그리고 매수후에 음봉이 먼저 발생하면 바로 청산하지 않고 다음봉 까지 기다려서 다음 봉 종가에 청산합니다. 즉 매수후 첫 봉이 음봉이면 다음 봉 종가에 청산하는 것입니다. 손절 위의 손절가를 종가가 하향 이탈시 손절청산합니다. 매도: 반대 논리로 부탁드립니다.
프로필 이미지
종호
2021-10-15
1358
글번호 152899
시스템
답변완료

이평선 돌파종목 검색

안녕하세요.. 그림과 같은 수식을 만들려고 하는데요.. 어제날짜에 분봉차트에서... 시가 또는 저가가 5일선 밑에서 5일선을 돌파한 양봉 종목을 검색하는 수식을 만들고 싶습니다.
프로필 이미지
디딤돌
2021-10-15
1528
글번호 152898
검색
답변완료

수식좀 요청 드립니다.

* 좋은 주말 되십시요. * 아래 수식 좁 부탁 드립니다. var : SEH(0),SEL(0); SEH = highest(H,BarsSinceEntry); SEL = Lowest(L,BarsSinceEntry); if MarketPosition == 1 ## 매수일 경우 and IsEntryName("SS2") == true and 최대수익(20틱) 발생이후 20봉 경과하도록 최대 수익이 갱신 안되고 수익이 5틱 이상이면 청산 and 최대수익(20틱) 발생후 20틱 하락했다가 최대 수익 갱산 되면수익 청산 Then { if highest(H,BarsSinceEntry) >= EntryPrice + PriceScale*1 Then { Sell("SS2CUTSW1";} } ## 매도일 경우도 부탁 드립니다. * 고맙습니다. 좋은 주말 되십시요.
프로필 이미지
요타
2021-10-15
808
글번호 152897
시스템
답변완료

수식점검

본 수식 점검해 주세요! input: 익절틱수(27),손절틱수(25),진입횟수(1); Var:j(0),lastHiVal(0),lastLoVal(0),sBar(0),eBar(0),TL1(0),TL2(0),TL3(0),Text1(0); var:처리구분(""),TL_Val1(0),TL_Val2(0),color(0),T(0); Array:고점[10,2](0),저점[10,2](0); 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 Highest(H,length)== H and lastHiVal <> H and Lowest(L,length) == L and lastLoVal<> L Then { If 저점[1,1]>L Then 처리구분="저점처리"; If 고점[1,1]<H Then 처리구분="고점처리"; } Else If Highest(H,length)== H and lastHiVal <> H Then 처리구분 ="고점처리"; Else If Lowest(L,length)== L and lastLoVal <> L Then 처리구분 ="저점처리"; If 처리구분 == "고점처리" Then { T = 1; lastHiVal = H; If 고점[1,2]<저점[1,2]Then { For j = 10 DownTo 2 { 고점[j,1] = 고점[j-1,1]; 고점[j,2] = 고점[j-1,2]; } } If 고점[1,2] < 저점[1,2] or 고점[1,1] <H Then { 고점[1,1]=H; 고점[1,2] =Index; sBar=Index-저점[1,2]; eBar =0; If TL_GetBeginDate(TL1)==sDate[sBar] and TL_GetBeginTime(TL1)==sTime[sBar] Then { TL_Delete(TL1); Text_Delete(Text1); If 고점[3,1][1]< 고점[2,1][1] and 고점[2,1][1]> 고점[1,1][1]and 저점[2,1][1]< 저점[1,1][1] Then TL_Delete(TL2); } if 고점[1,1]> 고점[2,1] or 고점[2,1] == 0 Then{ color= RED; //buy("b"); } TL1= TL_New(sDate[sBar],sTime[sBar],저점[1,1],sDate[eBar],sTime[eBar],고점[1,1]); TL_SetColor(TL1,color); Text1= Text_New(sDate[eBar],sTime[eBar],고점[1,1],NumToStr(abs(고점[1,1]-저점[1,1])/PriceScale,0)+NewLine+NumToStr(고점[1,1],2)); Text_SetStyle(Text1,2,1); If 고점[3,1]< 고점[2,1] and 고점[2,1] > 고점[1,1] and 저점[2,1] < 저점[1,1] Then { sBar=Index-저점[2,2]; eBar=Index-저점[1,2]; } } } If 처리구분 == "저점처리" Then { T=-1; lastLoVal=L; If 저점[1,2]< 고점[1,2] Then { For j=10 DownTo 2 { 저점[j,1] = 저점[j-1,1]; 저점[j,2] = 저점[j-1,2]; } } If 저점[1,2] < 고점[1,2] or 저점[1,1] > L Then { 저점[1,1] = L; 저점[1,2] = Index; sBar = Index - 고점[1,2]; eBar = 0; If TL_GetBeginDate(TL1) == sDate[sBar] and TL_GetBeginTime(TL1) == sTime[sBar] Then { TL_Delete(TL1); Text_Delete(Text1); If 저점[2,1][1] < 저점[1,1][1] and 저점[2,1][1] < 저점[3,1][1] and 고점[2,1][1]> 고점[1,1][1] Then TL_Delete(TL3); } if 저점[1,1] < 저점[2,1] or 저점[2,1] == 0 Then{ color = blue; //sell("s"); } TL1 = TL_New(sDate[sBar],sTime[sBar],고점[1,1],sDate[eBar],sTime[eBar],저점[1,1]); TL_SetColor(TL1,color); Text1 = Text_New(sDate[eBar],sTime[eBar],저점[1,1],NumToStr(abs(고점[1,1]-저점[1,1])/PriceScale,0)+NewLine+NumToStr(저점[1,1],2)); Text_SetStyle(Text1, 2, 0); If 저점[2,1] < 저점[1,1] and 저점[2,1] < 저점[3,1] and 고점[2,1] > 고점[1,1] Then { sBar = Index - 고점[2,2]; eBar = Index - 고점[1,2]; } } } TL_SetSize(TL1,3); if T == 1 and CrossUp(C,고점[2,1]) Then { if entry < 진입횟수 Then Buy("b"); Else ExitShort("sx"); } if T == -1 and CrossUp(C,저점[2,1]) Then { if entry < 진입횟수 Then Sell("s"); Else ExitLong("bx"); } SetStopProfittarget(PriceScale*익절틱수,PointStop); SetStopLoss(PriceScale*손절틱수,PointStop); 줄수 16과 21~22에 선언되지 않은 이름 'length'가 사용되었다고 하네요 도통 모르겠네요 미리 수고에 감사드려요!
프로필 이미지
하하아빠
2021-10-15
870
글번호 152891
시스템
답변완료

지수갭2

시뮬레이션을 해보니 값이 나오지 않습니다. 살펴주십시요. input: 지수갭1(5.50),지수갭2(2.50),시가대비(1.00); var : month(0,Data2),nday(0,Data2),week(0,data2); var : X(False,Data2),cond(False,Data2); var : DD(0,Data2),C2(0,Data2); month = data2(int(date/100)-int(date/10000)*100); nday = data2(date - int(date/100)*100); Week = data2(DayOfWeek(date)); #옵션만기일 if (nday >= 8 and nday <= 14 and week == 4) then X = true; Else X = False; if data2(bdate != Bdate) Then { if X == false and X[1] == true Then { C2 = 0; cond = true; dd = 0; } if cond ==true Then dd = dd+1; } #만기다음날 Data2 종가 if cond == true and dd == 1 Then C2 = data2(C); if C2 > 0 and 지수갭1 > Data2(Opend(0)-C2) and Data2(Opend(0)-C2) > 지수갭2 and c > dayopen + 시가대비 then buy(); ********************************************************************************** 안녕하세요 예스스탁입니다. var : month(0,Data2),nday(0,Data2),week(0,data2); var : X(False,Data2),cond(False,Data2); var : DD(0,Data2),C2(0,Data2); month = data2(int(date/100)-int(date/10000)*100); nday = data2(date - int(date/100)*100); Week = data2(DayOfWeek(date)); #옵션만기일 if (nday >= 8 and nday <= 14 and week == 4) then X = true; Else X = False; if data2(bdate != Bdate) Then { if X == false and X[1] == true Then { C2 = 0; cond = true; dd = 0; } if cond ==true Then dd = dd+1; } #만기다음날 Data2 종가 if cond == true and dd == 1 Then C2 = data2(C); if C2 > 0 and 5.50 > Data2(Opend(0)-C2) and Data2(Opend(0)-C2) > 2.50 and c > dayopen + 1.00 then buy(); if C2 > 0 and -2.50 > Data2(OpenD(0)-C2) and Data2(Opend(0)-C2) > -5.50 and c > dayopen + 1.00 then buy(); 즐거운 하루되세요 > 목마와숙녀 님이 쓴 글입니다. > 제목 : 문의 > data1 kospi200 선물 data2 kospi200 지수 kospi200갭 플러스(당일 kospi200 시가 - 월물옵션 첫날 kospi200지수 종가의 결과가 플러스) kospi200갭 마이너스(당일 kospi200 시가 - 월물옵션 첫날 kospi200지수 종가의 결과가 마이너스) 아래 수식을 완성해주십시요. ************************************************************************* if 5.50 > kospi200갭 플러스 > 2.50 and c > dayopen + 1.00 then buy(); if -2.50 > kospi200갭 마이너스 > -5.50 and c > dayopen + 1.00 then buy();
프로필 이미지
목마와숙녀
2021-12-16
764
글번호 152888
시스템
답변완료

문의 드립니다

신호발생후 4번째 봉에서 무조건 청산하는 식 부탁드립니다 예를 들어서 10분봉에서 9시20분 신호 발생시 10시에 청산되는 식 수고하세요
프로필 이미지
tktmsl
2021-10-15
818
글번호 152887
지표
답변완료

시스템식 부탁드립니다.

항상 도움 주셔서 감사합니다. 시스템성능보고서에 보면 진입효율, 청산효율, 총효율이 있는데요. 진입효율랑 봉개수, 총요율 등을 가지고 효율적으로 청산하는 방법이 있으면 설명 부탁드립니다. 특히 진입효율 가지고 효율적으로 청산하는 방법이 있는지 궁금합니다. 꼭 수익이 아니어서 진입효율로 큰 손실을 방지 할수 있는 방법이 있는지도 궁금합니다. 혹시 도움이 될만한 자료나 사이트도 있으면 설명 부탁드립니다. 꼭 답변 부탁드립니다. 감사합니다.
프로필 이미지
양치기
2021-10-14
1038
글번호 152886
시스템
답변완료

시스템식 부탁드립니다.

항상 도움 주셔서 감사합니다. 시스템성능보고서에 보면 진입효율, 청산효율, 총효율이 있는데요. 진입효율랑 봉개수, 총요율 등을 가지고 효율적으로 청산하는 방법이 있으면 설명 부탁드립니다. 특히 진입효율 가지고 효율적으로 청산하는 방법이 있는지 궁금합니다. 꼭 수익이 아니어서 진입효율로 큰 손실을 방지 할수 있는 방법이 있는지도 궁금합니다. 혹시 도움이 될만한 자료나 사이트도 있으면 설명 부탁드립니다. 꼭 답변 부탁드립니다. 감사합니다.
프로필 이미지
양치기
2021-10-14
1131
글번호 152885
시스템
답변완료

부탁 드립니다.

도움에 감사 드립니다. 수식1)은 정주기형이며 수식2)은 타주기(분봉용)으로 작성 해주신것이며 이것을 타주기(일봉)과 타주기(주봉)으로 부탁 드립니다. 미리 감사 드립니다. 수식1)정주기형 input : P(100); var : cnt(0),LL(0),HH(0),a(0),ai(0),b(0),bi(0); LL = Lowest(L,P); HH = highest(H,P); ai = 0; bi = 0; Condition1 = False; Condition2 = False; For cnt = 0 to P-1 { if Condition1 == False and L[cnt] == LL Then { Condition1 = true; ai = L-LL[cnt]; } if Condition2 == False and H[cnt] == HH Then { Condition2 = true; bi = H-HH[cnt]; } } a = 100*((P-1)-((ai)))/(P-1); b = 100*((P-1)-((bi)))/(P-1); 수식2) 타주기 (분봉용) input : Ntime1(60),P(100); var : TF(0),S1(0),D1(0),TM(0),cnt(0); var : ai(0),bi(0),a(0),b(0); Array : HV[101](0),LV[101](0); Array : HH[101](0),LL[101](0); if Bdate != Bdate[1] Then { S1 = TimeToMinutes(stime); D1 = sdate; } if D1 > 0 then { if sdate == D1 Then TM = TimeToMinutes(stime)-S1; Else TM = TimeToMinutes(stime)+1440-S1; TF = TM%ntime1; if Bdate != Bdate[1] or (Bdate == Bdate[1] and Ntime1 > 1 and TF < TF[1]) or (Bdate == Bdate[1] and Ntime1> 1 and TM >= TM[1]+Ntime1) or (Bdate == Bdate[1] and Ntime1 == 1 and TM > TM[1]) Then { HV[0] = H; LV[0] = L; for cnt = 1 to 100 { HV[cnt] = HV[cnt-1][1]; LV[cnt] = LV[cnt-1][1]; HH[cnt] = HH[cnt-1][1]; LL[cnt] = LL[cnt-1][1]; } } if HV[0] > 0 and H > HV[0] Then HV[0] = H; if LV[0] > 0 and L < LV[0] Then LV[0] = L; if HV[P-1] > 0 and LV[P-1] > 0 Then { HH[0] = HV[0]; LL[0] = LV[0]; For cnt = 0 to P-1 { if HV[cnt] > HH[0] Then HH[0] = HV[cnt]; if LV[cnt] < LL[0] Then LL[0] = LV[cnt]; } } ai = 0; bi = 0; Condition1 = False; Condition2 = False; For cnt = 0 to P-1 { if Condition1 == False and LV[cnt] == LL[0] Then { Condition1 = true; ai = LV[0]-LL[cnt]; } if Condition2 == False and HV[cnt] == HH[0] Then { Condition2 = true; bi = HV[0]-HH[cnt]; } } a = 100*((P-1)-((ai)))/(P-1); b = 100*((P-1)-((bi)))/(P-1); Plot1(a); plot2(b); }
프로필 이미지
yes
2021-10-14
1198
글번호 152884
지표