커뮤니티

문의 드립니다.

프로필 이미지
에리카
2021-10-07 15:55:31
1255
글번호 152745
답변완료
1. 항셍(오전 10시 18분 ~ 오전 11시 40분), 나스닥(22시 30분 ~ 01시 10분) 골드(21시 ~22시 10분) 거래시간 지정 2. 매도신호가 나오는 캔들의 종가에 매도. 음봉일 때만 매도(양봉일 때는 안함) 3. 매수신호가 나오는 캔들의 종가에 매수. 양봉일 때만 매수(음봉일 때는 안함) 4. 매수와 매도, 모두1계약을 진입합니다. 항셍 10시 18분 ~ 10시 30분까지는 익절 30틱, 손절 30틱 / 10시 30분 ~ 11시 40분까지는 익절 50틱, 손절 30틱. 나스닥은 오후 22시 30분 ~ 01시 10분까지 익절 50틱, 손절 30틱 골드는 오후 21시 ~ 22시 10분까지 익절 20틱, 손절 15틱 5. 거래시간 종료시에 포지션이 있을 경우 수식에 따라 익절 또는 손절 종료함. 6. 익절 3회 연속, 또는 손절 3회 연속이면 당일 거래 종료. 아래에 수식은 일전에 문의한 것에 대해 답을 해주신 것입니다. 위 내용에 대한 수식으로의 변경을 할 경우, 추가나 수정해야 할 부분이 헷갈려서요. 답변 부탁드립니다. 늘 친절히 답변해주심에 감사드립니다. input : StartTime(101500),EndTime(120000); input : Length(20), D1(2); 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; var1 = BollBandUp(Length,D1); var2 = BollBandDown(Length,D1); if Tcond == true Then { If CrossUP(H,var1) and c > o then Buy("b",OnClose,DEF,2); If CrossDown(L,Var2) and C < O then Sell("s",OnClose,DEF,2); } if MarketPosition == 1 Then { ExitLong("Bp1",AtLimit,EntryPrice+PriceScale*50,"",1,1); ExitLong("Bp2",AtLimit,EntryPrice+PriceScale*100,"",1,1); ExitLong("Bl",AtStop,EntryPrice-PriceScale*3,"",1,1); if CurrentContracts < MaxContracts and Highest(H,BarsSinceEntry) > EntryPrice+PriceScale*50 Then ExitLong("btr",AtStop,EntryPrice+PriceScale*10); } if MarketPosition == -1 Then { ExitShort("sp1",AtLimit,EntryPrice-PriceScale*50,"",1,1); ExitShort("sp2",AtLimit,EntryPrice-PriceScale*100,"",1,1); ExitShort("sl",AtStop,EntryPrice+PriceScale*3,"",1,1); if CurrentContracts < MaxContracts and lowest(L,BarsSinceEntry) < EntryPrice-PriceScale*50 Then ExitShort("str",AtStop,EntryPrice+PriceScale*10); } 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); } } 2 24시는 0시 입니다. input : StartTime(223000),EndTime(0); input : Length(20), D1(2); 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; var1 = BollBandUp(Length,D1); var2 = BollBandDown(Length,D1); if Tcond == true Then { If CrossUP(H,var1) and c > o then Buy("b",OnClose,DEF,2); If CrossDown(L,Var2) and C < O then Sell("s",OnClose,DEF,2); } if MarketPosition == 1 Then { ExitLong("Bp1",AtLimit,EntryPrice+PriceScale*50,"",1,1); ExitLong("Bp2",AtLimit,EntryPrice+PriceScale*100,"",1,1); ExitLong("Bl",AtStop,EntryPrice-PriceScale*3,"",1,1); if CurrentContracts < MaxContracts and Highest(H,BarsSinceEntry) > EntryPrice+PriceScale*50 Then ExitLong("btr",AtStop,EntryPrice+PriceScale*10); } if MarketPosition == -1 Then { ExitShort("sp1",AtLimit,EntryPrice-PriceScale*50,"",1,1); ExitShort("sp2",AtLimit,EntryPrice-PriceScale*100,"",1,1); ExitShort("sl",AtStop,EntryPrice+PriceScale*3,"",1,1); if CurrentContracts < MaxContracts and lowest(L,BarsSinceEntry) < EntryPrice-PriceScale*50 Then ExitShort("str",AtStop,EntryPrice+PriceScale*10); } 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); } }
시스템
답변 4
프로필 이미지

예스스탁 예스스탁 답변

2021-10-07 17:14:13

안녕하세요 예스스탁입니다. 1.항셍 input : StartTime(101800),EndTime(114000); input : Length(20), D1(2); input : 익절1(30),손절1(30),청산구분시간(103000),익절2(50),손절2(30),익절연속횟수(3),손절연속횟수(3); 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("bp",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,EntryPrice+PriceScale*익절1,"",1,1); ExitLong("bl.",AtStop,EntryPrice-PriceScale*손절1,"",1,1); } If CrossDown(L,Var2) and C < O and profit < 익절연속횟수 and loss < 손절연속횟수 then { Sell("s",OnClose,DEF,1); ExitShort("sp.",AtLimit,EntryPrice-PriceScale*익절1,"",1,1); ExitShort("sl.",AtStop,EntryPrice+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); } } 2 나스닥 input : StartTime(223000),EndTime(011000); input : Length(20), D1(2); input : 익절(50),손절(30),익절연속횟수(3),손절연속횟수(3); 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("bp",1) or IsExitName("sp.",1) or IsExitName("sp1",1) Then profit = profit+1; Else profit = 0; if IsExitName("bl.",1) or IsExitName("bl",1) or IsExitName("sl.",1) or IsExitName("sl1",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,EntryPrice+PriceScale*익절,"",1,1); ExitLong("bl.",AtStop,EntryPrice-PriceScale*손절,"",1,1); } If CrossDown(L,Var2) and C < O and profit < 익절연속횟수 and loss < 손절연속횟수 then { Sell("s",OnClose,DEF,1); ExitShort("sp.",AtLimit,EntryPrice-PriceScale*익절,"",1,1); ExitShort("sl.",AtStop,EntryPrice+PriceScale*손절,"",1,1); } } if MarketPosition == 1 Then { ExitLong("bp",AtLimit,EntryPrice+PriceScale*익절,"",1,1); ExitLong("bl",AtStop,EntryPrice-PriceScale*손절,"",1,1); } if MarketPosition == -1 Then { ExitShort("sp",AtLimit,EntryPrice-PriceScale*익절,"",1,1); ExitShort("sl",AtStop,EntryPrice+PriceScale*손절,"",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); } } 3. 골드 input : StartTime(210000),EndTime(221000); input : Length(20), D1(2); input : 익절(20),손절(15),익절연속횟수(3),손절연속횟수(3); 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("bp",1) or IsExitName("sp.",1) or IsExitName("sp1",1) Then profit = profit+1; Else profit = 0; if IsExitName("bl.",1) or IsExitName("bl",1) or IsExitName("sl.",1) or IsExitName("sl1",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,EntryPrice+PriceScale*익절,"",1,1); ExitLong("bl.",AtStop,EntryPrice-PriceScale*손절,"",1,1); } If CrossDown(L,Var2) and C < O and profit < 익절연속횟수 and loss < 손절연속횟수 then { Sell("s",OnClose,DEF,1); ExitShort("sp.",AtLimit,EntryPrice-PriceScale*익절,"",1,1); ExitShort("sl.",AtStop,EntryPrice+PriceScale*손절,"",1,1); } } if MarketPosition == 1 Then { ExitLong("bp",AtLimit,EntryPrice+PriceScale*익절,"",1,1); ExitLong("bl",AtStop,EntryPrice-PriceScale*손절,"",1,1); } if MarketPosition == -1 Then { ExitShort("sp",AtLimit,EntryPrice-PriceScale*익절,"",1,1); ExitShort("sl",AtStop,EntryPrice+PriceScale*손절,"",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); } } 즐거운 하루되세요 > 에리카 님이 쓴 글입니다. > 제목 : 문의 드립니다. > 1. 항셍(오전 10시 18분 ~ 오전 11시 40분), 나스닥(22시 30분 ~ 01시 10분) 골드(21시 ~22시 10분) 거래시간 지정 2. 매도신호가 나오는 캔들의 종가에 매도. 음봉일 때만 매도(양봉일 때는 안함) 3. 매수신호가 나오는 캔들의 종가에 매수. 양봉일 때만 매수(음봉일 때는 안함) 4. 매수와 매도, 모두1계약을 진입합니다. 항셍 10시 18분 ~ 10시 30분까지는 익절 30틱, 손절 30틱 / 10시 30분 ~ 11시 40분까지는 익절 50틱, 손절 30틱. 나스닥은 오후 22시 30분 ~ 01시 10분까지 익절 50틱, 손절 30틱 골드는 오후 21시 ~ 22시 10분까지 익절 20틱, 손절 15틱 5. 거래시간 종료시에 포지션이 있을 경우 수식에 따라 익절 또는 손절 종료함. 6. 익절 3회 연속, 또는 손절 3회 연속이면 당일 거래 종료. 아래에 수식은 일전에 문의한 것에 대해 답을 해주신 것입니다. 위 내용에 대한 수식으로의 변경을 할 경우, 추가나 수정해야 할 부분이 헷갈려서요. 답변 부탁드립니다. 늘 친절히 답변해주심에 감사드립니다. input : StartTime(101500),EndTime(120000); input : Length(20), D1(2); 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; var1 = BollBandUp(Length,D1); var2 = BollBandDown(Length,D1); if Tcond == true Then { If CrossUP(H,var1) and c > o then Buy("b",OnClose,DEF,2); If CrossDown(L,Var2) and C < O then Sell("s",OnClose,DEF,2); } if MarketPosition == 1 Then { ExitLong("Bp1",AtLimit,EntryPrice+PriceScale*50,"",1,1); ExitLong("Bp2",AtLimit,EntryPrice+PriceScale*100,"",1,1); ExitLong("Bl",AtStop,EntryPrice-PriceScale*3,"",1,1); if CurrentContracts < MaxContracts and Highest(H,BarsSinceEntry) > EntryPrice+PriceScale*50 Then ExitLong("btr",AtStop,EntryPrice+PriceScale*10); } if MarketPosition == -1 Then { ExitShort("sp1",AtLimit,EntryPrice-PriceScale*50,"",1,1); ExitShort("sp2",AtLimit,EntryPrice-PriceScale*100,"",1,1); ExitShort("sl",AtStop,EntryPrice+PriceScale*3,"",1,1); if CurrentContracts < MaxContracts and lowest(L,BarsSinceEntry) < EntryPrice-PriceScale*50 Then ExitShort("str",AtStop,EntryPrice+PriceScale*10); } 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); } } 2 24시는 0시 입니다. input : StartTime(223000),EndTime(0); input : Length(20), D1(2); 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; var1 = BollBandUp(Length,D1); var2 = BollBandDown(Length,D1); if Tcond == true Then { If CrossUP(H,var1) and c > o then Buy("b",OnClose,DEF,2); If CrossDown(L,Var2) and C < O then Sell("s",OnClose,DEF,2); } if MarketPosition == 1 Then { ExitLong("Bp1",AtLimit,EntryPrice+PriceScale*50,"",1,1); ExitLong("Bp2",AtLimit,EntryPrice+PriceScale*100,"",1,1); ExitLong("Bl",AtStop,EntryPrice-PriceScale*3,"",1,1); if CurrentContracts < MaxContracts and Highest(H,BarsSinceEntry) > EntryPrice+PriceScale*50 Then ExitLong("btr",AtStop,EntryPrice+PriceScale*10); } if MarketPosition == -1 Then { ExitShort("sp1",AtLimit,EntryPrice-PriceScale*50,"",1,1); ExitShort("sp2",AtLimit,EntryPrice-PriceScale*100,"",1,1); ExitShort("sl",AtStop,EntryPrice+PriceScale*3,"",1,1); if CurrentContracts < MaxContracts and lowest(L,BarsSinceEntry) < EntryPrice-PriceScale*50 Then ExitShort("str",AtStop,EntryPrice+PriceScale*10); } 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-07 22:31:27

늘 감사드립니다. 골드 문의 드린 것에 답변 주신 수식대로 오늘 저녁에 진행을 해봤습니다. 그런데 거래에 어떤 문제가 있어 보입니다. 익절 청산이나 손절 청산이 제대로 되지 않고 거래가 종료되었습니다. 3회 있었는데 똑같은 현상입니다. 거래내역과 차트 사진 올려 드리니 무엇이 문제인지 체크 부탁드립니다. 거듭 감사드립니다. > 예스스탁 님이 쓴 글입니다. > 제목 : Re : 문의 드립니다. > 안녕하세요 예스스탁입니다. 골드 input : StartTime(210000),EndTime(221000); input : Length(20), D1(2); input : 익절(20),손절(15),익절연속횟수(3),손절연속횟수(3); 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("bp",1) or IsExitName("sp.",1) or IsExitName("sp1",1) Then profit = profit+1; Else profit = 0; if IsExitName("bl.",1) or IsExitName("bl",1) or IsExitName("sl.",1) or IsExitName("sl1",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,EntryPrice+PriceScale*익절,"",1,1); ExitLong("bl.",AtStop,EntryPrice-PriceScale*손절,"",1,1); } If CrossDown(L,Var2) and C < O and profit < 익절연속횟수 and loss < 손절연속횟수 then { Sell("s",OnClose,DEF,1); ExitShort("sp.",AtLimit,EntryPrice-PriceScale*익절,"",1,1); ExitShort("sl.",AtStop,EntryPrice+PriceScale*손절,"",1,1); } } if MarketPosition == 1 Then { ExitLong("bp",AtLimit,EntryPrice+PriceScale*익절,"",1,1); ExitLong("bl",AtStop,EntryPrice-PriceScale*손절,"",1,1); } if MarketPosition == -1 Then { ExitShort("sp",AtLimit,EntryPrice-PriceScale*익절,"",1,1); ExitShort("sl",AtStop,EntryPrice+PriceScale*손절,"",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); } } 즐거운 하루되세요 > 에리카 님이 쓴 글입니다. > 제목 : 문의 드립니다. > 1. 항셍(오전 10시 18분 ~ 오전 11시 40분), 나스닥(22시 30분 ~ 01시 10분) 골드(21시 ~22시 10분) 거래시간 지정 2. 매도신호가 나오는 캔들의 종가에 매도. 음봉일 때만 매도(양봉일 때는 안함) 3. 매수신호가 나오는 캔들의 종가에 매수. 양봉일 때만 매수(음봉일 때는 안함) 4. 매수와 매도, 모두1계약을 진입합니다. 항셍 10시 18분 ~ 10시 30분까지는 익절 30틱, 손절 30틱 / 10시 30분 ~ 11시 40분까지는 익절 50틱, 손절 30틱. 나스닥은 오후 22시 30분 ~ 01시 10분까지 익절 50틱, 손절 30틱 골드는 오후 21시 ~ 22시 10분까지 익절 20틱, 손절 15틱 5. 거래시간 종료시에 포지션이 있을 경우 수식에 따라 익절 또는 손절 종료함. 6. 익절 3회 연속, 또는 손절 3회 연속이면 당일 거래 종료. 아래에 수식은 일전에 문의한 것에 대해 답을 해주신 것입니다. 위 내용에 대한 수식으로의 변경을 할 경우, 추가나 수정해야 할 부분이 헷갈려서요. 답변 부탁드립니다. 늘 친절히 답변해주심에 감사드립니다. input : StartTime(101500),EndTime(120000); input : Length(20), D1(2); 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; var1 = BollBandUp(Length,D1); var2 = BollBandDown(Length,D1); if Tcond == true Then { If CrossUP(H,var1) and c > o then Buy("b",OnClose,DEF,2); If CrossDown(L,Var2) and C < O then Sell("s",OnClose,DEF,2); } if MarketPosition == 1 Then { ExitLong("Bp1",AtLimit,EntryPrice+PriceScale*50,"",1,1); ExitLong("Bp2",AtLimit,EntryPrice+PriceScale*100,"",1,1); ExitLong("Bl",AtStop,EntryPrice-PriceScale*3,"",1,1); if CurrentContracts < MaxContracts and Highest(H,BarsSinceEntry) > EntryPrice+PriceScale*50 Then ExitLong("btr",AtStop,EntryPrice+PriceScale*10); } if MarketPosition == -1 Then { ExitShort("sp1",AtLimit,EntryPrice-PriceScale*50,"",1,1); ExitShort("sp2",AtLimit,EntryPrice-PriceScale*100,"",1,1); ExitShort("sl",AtStop,EntryPrice+PriceScale*3,"",1,1); if CurrentContracts < MaxContracts and lowest(L,BarsSinceEntry) < EntryPrice-PriceScale*50 Then ExitShort("str",AtStop,EntryPrice+PriceScale*10); } 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); } } 2 24시는 0시 입니다. input : StartTime(223000),EndTime(0); input : Length(20), D1(2); 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; var1 = BollBandUp(Length,D1); var2 = BollBandDown(Length,D1); if Tcond == true Then { If CrossUP(H,var1) and c > o then Buy("b",OnClose,DEF,2); If CrossDown(L,Var2) and C < O then Sell("s",OnClose,DEF,2); } if MarketPosition == 1 Then { ExitLong("Bp1",AtLimit,EntryPrice+PriceScale*50,"",1,1); ExitLong("Bp2",AtLimit,EntryPrice+PriceScale*100,"",1,1); ExitLong("Bl",AtStop,EntryPrice-PriceScale*3,"",1,1); if CurrentContracts < MaxContracts and Highest(H,BarsSinceEntry) > EntryPrice+PriceScale*50 Then ExitLong("btr",AtStop,EntryPrice+PriceScale*10); } if MarketPosition == -1 Then { ExitShort("sp1",AtLimit,EntryPrice-PriceScale*50,"",1,1); ExitShort("sp2",AtLimit,EntryPrice-PriceScale*100,"",1,1); ExitShort("sl",AtStop,EntryPrice+PriceScale*3,"",1,1); if CurrentContracts < MaxContracts and lowest(L,BarsSinceEntry) < EntryPrice-PriceScale*50 Then ExitShort("str",AtStop,EntryPrice+PriceScale*10); } 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-08 10:04:40

안녕하세요 예스스탁입니다. 3개종목 수식 다시올려드립니다. 첫봉에서 나오는 익절/손절수식에 문제가 있었습니다. 1.항셍 input : StartTime(101800),EndTime(114000); input : Length(20), D1(2); input : 익절1(30),손절1(30),청산구분시간(103000),익절2(50),손절2(30),익절연속횟수(3),손절연속횟수(3); 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); } } 2 나스닥 input : StartTime(223000),EndTime(011000); input : Length(20), D1(2); input : 익절(50),손절(30),익절연속횟수(3),손절연속횟수(3); 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("bp",1) or IsExitName("sp.",1) or IsExitName("sp",1) Then profit = profit+1; Else profit = 0; if IsExitName("bl.",1) or IsExitName("bl",1) or IsExitName("sl.",1) or IsExitName("sl",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); ExitLong("bl.",AtStop,C-PriceScale*손절,"",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); ExitShort("sl.",AtStop,C+PriceScale*손절,"",1,1); } } if MarketPosition == 1 Then { ExitLong("bp",AtLimit,EntryPrice+PriceScale*익절,"",1,1); ExitLong("bl",AtStop,EntryPrice-PriceScale*손절,"",1,1); } if MarketPosition == -1 Then { ExitShort("sp",AtLimit,EntryPrice-PriceScale*익절,"",1,1); ExitShort("sl",AtStop,EntryPrice+PriceScale*손절,"",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); } } 3. 골드 input : StartTime(210000),EndTime(221000); input : Length(20), D1(2); input : 익절(20),손절(15),익절연속횟수(3),손절연속횟수(3); 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("bp",1) or IsExitName("sp.",1) or IsExitName("sp",1) Then profit = profit+1; Else profit = 0; if IsExitName("bl.",1) or IsExitName("bl",1) or IsExitName("sl.",1) or IsExitName("sl",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); ExitLong("bl.",AtStop,C-PriceScale*손절,"",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); ExitShort("sl.",AtStop,C+PriceScale*손절,"",1,1); } } if MarketPosition == 1 Then { ExitLong("bp",AtLimit,EntryPrice+PriceScale*익절,"",1,1); ExitLong("bl",AtStop,EntryPrice-PriceScale*손절,"",1,1); } if MarketPosition == -1 Then { ExitShort("sp",AtLimit,EntryPrice-PriceScale*익절,"",1,1); ExitShort("sl",AtStop,EntryPrice+PriceScale*손절,"",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); } } 즐거운 하루되세요 > 에리카 님이 쓴 글입니다. > 제목 : Re : Re : 문의 드립니다. > 늘 감사드립니다. 골드 문의 드린 것에 답변 주신 수식대로 오늘 저녁에 진행을 해봤습니다. 그런데 거래에 어떤 문제가 있어 보입니다. 익절 청산이나 손절 청산이 제대로 되지 않고 거래가 종료되었습니다. 3회 있었는데 똑같은 현상입니다. 거래내역과 차트 사진 올려 드리니 무엇이 문제인지 체크 부탁드립니다. 거듭 감사드립니다. > 예스스탁 님이 쓴 글입니다. > 제목 : Re : 문의 드립니다. > 안녕하세요 예스스탁입니다. 골드 input : StartTime(210000),EndTime(221000); input : Length(20), D1(2); input : 익절(20),손절(15),익절연속횟수(3),손절연속횟수(3); 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("bp",1) or IsExitName("sp.",1) or IsExitName("sp1",1) Then profit = profit+1; Else profit = 0; if IsExitName("bl.",1) or IsExitName("bl",1) or IsExitName("sl.",1) or IsExitName("sl1",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,EntryPrice+PriceScale*익절,"",1,1); ExitLong("bl.",AtStop,EntryPrice-PriceScale*손절,"",1,1); } If CrossDown(L,Var2) and C < O and profit < 익절연속횟수 and loss < 손절연속횟수 then { Sell("s",OnClose,DEF,1); ExitShort("sp.",AtLimit,EntryPrice-PriceScale*익절,"",1,1); ExitShort("sl.",AtStop,EntryPrice+PriceScale*손절,"",1,1); } } if MarketPosition == 1 Then { ExitLong("bp",AtLimit,EntryPrice+PriceScale*익절,"",1,1); ExitLong("bl",AtStop,EntryPrice-PriceScale*손절,"",1,1); } if MarketPosition == -1 Then { ExitShort("sp",AtLimit,EntryPrice-PriceScale*익절,"",1,1); ExitShort("sl",AtStop,EntryPrice+PriceScale*손절,"",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); } } 즐거운 하루되세요 > 에리카 님이 쓴 글입니다. > 제목 : 문의 드립니다. > 1. 항셍(오전 10시 18분 ~ 오전 11시 40분), 나스닥(22시 30분 ~ 01시 10분) 골드(21시 ~22시 10분) 거래시간 지정 2. 매도신호가 나오는 캔들의 종가에 매도. 음봉일 때만 매도(양봉일 때는 안함) 3. 매수신호가 나오는 캔들의 종가에 매수. 양봉일 때만 매수(음봉일 때는 안함) 4. 매수와 매도, 모두1계약을 진입합니다. 항셍 10시 18분 ~ 10시 30분까지는 익절 30틱, 손절 30틱 / 10시 30분 ~ 11시 40분까지는 익절 50틱, 손절 30틱. 나스닥은 오후 22시 30분 ~ 01시 10분까지 익절 50틱, 손절 30틱 골드는 오후 21시 ~ 22시 10분까지 익절 20틱, 손절 15틱 5. 거래시간 종료시에 포지션이 있을 경우 수식에 따라 익절 또는 손절 종료함. 6. 익절 3회 연속, 또는 손절 3회 연속이면 당일 거래 종료. 아래에 수식은 일전에 문의한 것에 대해 답을 해주신 것입니다. 위 내용에 대한 수식으로의 변경을 할 경우, 추가나 수정해야 할 부분이 헷갈려서요. 답변 부탁드립니다. 늘 친절히 답변해주심에 감사드립니다. input : StartTime(101500),EndTime(120000); input : Length(20), D1(2); 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; var1 = BollBandUp(Length,D1); var2 = BollBandDown(Length,D1); if Tcond == true Then { If CrossUP(H,var1) and c > o then Buy("b",OnClose,DEF,2); If CrossDown(L,Var2) and C < O then Sell("s",OnClose,DEF,2); } if MarketPosition == 1 Then { ExitLong("Bp1",AtLimit,EntryPrice+PriceScale*50,"",1,1); ExitLong("Bp2",AtLimit,EntryPrice+PriceScale*100,"",1,1); ExitLong("Bl",AtStop,EntryPrice-PriceScale*3,"",1,1); if CurrentContracts < MaxContracts and Highest(H,BarsSinceEntry) > EntryPrice+PriceScale*50 Then ExitLong("btr",AtStop,EntryPrice+PriceScale*10); } if MarketPosition == -1 Then { ExitShort("sp1",AtLimit,EntryPrice-PriceScale*50,"",1,1); ExitShort("sp2",AtLimit,EntryPrice-PriceScale*100,"",1,1); ExitShort("sl",AtStop,EntryPrice+PriceScale*3,"",1,1); if CurrentContracts < MaxContracts and lowest(L,BarsSinceEntry) < EntryPrice-PriceScale*50 Then ExitShort("str",AtStop,EntryPrice+PriceScale*10); } 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); } } 2 24시는 0시 입니다. input : StartTime(223000),EndTime(0); input : Length(20), D1(2); 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; var1 = BollBandUp(Length,D1); var2 = BollBandDown(Length,D1); if Tcond == true Then { If CrossUP(H,var1) and c > o then Buy("b",OnClose,DEF,2); If CrossDown(L,Var2) and C < O then Sell("s",OnClose,DEF,2); } if MarketPosition == 1 Then { ExitLong("Bp1",AtLimit,EntryPrice+PriceScale*50,"",1,1); ExitLong("Bp2",AtLimit,EntryPrice+PriceScale*100,"",1,1); ExitLong("Bl",AtStop,EntryPrice-PriceScale*3,"",1,1); if CurrentContracts < MaxContracts and Highest(H,BarsSinceEntry) > EntryPrice+PriceScale*50 Then ExitLong("btr",AtStop,EntryPrice+PriceScale*10); } if MarketPosition == -1 Then { ExitShort("sp1",AtLimit,EntryPrice-PriceScale*50,"",1,1); ExitShort("sp2",AtLimit,EntryPrice-PriceScale*100,"",1,1); ExitShort("sl",AtStop,EntryPrice+PriceScale*3,"",1,1); if CurrentContracts < MaxContracts and lowest(L,BarsSinceEntry) < EntryPrice-PriceScale*50 Then ExitShort("str",AtStop,EntryPrice+PriceScale*10); } 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-08 19:14:48

다시 주신 걸로 골드 트레이딩 해봤는데요. 차트상은 2회 익절 청산이 맞는데 거래내역은 다르게 나옵니다. '당일 청산'은 수식에 넣지도 않았는데 당일 청산 처리 되었습니다. 무슨 문제가 있을까요. 거래내역 올려드립니다. 감사합니다.~ > 예스스탁 님이 쓴 글입니다. > 제목 : Re : Re : Re : 문의 드립니다. > 안녕하세요 예스스탁입니다. 3개종목 수식 다시올려드립니다. 첫봉에서 나오는 익절/손절수식에 문제가 있었습니다. 1.항셍 input : StartTime(101800),EndTime(114000); input : Length(20), D1(2); input : 익절1(30),손절1(30),청산구분시간(103000),익절2(50),손절2(30),익절연속횟수(3),손절연속횟수(3); 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); } } 2 나스닥 input : StartTime(223000),EndTime(011000); input : Length(20), D1(2); input : 익절(50),손절(30),익절연속횟수(3),손절연속횟수(3); 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("bp",1) or IsExitName("sp.",1) or IsExitName("sp",1) Then profit = profit+1; Else profit = 0; if IsExitName("bl.",1) or IsExitName("bl",1) or IsExitName("sl.",1) or IsExitName("sl",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); ExitLong("bl.",AtStop,C-PriceScale*손절,"",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); ExitShort("sl.",AtStop,C+PriceScale*손절,"",1,1); } } if MarketPosition == 1 Then { ExitLong("bp",AtLimit,EntryPrice+PriceScale*익절,"",1,1); ExitLong("bl",AtStop,EntryPrice-PriceScale*손절,"",1,1); } if MarketPosition == -1 Then { ExitShort("sp",AtLimit,EntryPrice-PriceScale*익절,"",1,1); ExitShort("sl",AtStop,EntryPrice+PriceScale*손절,"",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); } } 3. 골드 input : StartTime(210000),EndTime(221000); input : Length(20), D1(2); input : 익절(20),손절(15),익절연속횟수(3),손절연속횟수(3); 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("bp",1) or IsExitName("sp.",1) or IsExitName("sp",1) Then profit = profit+1; Else profit = 0; if IsExitName("bl.",1) or IsExitName("bl",1) or IsExitName("sl.",1) or IsExitName("sl",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); ExitLong("bl.",AtStop,C-PriceScale*손절,"",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); ExitShort("sl.",AtStop,C+PriceScale*손절,"",1,1); } } if MarketPosition == 1 Then { ExitLong("bp",AtLimit,EntryPrice+PriceScale*익절,"",1,1); ExitLong("bl",AtStop,EntryPrice-PriceScale*손절,"",1,1); } if MarketPosition == -1 Then { ExitShort("sp",AtLimit,EntryPrice-PriceScale*익절,"",1,1); ExitShort("sl",AtStop,EntryPrice+PriceScale*손절,"",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); } } 즐거운 하루되세요 > 에리카 님이 쓴 글입니다. > 제목 : Re : Re : 문의 드립니다. > 늘 감사드립니다. 골드 문의 드린 것에 답변 주신 수식대로 오늘 저녁에 진행을 해봤습니다. 그런데 거래에 어떤 문제가 있어 보입니다. 익절 청산이나 손절 청산이 제대로 되지 않고 거래가 종료되었습니다. 3회 있었는데 똑같은 현상입니다. 거래내역과 차트 사진 올려 드리니 무엇이 문제인지 체크 부탁드립니다. 거듭 감사드립니다. > 예스스탁 님이 쓴 글입니다. > 제목 : Re : 문의 드립니다. > 안녕하세요 예스스탁입니다. 골드 input : StartTime(210000),EndTime(221000); input : Length(20), D1(2); input : 익절(20),손절(15),익절연속횟수(3),손절연속횟수(3); 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("bp",1) or IsExitName("sp.",1) or IsExitName("sp1",1) Then profit = profit+1; Else profit = 0; if IsExitName("bl.",1) or IsExitName("bl",1) or IsExitName("sl.",1) or IsExitName("sl1",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,EntryPrice+PriceScale*익절,"",1,1); ExitLong("bl.",AtStop,EntryPrice-PriceScale*손절,"",1,1); } If CrossDown(L,Var2) and C < O and profit < 익절연속횟수 and loss < 손절연속횟수 then { Sell("s",OnClose,DEF,1); ExitShort("sp.",AtLimit,EntryPrice-PriceScale*익절,"",1,1); ExitShort("sl.",AtStop,EntryPrice+PriceScale*손절,"",1,1); } } if MarketPosition == 1 Then { ExitLong("bp",AtLimit,EntryPrice+PriceScale*익절,"",1,1); ExitLong("bl",AtStop,EntryPrice-PriceScale*손절,"",1,1); } if MarketPosition == -1 Then { ExitShort("sp",AtLimit,EntryPrice-PriceScale*익절,"",1,1); ExitShort("sl",AtStop,EntryPrice+PriceScale*손절,"",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); } } 즐거운 하루되세요 > 에리카 님이 쓴 글입니다. > 제목 : 문의 드립니다. > 1. 항셍(오전 10시 18분 ~ 오전 11시 40분), 나스닥(22시 30분 ~ 01시 10분) 골드(21시 ~22시 10분) 거래시간 지정 2. 매도신호가 나오는 캔들의 종가에 매도. 음봉일 때만 매도(양봉일 때는 안함) 3. 매수신호가 나오는 캔들의 종가에 매수. 양봉일 때만 매수(음봉일 때는 안함) 4. 매수와 매도, 모두1계약을 진입합니다. 항셍 10시 18분 ~ 10시 30분까지는 익절 30틱, 손절 30틱 / 10시 30분 ~ 11시 40분까지는 익절 50틱, 손절 30틱. 나스닥은 오후 22시 30분 ~ 01시 10분까지 익절 50틱, 손절 30틱 골드는 오후 21시 ~ 22시 10분까지 익절 20틱, 손절 15틱 5. 거래시간 종료시에 포지션이 있을 경우 수식에 따라 익절 또는 손절 종료함. 6. 익절 3회 연속, 또는 손절 3회 연속이면 당일 거래 종료. 아래에 수식은 일전에 문의한 것에 대해 답을 해주신 것입니다. 위 내용에 대한 수식으로의 변경을 할 경우, 추가나 수정해야 할 부분이 헷갈려서요. 답변 부탁드립니다. 늘 친절히 답변해주심에 감사드립니다. input : StartTime(101500),EndTime(120000); input : Length(20), D1(2); 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; var1 = BollBandUp(Length,D1); var2 = BollBandDown(Length,D1); if Tcond == true Then { If CrossUP(H,var1) and c > o then Buy("b",OnClose,DEF,2); If CrossDown(L,Var2) and C < O then Sell("s",OnClose,DEF,2); } if MarketPosition == 1 Then { ExitLong("Bp1",AtLimit,EntryPrice+PriceScale*50,"",1,1); ExitLong("Bp2",AtLimit,EntryPrice+PriceScale*100,"",1,1); ExitLong("Bl",AtStop,EntryPrice-PriceScale*3,"",1,1); if CurrentContracts < MaxContracts and Highest(H,BarsSinceEntry) > EntryPrice+PriceScale*50 Then ExitLong("btr",AtStop,EntryPrice+PriceScale*10); } if MarketPosition == -1 Then { ExitShort("sp1",AtLimit,EntryPrice-PriceScale*50,"",1,1); ExitShort("sp2",AtLimit,EntryPrice-PriceScale*100,"",1,1); ExitShort("sl",AtStop,EntryPrice+PriceScale*3,"",1,1); if CurrentContracts < MaxContracts and lowest(L,BarsSinceEntry) < EntryPrice-PriceScale*50 Then ExitShort("str",AtStop,EntryPrice+PriceScale*10); } 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); } } 2 24시는 0시 입니다. input : StartTime(223000),EndTime(0); input : Length(20), D1(2); 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; var1 = BollBandUp(Length,D1); var2 = BollBandDown(Length,D1); if Tcond == true Then { If CrossUP(H,var1) and c > o then Buy("b",OnClose,DEF,2); If CrossDown(L,Var2) and C < O then Sell("s",OnClose,DEF,2); } if MarketPosition == 1 Then { ExitLong("Bp1",AtLimit,EntryPrice+PriceScale*50,"",1,1); ExitLong("Bp2",AtLimit,EntryPrice+PriceScale*100,"",1,1); ExitLong("Bl",AtStop,EntryPrice-PriceScale*3,"",1,1); if CurrentContracts < MaxContracts and Highest(H,BarsSinceEntry) > EntryPrice+PriceScale*50 Then ExitLong("btr",AtStop,EntryPrice+PriceScale*10); } if MarketPosition == -1 Then { ExitShort("sp1",AtLimit,EntryPrice-PriceScale*50,"",1,1); ExitShort("sp2",AtLimit,EntryPrice-PriceScale*100,"",1,1); ExitShort("sl",AtStop,EntryPrice+PriceScale*3,"",1,1); if CurrentContracts < MaxContracts and lowest(L,BarsSinceEntry) < EntryPrice-PriceScale*50 Then ExitShort("str",AtStop,EntryPrice+PriceScale*10); } 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); } }