커뮤니티

문의드려요~ 감사합니다.

프로필 이미지
스카스카
2021-09-17 13:25:18
1237
글번호 152331
답변완료

첨부 이미지

아래 수식을 잘 사용중입니다. ★아래 수식에 추가 사항요청이 있습니다. ^^ - 추가요청사항 (강제청산) (1분봉기준) 이미 진입한 포지션에 따라 오전 10시부터 11시50분까지 최대 or 최저 분봉 기준 50포인트 이상시 강제청산 하는 내용입니다. ^^ 예) 10시에 1개 11시에 1개 총 2개 매수진입... 10~11:50 분까지 지켜본 12시부터 그 사이 가장 저점인 봉 기준 50포인트 아래는 전체 포지션 강제청산 예) 10시에 1개 11시에 1개 총 2개 매도진입... 10~11:50 분까지 지켜본 12시부터 그 사이 가장 고점인 봉 기준 50포인트 위는 전체 포지션 강제청산 최대한 변수지정으로 해주시면 감사하겠습니다. ^^ 명절 행복하게 보내세요~ 감사합니다~ 기존 쓰고있는 수식 ------------------------------------------------------------------------------------- input : position1(1),ntime1(100000),vol1(1); input : position2(1),ntime2(110000),vol2(1); input : xtime(55800); input : 최소수익틱수(100),수익감소틱수(20); var : ST(0); if Bdate != Bdate[1] Then { ST = sTime; } if ST > 0 then { if (sdate != sdate[1] and stime >= ntime1) or (sdate == sdate[1] and stime >= ntime1 and stime[1] < ntime1) Then { if position1 == 1 Then Buy("매수-1",OnClose,DEf,vol1); if position1 == -1 Then Sell("매도-1",OnClose,DEf,vol1); } if (sdate != sdate[1] and stime >= ntime2) or (sdate == sdate[1] and stime >= ntime2 and stime[1] < ntime2) Then { if position2 == 1 Then Buy("매수-2",OnClose,DEf,vol2); if position2 == -1 Then Sell("매도-2",OnClose,DEf,vol2); } if MarketPosition == 1 and Highest(H,BarsSinceEntry) >= EntryPrice+PriceScale*최소수익틱수 Then ExitLong("매수스탑x",AtStop,Highest(H,BarsSinceEntry)-PriceScale*수익감소틱수); if MarketPosition == -1 and lowest(L,BarsSinceEntry) <= EntryPrice-PriceScale*최소수익틱수 Then ExitShort("매도스탑x",AtStop,lowest(L,BarsSinceEntry)+PriceScale*수익감소틱수); } IF Xtime > ST Then SetStopEndofday(Xtime); Else { if sDate != sDate[1] Then SetStopEndofday(Xtime); } if (sdate != sdate[1] and stime >= ST) or (sdate == sdate[1] and stime >= ST and stime[1] < ST) Then { IF Xtime <= ST Then { SetStopEndofday(0); } }
시스템
답변 3
프로필 이미지

예스스탁 예스스탁 답변

2021-09-17 14:09:07

안녕하세요 예스스탁입니다. input : position1(1),ntime1(100000),vol1(1); input : position2(1),ntime2(110000),vol2(1); input : xtime(55800); input : 최소수익틱수(100),수익감소틱수(20),손절포인트(50); var : ST(0),T(0),HH(0),LL(0); if Bdate != Bdate[1] Then { ST = sTime; T = 0; } if ST > 0 then { if (sdate != sdate[1] and stime >= ntime1) or (sdate == sdate[1] and stime >= ntime1 and stime[1] < ntime1) Then { if position1 == 1 Then Buy("매수-1",OnClose,DEf,vol1); if position1 == -1 Then Sell("매도-1",OnClose,DEf,vol1); T = 1; HH = H; LL = L; } if (sdate != sdate[1] and stime >= ntime2) or (sdate == sdate[1] and stime >= ntime2 and stime[1] < ntime2) Then { if position2 == 1 Then Buy("매수-2",OnClose,DEf,vol2); if position2 == -1 Then Sell("매도-2",OnClose,DEf,vol2); T = 2; } if T == 1 Then { if H > HH Then HH = H; if L < LL Then LL = L; } if MarketPosition == 1 and Highest(H,BarsSinceEntry) >= EntryPrice+PriceScale*최소수익틱수 Then ExitLong("매수스탑x",AtStop,Highest(H,BarsSinceEntry)-PriceScale*수익감소틱수); if MarketPosition == -1 and lowest(L,BarsSinceEntry) <= EntryPrice-PriceScale*최소수익틱수 Then ExitShort("매도스탑x",AtStop,lowest(L,BarsSinceEntry)+PriceScale*수익감소틱수); if MarketPosition == 1 and T == 2 and MaxEntries == 2 Then ExitLong("매수손절",AtStop,LL-손절포인트); if MarketPosition == -1 and T == 2 and MaxEntries == 2 Then ExitShort("매도손절",AtStop,HH+손절포인트); } IF Xtime > ST Then SetStopEndofday(Xtime); Else { if sDate != sDate[1] Then SetStopEndofday(Xtime); } if (sdate != sdate[1] and stime >= ST) or (sdate == sdate[1] and stime >= ST and stime[1] < ST) Then { IF Xtime <= ST Then { SetStopEndofday(0); } } 즐거운 한가위 되시길 바랍니다. > 스카스카 님이 쓴 글입니다. > 제목 : 문의드려요~ 감사합니다. > 아래 수식을 잘 사용중입니다. ★아래 수식에 추가 사항요청이 있습니다. ^^ - 추가요청사항 (강제청산) (1분봉기준) 이미 진입한 포지션에 따라 오전 10시부터 11시50분까지 최대 or 최저 분봉 기준 50포인트 이상시 강제청산 하는 내용입니다. ^^ 예) 10시에 1개 11시에 1개 총 2개 매수진입... 10~11:50 분까지 지켜본 12시부터 그 사이 가장 저점인 봉 기준 50포인트 아래는 전체 포지션 강제청산 예) 10시에 1개 11시에 1개 총 2개 매도진입... 10~11:50 분까지 지켜본 12시부터 그 사이 가장 고점인 봉 기준 50포인트 위는 전체 포지션 강제청산 최대한 변수지정으로 해주시면 감사하겠습니다. ^^ 명절 행복하게 보내세요~ 감사합니다~ 기존 쓰고있는 수식 ------------------------------------------------------------------------------------- input : position1(1),ntime1(100000),vol1(1); input : position2(1),ntime2(110000),vol2(1); input : xtime(55800); input : 최소수익틱수(100),수익감소틱수(20); var : ST(0); if Bdate != Bdate[1] Then { ST = sTime; } if ST > 0 then { if (sdate != sdate[1] and stime >= ntime1) or (sdate == sdate[1] and stime >= ntime1 and stime[1] < ntime1) Then { if position1 == 1 Then Buy("매수-1",OnClose,DEf,vol1); if position1 == -1 Then Sell("매도-1",OnClose,DEf,vol1); } if (sdate != sdate[1] and stime >= ntime2) or (sdate == sdate[1] and stime >= ntime2 and stime[1] < ntime2) Then { if position2 == 1 Then Buy("매수-2",OnClose,DEf,vol2); if position2 == -1 Then Sell("매도-2",OnClose,DEf,vol2); } if MarketPosition == 1 and Highest(H,BarsSinceEntry) >= EntryPrice+PriceScale*최소수익틱수 Then ExitLong("매수스탑x",AtStop,Highest(H,BarsSinceEntry)-PriceScale*수익감소틱수); if MarketPosition == -1 and lowest(L,BarsSinceEntry) <= EntryPrice-PriceScale*최소수익틱수 Then ExitShort("매도스탑x",AtStop,lowest(L,BarsSinceEntry)+PriceScale*수익감소틱수); } IF Xtime > ST Then SetStopEndofday(Xtime); Else { if sDate != sDate[1] Then SetStopEndofday(Xtime); } if (sdate != sdate[1] and stime >= ST) or (sdate == sdate[1] and stime >= ST and stime[1] < ST) Then { IF Xtime <= ST Then { SetStopEndofday(0); } }
프로필 이미지

스카스카

2021-09-17 14:27:45

감사합니다.~ 기준시간이 빠져 원하는 결과가 나오지 않는것 같습니다. ^^ 예) 10시에서 11:50 분까지 기준으로 진입된 반대방향 봉으로 12시 이후부터 +50포인트시 청산입니다. ---------------------------------------------------------------------------------- > 예스스탁 님이 쓴 글입니다. > 제목 : Re : 문의드려요~ 감사합니다. > 안녕하세요 예스스탁입니다. input : position1(1),ntime1(100000),vol1(1); input : position2(1),ntime2(110000),vol2(1); input : xtime(55800); input : 최소수익틱수(100),수익감소틱수(20),손절포인트(50); var : ST(0),T(0),HH(0),LL(0); if Bdate != Bdate[1] Then { ST = sTime; T = 0; } if ST > 0 then { if (sdate != sdate[1] and stime >= ntime1) or (sdate == sdate[1] and stime >= ntime1 and stime[1] < ntime1) Then { if position1 == 1 Then Buy("매수-1",OnClose,DEf,vol1); if position1 == -1 Then Sell("매도-1",OnClose,DEf,vol1); T = 1; HH = H; LL = L; } if (sdate != sdate[1] and stime >= ntime2) or (sdate == sdate[1] and stime >= ntime2 and stime[1] < ntime2) Then { if position2 == 1 Then Buy("매수-2",OnClose,DEf,vol2); if position2 == -1 Then Sell("매도-2",OnClose,DEf,vol2); T = 2; } if T == 1 Then { if H > HH Then HH = H; if L < LL Then LL = L; } if MarketPosition == 1 and Highest(H,BarsSinceEntry) >= EntryPrice+PriceScale*최소수익틱수 Then ExitLong("매수스탑x",AtStop,Highest(H,BarsSinceEntry)-PriceScale*수익감소틱수); if MarketPosition == -1 and lowest(L,BarsSinceEntry) <= EntryPrice-PriceScale*최소수익틱수 Then ExitShort("매도스탑x",AtStop,lowest(L,BarsSinceEntry)+PriceScale*수익감소틱수); if MarketPosition == 1 and T == 2 and MaxEntries == 2 Then ExitLong("매수손절",AtStop,LL-손절포인트); if MarketPosition == -1 and T == 2 and MaxEntries == 2 Then ExitShort("매도손절",AtStop,HH+손절포인트); } IF Xtime > ST Then SetStopEndofday(Xtime); Else { if sDate != sDate[1] Then SetStopEndofday(Xtime); } if (sdate != sdate[1] and stime >= ST) or (sdate == sdate[1] and stime >= ST and stime[1] < ST) Then { IF Xtime <= ST Then { SetStopEndofday(0); } } 즐거운 한가위 되시길 바랍니다. > 스카스카 님이 쓴 글입니다. > 제목 : 문의드려요~ 감사합니다. > 아래 수식을 잘 사용중입니다. ★아래 수식에 추가 사항요청이 있습니다. ^^ - 추가요청사항 (강제청산) (1분봉기준) 이미 진입한 포지션에 따라 오전 10시부터 11시50분까지 최대 or 최저 분봉 기준 50포인트 이상시 강제청산 하는 내용입니다. ^^ 예) 10시에 1개 11시에 1개 총 2개 매수진입... 10~11:50 분까지 지켜본 12시부터 그 사이 가장 저점인 봉 기준 50포인트 아래는 전체 포지션 강제청산 예) 10시에 1개 11시에 1개 총 2개 매도진입... 10~11:50 분까지 지켜본 12시부터 그 사이 가장 고점인 봉 기준 50포인트 위는 전체 포지션 강제청산 최대한 변수지정으로 해주시면 감사하겠습니다. ^^ 명절 행복하게 보내세요~ 감사합니다~ 기존 쓰고있는 수식 ------------------------------------------------------------------------------------- input : position1(1),ntime1(100000),vol1(1); input : position2(1),ntime2(110000),vol2(1); input : xtime(55800); input : 최소수익틱수(100),수익감소틱수(20); var : ST(0); if Bdate != Bdate[1] Then { ST = sTime; } if ST > 0 then { if (sdate != sdate[1] and stime >= ntime1) or (sdate == sdate[1] and stime >= ntime1 and stime[1] < ntime1) Then { if position1 == 1 Then Buy("매수-1",OnClose,DEf,vol1); if position1 == -1 Then Sell("매도-1",OnClose,DEf,vol1); } if (sdate != sdate[1] and stime >= ntime2) or (sdate == sdate[1] and stime >= ntime2 and stime[1] < ntime2) Then { if position2 == 1 Then Buy("매수-2",OnClose,DEf,vol2); if position2 == -1 Then Sell("매도-2",OnClose,DEf,vol2); } if MarketPosition == 1 and Highest(H,BarsSinceEntry) >= EntryPrice+PriceScale*최소수익틱수 Then ExitLong("매수스탑x",AtStop,Highest(H,BarsSinceEntry)-PriceScale*수익감소틱수); if MarketPosition == -1 and lowest(L,BarsSinceEntry) <= EntryPrice-PriceScale*최소수익틱수 Then ExitShort("매도스탑x",AtStop,lowest(L,BarsSinceEntry)+PriceScale*수익감소틱수); } IF Xtime > ST Then SetStopEndofday(Xtime); Else { if sDate != sDate[1] Then SetStopEndofday(Xtime); } if (sdate != sdate[1] and stime >= ST) or (sdate == sdate[1] and stime >= ST and stime[1] < ST) Then { IF Xtime <= ST Then { SetStopEndofday(0); } }
프로필 이미지

예스스탁 예스스탁 답변

2021-09-17 14:42:24

안녕하세요 예스스탁입니다. 기존식은 ntime1~ntime2시간동안이었습니다. 별도로 extime1,extime2,extiume3으로로 시간지정 가능하게 수정해 드립니다. input : position1(1),ntime1(100000),vol1(1); input : position2(1),ntime2(110000),vol2(1); input : extime1(100000),extime2(115000),extime3(120000); input : xtime(55800); input : 최소수익틱수(100),수익감소틱수(20),손절포인트(50); var : ST(0),T(0),HH(0),LL(0); if Bdate != Bdate[1] Then { ST = sTime; T = 0; } if ST > 0 then { if (sdate != sdate[1] and stime >= ntime1) or (sdate == sdate[1] and stime >= ntime1 and stime[1] < ntime1) Then { if position1 == 1 Then Buy("매수-1",OnClose,DEf,vol1); if position1 == -1 Then Sell("매도-1",OnClose,DEf,vol1); } if (sdate != sdate[1] and stime >= ntime2) or (sdate == sdate[1] and stime >= ntime2 and stime[1] < ntime2) Then { if position2 == 1 Then Buy("매수-2",OnClose,DEf,vol2); if position2 == -1 Then Sell("매도-2",OnClose,DEf,vol2); } if MarketPosition == 1 and Highest(H,BarsSinceEntry) >= EntryPrice+PriceScale*최소수익틱수 Then ExitLong("매수스탑x",AtStop,Highest(H,BarsSinceEntry)-PriceScale*수익감소틱수); if MarketPosition == -1 and lowest(L,BarsSinceEntry) <= EntryPrice-PriceScale*최소수익틱수 Then ExitShort("매도스탑x",AtStop,lowest(L,BarsSinceEntry)+PriceScale*수익감소틱수); if (sdate != sdate[1] and stime >= extime1) or (sdate == sdate[1] and stime >= extime1 and stime[1] < extime1) Then { T = 1; HH = H; LL = L; } if T == 1 Then { if H > HH Then HH = H; if L < LL Then LL = L; } if (sdate != sdate[1] and stime >= extime2) or (sdate == sdate[1] and stime >= extime2 and stime[1] < extime2) Then { T = 2; } if (sdate != sdate[1] and stime >= extime3) or (sdate == sdate[1] and stime >= extime3 and stime[1] < extime3) Then { T = 3; } if MarketPosition == 1 and T == 3 Then ExitLong("매수손절",AtStop,LL-손절포인트); if MarketPosition == -1 and T == 3 Then ExitShort("매도손절",AtStop,HH+손절포인트); } IF Xtime > ST Then SetStopEndofday(Xtime); Else { if sDate != sDate[1] Then SetStopEndofday(Xtime); } if (sdate != sdate[1] and stime >= ST) or (sdate == sdate[1] and stime >= ST and stime[1] < ST) Then { IF Xtime <= ST Then { SetStopEndofday(0); } } 즐거운 한가위 되시길 바랍니다. > 스카스카 님이 쓴 글입니다. > 제목 : Re : Re : 문의드려요~ 감사합니다. > 감사합니다.~ 기준시간이 빠져 원하는 결과가 나오지 않는것 같습니다. ^^ 예) 10시에서 11:50 분까지 기준으로 진입된 반대방향 봉으로 12시 이후부터 +50포인트시 청산입니다. ---------------------------------------------------------------------------------- > 예스스탁 님이 쓴 글입니다. > 제목 : Re : 문의드려요~ 감사합니다. > 안녕하세요 예스스탁입니다. input : position1(1),ntime1(100000),vol1(1); input : position2(1),ntime2(110000),vol2(1); input : xtime(55800); input : 최소수익틱수(100),수익감소틱수(20),손절포인트(50); var : ST(0),T(0),HH(0),LL(0); if Bdate != Bdate[1] Then { ST = sTime; T = 0; } if ST > 0 then { if (sdate != sdate[1] and stime >= ntime1) or (sdate == sdate[1] and stime >= ntime1 and stime[1] < ntime1) Then { if position1 == 1 Then Buy("매수-1",OnClose,DEf,vol1); if position1 == -1 Then Sell("매도-1",OnClose,DEf,vol1); T = 1; HH = H; LL = L; } if (sdate != sdate[1] and stime >= ntime2) or (sdate == sdate[1] and stime >= ntime2 and stime[1] < ntime2) Then { if position2 == 1 Then Buy("매수-2",OnClose,DEf,vol2); if position2 == -1 Then Sell("매도-2",OnClose,DEf,vol2); T = 2; } if T == 1 Then { if H > HH Then HH = H; if L < LL Then LL = L; } if MarketPosition == 1 and Highest(H,BarsSinceEntry) >= EntryPrice+PriceScale*최소수익틱수 Then ExitLong("매수스탑x",AtStop,Highest(H,BarsSinceEntry)-PriceScale*수익감소틱수); if MarketPosition == -1 and lowest(L,BarsSinceEntry) <= EntryPrice-PriceScale*최소수익틱수 Then ExitShort("매도스탑x",AtStop,lowest(L,BarsSinceEntry)+PriceScale*수익감소틱수); if MarketPosition == 1 and T == 2 and MaxEntries == 2 Then ExitLong("매수손절",AtStop,LL-손절포인트); if MarketPosition == -1 and T == 2 and MaxEntries == 2 Then ExitShort("매도손절",AtStop,HH+손절포인트); } IF Xtime > ST Then SetStopEndofday(Xtime); Else { if sDate != sDate[1] Then SetStopEndofday(Xtime); } if (sdate != sdate[1] and stime >= ST) or (sdate == sdate[1] and stime >= ST and stime[1] < ST) Then { IF Xtime <= ST Then { SetStopEndofday(0); } } 즐거운 한가위 되시길 바랍니다. > 스카스카 님이 쓴 글입니다. > 제목 : 문의드려요~ 감사합니다. > 아래 수식을 잘 사용중입니다. ★아래 수식에 추가 사항요청이 있습니다. ^^ - 추가요청사항 (강제청산) (1분봉기준) 이미 진입한 포지션에 따라 오전 10시부터 11시50분까지 최대 or 최저 분봉 기준 50포인트 이상시 강제청산 하는 내용입니다. ^^ 예) 10시에 1개 11시에 1개 총 2개 매수진입... 10~11:50 분까지 지켜본 12시부터 그 사이 가장 저점인 봉 기준 50포인트 아래는 전체 포지션 강제청산 예) 10시에 1개 11시에 1개 총 2개 매도진입... 10~11:50 분까지 지켜본 12시부터 그 사이 가장 고점인 봉 기준 50포인트 위는 전체 포지션 강제청산 최대한 변수지정으로 해주시면 감사하겠습니다. ^^ 명절 행복하게 보내세요~ 감사합니다~ 기존 쓰고있는 수식 ------------------------------------------------------------------------------------- input : position1(1),ntime1(100000),vol1(1); input : position2(1),ntime2(110000),vol2(1); input : xtime(55800); input : 최소수익틱수(100),수익감소틱수(20); var : ST(0); if Bdate != Bdate[1] Then { ST = sTime; } if ST > 0 then { if (sdate != sdate[1] and stime >= ntime1) or (sdate == sdate[1] and stime >= ntime1 and stime[1] < ntime1) Then { if position1 == 1 Then Buy("매수-1",OnClose,DEf,vol1); if position1 == -1 Then Sell("매도-1",OnClose,DEf,vol1); } if (sdate != sdate[1] and stime >= ntime2) or (sdate == sdate[1] and stime >= ntime2 and stime[1] < ntime2) Then { if position2 == 1 Then Buy("매수-2",OnClose,DEf,vol2); if position2 == -1 Then Sell("매도-2",OnClose,DEf,vol2); } if MarketPosition == 1 and Highest(H,BarsSinceEntry) >= EntryPrice+PriceScale*최소수익틱수 Then ExitLong("매수스탑x",AtStop,Highest(H,BarsSinceEntry)-PriceScale*수익감소틱수); if MarketPosition == -1 and lowest(L,BarsSinceEntry) <= EntryPrice-PriceScale*최소수익틱수 Then ExitShort("매도스탑x",AtStop,lowest(L,BarsSinceEntry)+PriceScale*수익감소틱수); } IF Xtime > ST Then SetStopEndofday(Xtime); Else { if sDate != sDate[1] Then SetStopEndofday(Xtime); } if (sdate != sdate[1] and stime >= ST) or (sdate == sdate[1] and stime >= ST and stime[1] < ST) Then { IF Xtime <= ST Then { SetStopEndofday(0); } }