커뮤니티

수식 의뢰 부탁드립니다.

프로필 이미지
산이보리
2019-11-14 09:50:56
133
글번호 133626
답변완료
항상 개발자님의 노고에 감사드립니다 질문1) 항생지수는 06:15~10:15까지 휴장이라 차트에 일자모양의 봉이 나타납니다 장시작인 10:15 직후에는 이 일자모양의 봉을 기준으로 매매를 하지 않고 전전봉 기준으로 매매를 할 수 있을까요? Input: length(1),trailingstop(1); Buy("long",AtStop,Highest(High,length)); Sell("short",AtStop,Lowest(Low,length)); ExitLong("EL", atstop, Lowest( Low , trailingstop)); ExitShort("ES", atstop,Highest( High , trailingstop )); 질문2) 08:00 ~ 20:00 시간에는 전봉기준 최고가 도달 시 매도진입, 전봉기준 최고가 도달 시 매수진입을 하려고 합니다. 청산조건은 HTS에 입력할거라 필요하지 않습니다
시스템
답변 4
프로필 이미지

예스스탁 예스스탁 답변

2019-11-14 13:55:40

안녕하세요 예스스탁입니다. 1 06:15~10:15시간대는 제외한 고가와 저가를 이용해 highest,lowest를 계산하게 작성하시면 됩니다. Input: length(1),trailingstop(1); var : cnt(0),Hv(0),Lv(0),TrH(0),TrL(0); Array : HH[100](0),LL[100](0); if stime >= 101500 or stime < 061500 Then { HH[0] = H; LL[0] = L; for cnt = 1 to 99 { HH[cnt] = HH[cnt-1][1]; LL[cnt] = LL[cnt-1][1]; } } if HH[Length-1] > 0 and LL[Length-1] > 0 then { Hv = HH[0]; Lv = LL[0]; for cnt = 0 to Length-1 { if HH[cnt] > Hv Then Hv = HH[cnt]; if LL[cnt] < Lv Then Lv = LL[cnt]; } Buy("long",AtStop,Hv); Sell("short",AtStop,Lv); } if HH[trailingstop-1] > 0 and LL[trailingstop-1] > 0 then { TrH = HH[0]; TrL = LL[0]; for cnt = 0 to trailingstop-1 { if HH[cnt] > TrH Then TrH = HH[cnt]; if LL[cnt] < TrL Then TrL = LL[cnt]; } ExitLong("EL", atstop, TrL); ExitShort("ES", atstop,TrH); } 2 전봉기준 최고가 도달시 매도, 전봉기준 최저가 도달시 매수면 아래와 같습니다. input : starttime(80000),endtime(200000); var : Tcond(false); 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; } if tcond == true then { sell("s",atlimit,H); buy("b",atlimit,L); } 전봉기준 최고가 도달시 매수, 전봉기준 최저가 도달시 매도면 아래와 같습니다. input : starttime(80000),endtime(200000); var : Tcond(false); 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; } if tcond == true then { sell("s",atstop,L); buy("b",atsteop,H); } 즐거운 하루되세요 > 산이보리 님이 쓴 글입니다. > 제목 : 수식 의뢰 부탁드립니다. > 항상 개발자님의 노고에 감사드립니다 질문1) 항생지수는 06:15~10:15까지 휴장이라 차트에 일자모양의 봉이 나타납니다 장시작인 10:15 직후에는 이 일자모양의 봉을 기준으로 매매를 하지 않고 전전봉 기준으로 매매를 할 수 있을까요? Input: length(1),trailingstop(1); Buy("long",AtStop,Highest(High,length)); Sell("short",AtStop,Lowest(Low,length)); ExitLong("EL", atstop, Lowest( Low , trailingstop)); ExitShort("ES", atstop,Highest( High , trailingstop )); 질문2) 08:00 ~ 20:00 시간에는 전봉기준 최고가 도달 시 매도진입, 전봉기준 최고가 도달 시 매수진입을 하려고 합니다. 청산조건은 HTS에 입력할거라 필요하지 않습니다
프로필 이미지

산이보리

2019-11-15 09:25:08

개발자님의 노고에 감사드립니다 시스템에 적용해보니 간혹 휴장시간에 신규주문이 들어가는 경우가 있습니다 확인부탁드립니다 > 예스스탁 님이 쓴 글입니다. > 제목 : Re : 수식 의뢰 부탁드립니다. > 안녕하세요 예스스탁입니다. 1 06:15~10:15시간대는 제외한 고가와 저가를 이용해 highest,lowest를 계산하게 작성하시면 됩니다. Input: length(1),trailingstop(1); var : cnt(0),Hv(0),Lv(0),TrH(0),TrL(0); Array : HH[100](0),LL[100](0); if stime >= 101500 or stime < 061500 Then { HH[0] = H; LL[0] = L; for cnt = 1 to 99 { HH[cnt] = HH[cnt-1][1]; LL[cnt] = LL[cnt-1][1]; } } if HH[Length-1] > 0 and LL[Length-1] > 0 then { Hv = HH[0]; Lv = LL[0]; for cnt = 0 to Length-1 { if HH[cnt] > Hv Then Hv = HH[cnt]; if LL[cnt] < Lv Then Lv = LL[cnt]; } Buy("long",AtStop,Hv); Sell("short",AtStop,Lv); } if HH[trailingstop-1] > 0 and LL[trailingstop-1] > 0 then { TrH = HH[0]; TrL = LL[0]; for cnt = 0 to trailingstop-1 { if HH[cnt] > TrH Then TrH = HH[cnt]; if LL[cnt] < TrL Then TrL = LL[cnt]; } ExitLong("EL", atstop, TrL); ExitShort("ES", atstop,TrH); } 2 전봉기준 최고가 도달시 매도, 전봉기준 최저가 도달시 매수면 아래와 같습니다. input : starttime(80000),endtime(200000); var : Tcond(false); 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; } if tcond == true then { sell("s",atlimit,H); buy("b",atlimit,L); } 전봉기준 최고가 도달시 매수, 전봉기준 최저가 도달시 매도면 아래와 같습니다. input : starttime(80000),endtime(200000); var : Tcond(false); 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; } if tcond == true then { sell("s",atstop,L); buy("b",atsteop,H); } 즐거운 하루되세요 > 산이보리 님이 쓴 글입니다. > 제목 : 수식 의뢰 부탁드립니다. > 항상 개발자님의 노고에 감사드립니다 질문1) 항생지수는 06:15~10:15까지 휴장이라 차트에 일자모양의 봉이 나타납니다 장시작인 10:15 직후에는 이 일자모양의 봉을 기준으로 매매를 하지 않고 전전봉 기준으로 매매를 할 수 있을까요? Input: length(1),trailingstop(1); Buy("long",AtStop,Highest(High,length)); Sell("short",AtStop,Lowest(Low,length)); ExitLong("EL", atstop, Lowest( Low , trailingstop)); ExitShort("ES", atstop,Highest( High , trailingstop )); 질문2) 08:00 ~ 20:00 시간에는 전봉기준 최고가 도달 시 매도진입, 전봉기준 최고가 도달 시 매수진입을 하려고 합니다. 청산조건은 HTS에 입력할거라 필요하지 않습니다
프로필 이미지

예스스탁 예스스탁 답변

2019-11-15 09:46:01

안녕하세요 예스스탁입니다. 가격만 휴장시간의 가격을 사용하지 않게 작성해 드렸습니다. 진입청산에 모두 시간조건을 추가해 드립니다. Input: length(1),trailingstop(1); var : cnt(0),Hv(0),Lv(0),TrH(0),TrL(0); Array : HH[100](0),LL[100](0); if stime >= 101500 or stime < 061500 Then { HH[0] = H; LL[0] = L; for cnt = 1 to 99 { HH[cnt] = HH[cnt-1][1]; LL[cnt] = LL[cnt-1][1]; } } if HH[Length-1] > 0 and LL[Length-1] > 0 and (stime >= 101500 or stime < 061500) then { Hv = HH[0]; Lv = LL[0]; for cnt = 0 to Length-1 { if HH[cnt] > Hv Then Hv = HH[cnt]; if LL[cnt] < Lv Then Lv = LL[cnt]; } Buy("long",AtStop,Hv); Sell("short",AtStop,Lv); } if HH[trailingstop-1] > 0 and LL[trailingstop-1] > 0 and (stime >= 101500 or stime < 061500) then { TrH = HH[0]; TrL = LL[0]; for cnt = 0 to trailingstop-1 { if HH[cnt] > TrH Then TrH = HH[cnt]; if LL[cnt] < TrL Then TrL = LL[cnt]; } ExitLong("EL", atstop, TrL); ExitShort("ES", atstop,TrH); } 즐거운 하루되세요 > 산이보리 님이 쓴 글입니다. > 제목 : Re : Re : 수식 의뢰 부탁드립니다. > 개발자님의 노고에 감사드립니다 시스템에 적용해보니 간혹 휴장시간에 신규주문이 들어가는 경우가 있습니다 확인부탁드립니다 > 예스스탁 님이 쓴 글입니다. > 제목 : Re : 수식 의뢰 부탁드립니다. > 안녕하세요 예스스탁입니다. 1 06:15~10:15시간대는 제외한 고가와 저가를 이용해 highest,lowest를 계산하게 작성하시면 됩니다. Input: length(1),trailingstop(1); var : cnt(0),Hv(0),Lv(0),TrH(0),TrL(0); Array : HH[100](0),LL[100](0); if stime >= 101500 or stime < 061500 Then { HH[0] = H; LL[0] = L; for cnt = 1 to 99 { HH[cnt] = HH[cnt-1][1]; LL[cnt] = LL[cnt-1][1]; } } if HH[Length-1] > 0 and LL[Length-1] > 0 then { Hv = HH[0]; Lv = LL[0]; for cnt = 0 to Length-1 { if HH[cnt] > Hv Then Hv = HH[cnt]; if LL[cnt] < Lv Then Lv = LL[cnt]; } Buy("long",AtStop,Hv); Sell("short",AtStop,Lv); } if HH[trailingstop-1] > 0 and LL[trailingstop-1] > 0 then { TrH = HH[0]; TrL = LL[0]; for cnt = 0 to trailingstop-1 { if HH[cnt] > TrH Then TrH = HH[cnt]; if LL[cnt] < TrL Then TrL = LL[cnt]; } ExitLong("EL", atstop, TrL); ExitShort("ES", atstop,TrH); } 2 전봉기준 최고가 도달시 매도, 전봉기준 최저가 도달시 매수면 아래와 같습니다. input : starttime(80000),endtime(200000); var : Tcond(false); 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; } if tcond == true then { sell("s",atlimit,H); buy("b",atlimit,L); } 전봉기준 최고가 도달시 매수, 전봉기준 최저가 도달시 매도면 아래와 같습니다. input : starttime(80000),endtime(200000); var : Tcond(false); 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; } if tcond == true then { sell("s",atstop,L); buy("b",atsteop,H); } 즐거운 하루되세요 > 산이보리 님이 쓴 글입니다. > 제목 : 수식 의뢰 부탁드립니다. > 항상 개발자님의 노고에 감사드립니다 질문1) 항생지수는 06:15~10:15까지 휴장이라 차트에 일자모양의 봉이 나타납니다 장시작인 10:15 직후에는 이 일자모양의 봉을 기준으로 매매를 하지 않고 전전봉 기준으로 매매를 할 수 있을까요? Input: length(1),trailingstop(1); Buy("long",AtStop,Highest(High,length)); Sell("short",AtStop,Lowest(Low,length)); ExitLong("EL", atstop, Lowest( Low , trailingstop)); ExitShort("ES", atstop,Highest( High , trailingstop )); 질문2) 08:00 ~ 20:00 시간에는 전봉기준 최고가 도달 시 매도진입, 전봉기준 최고가 도달 시 매수진입을 하려고 합니다. 청산조건은 HTS에 입력할거라 필요하지 않습니다
프로필 이미지

산이보리

2019-11-15 13:43:18

적용해도 신규주문이 들어가서 화면 캡쳐해서 올립니다 감사합니다 > 예스스탁 님이 쓴 글입니다. > 제목 : Re : Re : Re : 수식 의뢰 부탁드립니다. > 안녕하세요 예스스탁입니다. 가격만 휴장시간의 가격을 사용하지 않게 작성해 드렸습니다. 진입청산에 모두 시간조건을 추가해 드립니다. Input: length(1),trailingstop(1); var : cnt(0),Hv(0),Lv(0),TrH(0),TrL(0); Array : HH[100](0),LL[100](0); if stime >= 101500 or stime < 061500 Then { HH[0] = H; LL[0] = L; for cnt = 1 to 99 { HH[cnt] = HH[cnt-1][1]; LL[cnt] = LL[cnt-1][1]; } } if HH[Length-1] > 0 and LL[Length-1] > 0 and (stime >= 101500 or stime < 061500) then { Hv = HH[0]; Lv = LL[0]; for cnt = 0 to Length-1 { if HH[cnt] > Hv Then Hv = HH[cnt]; if LL[cnt] < Lv Then Lv = LL[cnt]; } Buy("long",AtStop,Hv); Sell("short",AtStop,Lv); } if HH[trailingstop-1] > 0 and LL[trailingstop-1] > 0 and (stime >= 101500 or stime < 061500) then { TrH = HH[0]; TrL = LL[0]; for cnt = 0 to trailingstop-1 { if HH[cnt] > TrH Then TrH = HH[cnt]; if LL[cnt] < TrL Then TrL = LL[cnt]; } ExitLong("EL", atstop, TrL); ExitShort("ES", atstop,TrH); } 즐거운 하루되세요 > 산이보리 님이 쓴 글입니다. > 제목 : Re : Re : 수식 의뢰 부탁드립니다. > 개발자님의 노고에 감사드립니다 시스템에 적용해보니 간혹 휴장시간에 신규주문이 들어가는 경우가 있습니다 확인부탁드립니다 > 예스스탁 님이 쓴 글입니다. > 제목 : Re : 수식 의뢰 부탁드립니다. > 안녕하세요 예스스탁입니다. 1 06:15~10:15시간대는 제외한 고가와 저가를 이용해 highest,lowest를 계산하게 작성하시면 됩니다. Input: length(1),trailingstop(1); var : cnt(0),Hv(0),Lv(0),TrH(0),TrL(0); Array : HH[100](0),LL[100](0); if stime >= 101500 or stime < 061500 Then { HH[0] = H; LL[0] = L; for cnt = 1 to 99 { HH[cnt] = HH[cnt-1][1]; LL[cnt] = LL[cnt-1][1]; } } if HH[Length-1] > 0 and LL[Length-1] > 0 then { Hv = HH[0]; Lv = LL[0]; for cnt = 0 to Length-1 { if HH[cnt] > Hv Then Hv = HH[cnt]; if LL[cnt] < Lv Then Lv = LL[cnt]; } Buy("long",AtStop,Hv); Sell("short",AtStop,Lv); } if HH[trailingstop-1] > 0 and LL[trailingstop-1] > 0 then { TrH = HH[0]; TrL = LL[0]; for cnt = 0 to trailingstop-1 { if HH[cnt] > TrH Then TrH = HH[cnt]; if LL[cnt] < TrL Then TrL = LL[cnt]; } ExitLong("EL", atstop, TrL); ExitShort("ES", atstop,TrH); } 2 전봉기준 최고가 도달시 매도, 전봉기준 최저가 도달시 매수면 아래와 같습니다. input : starttime(80000),endtime(200000); var : Tcond(false); 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; } if tcond == true then { sell("s",atlimit,H); buy("b",atlimit,L); } 전봉기준 최고가 도달시 매수, 전봉기준 최저가 도달시 매도면 아래와 같습니다. input : starttime(80000),endtime(200000); var : Tcond(false); 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; } if tcond == true then { sell("s",atstop,L); buy("b",atsteop,H); } 즐거운 하루되세요 > 산이보리 님이 쓴 글입니다. > 제목 : 수식 의뢰 부탁드립니다. > 항상 개발자님의 노고에 감사드립니다 질문1) 항생지수는 06:15~10:15까지 휴장이라 차트에 일자모양의 봉이 나타납니다 장시작인 10:15 직후에는 이 일자모양의 봉을 기준으로 매매를 하지 않고 전전봉 기준으로 매매를 할 수 있을까요? Input: length(1),trailingstop(1); Buy("long",AtStop,Highest(High,length)); Sell("short",AtStop,Lowest(Low,length)); ExitLong("EL", atstop, Lowest( Low , trailingstop)); ExitShort("ES", atstop,Highest( High , trailingstop )); 질문2) 08:00 ~ 20:00 시간에는 전봉기준 최고가 도달 시 매도진입, 전봉기준 최고가 도달 시 매수진입을 하려고 합니다. 청산조건은 HTS에 입력할거라 필요하지 않습니다