커뮤니티

57335건 수식오류

프로필 이미지
좌오비우오비
2018-04-04 14:53:38
125
글번호 117954
답변완료
선물차트 10틱봉과 1분봉에 모두 20으로 적용해보았는데 손절과 익절 모두 작동하지 않고 당일 청산을 위해 세팅한 03시15분에 당일청산(end of day)만 합니다. 1차 진입만 있는 경우면 설정창의 손절과 trailing stop을 이용하면 되지만 2차 진입까지 있는 경우라 수식을 요청드린 건입니다. 수식에 손절과 tr stop이 있으면 시스템설정창엔 관련 내용이 비활성화되는 것 아닌가요. 살펴주세요. *********************************** 안녕하세요 예스스탁입니다. 1 input : b1(11),b2(13),진입시간(090000); input : 손절1(20),TR1(20); input : 손절2(20),TR2(20); var : T1(0),entry(0),HH(0),EL(0); if Bdate != Bdate[1] Then T1 = TotalTrades; if MarketPosition == 0 Then entry = TotalTrades-T1; Else entry = (TotalTrades-T1)+1; if MarketPosition == 0 and entry == 0 and stime >= 진입시간 and C <= DayHigh-PriceScale*b1 and C[1] > DayHigh-PriceScale*b1 Then buy("b1"); if TotalTrades > TotalTrades[1] Then HH = H; if H > HH Then HH = H; if MarketPosition == 0 and entry == 1 and stime >= 진입시간 and C <= HH-PriceScale*b2 and C[1] > HH-PriceScale*b2 Then buy("b2"); if MarketPosition == 1 then { if IsExitName("b1") == true then { ExitLong("bl1",AtStop,EntryPrice-PriceScale*손절1); ExitLong("btr1",AtStop,highest(h,BarsSinceEntry)-PriceScale*TR1); } if IsExitName("b2") == true then { ExitLong("bl2",AtStop,EntryPrice-PriceScale*손절2); ExitLong("btr2",AtStop,highest(h,BarsSinceEntry)-PriceScale*TR2); } } 2 input : s1(20),s2(20),진입시간(090000); input : 손절1(20),TR1(20); input : 손절2(20),TR2(20); var : T1(0),entry(0),LL(0),EH(0); if Bdate != Bdate[1] Then T1 = TotalTrades; if MarketPosition == 0 Then entry = TotalTrades-T1; Else entry = (TotalTrades-T1)+1; if MarketPosition == 0 and entry == 0 and stime >= 진입시간 and C >= daylow+PriceScale*s1 and C[1] < daylow+PriceScale*s1 Then sell("s1"); if TotalTrades > TotalTrades[1] Then LL = L; if L < LL Then LL = L; if MarketPosition == 0 and entry == 1 and stime >= 진입시간 and C >= LL+PriceScale*s2 and C[1] < LL+PriceScale*s2 Then sell("s2"); if MarketPosition == -1 then { if IsExitName("s1") == true then { ExitShort("sl1",AtStop,EntryPrice+PriceScale*손절1); ExitShort("str1",AtStop,Lowest(l,BarsSinceEntry)+PriceScale*TR1); } if IsExitName("s2") == true then { ExitShort("sl2",AtStop,EntryPrice+PriceScale*손절2); ExitShort("str2",AtStop,Lowest(l,BarsSinceEntry)+PriceScale*TR2); } } 즐거운 하루되세요 > 좌오비우오비 님이 쓴 글입니다. > 제목 : 손절,trailing stop 적용 > 아래 수식은 1차 진입과 2차 진입이 가능한 수식이며 buy진입과 sell진입이 구별된 수식입니다. 각각 1차진입 손절,tr stop과 2차진입 손절,tr stop을 구별하는 수식을 원하며 input에 반영해주세요. 1.buy수식 - input: 1차진입 손절(20),tr stop(20) 2차진입 손절(20),tr stop(20) 2.sell수식 - input: 1차진입 손절(20),tr stop(20) 2차진입 손절(20),tr stop(20) ************************************************************* 1. buy수식 input : b1(11),b2(13),진입시간(090000); var : T1(0),entry(0),HH(0),EL(0); if Bdate != Bdate[1] Then T1 = TotalTrades; if MarketPosition == 0 Then entry = TotalTrades-T1; Else entry = (TotalTrades-T1)+1; if MarketPosition == 0 and entry == 0 and stime >= 진입시간 and C <= DayHigh-PriceScale*b1 and C[1] > DayHigh-PriceScale*b1 Then buy("b1"); if TotalTrades > TotalTrades[1] Then HH = H; if H > HH Then HH = H; if MarketPosition == 0 and entry == 1 and stime >= 진입시간 and C <= HH-PriceScale*b2 and C[1] > HH-PriceScale*b2 Then buy("b2"); 2. sell 수식 input : s1(20),s2(20),진입시간(090000); var : T1(0),entry(0),LL(0),EH(0); if Bdate != Bdate[1] Then T1 = TotalTrades; if MarketPosition == 0 Then entry = TotalTrades-T1; Else entry = (TotalTrades-T1)+1; if MarketPosition == 0 and entry == 0 and stime >= 진입시간 and C >= daylow+PriceScale*s1 and C[1] < daylow+PriceScale*s1 Then sell("s1"); if TotalTrades > TotalTrades[1] Then LL = L; if L < LL Then LL = L; if MarketPosition == 0 and entry == 1 and stime >= 진입시간 and C >= LL+PriceScale*s2 and C[1] < LL+PriceScale*s2 Then sell("s2");
시스템
답변 1
프로필 이미지

예스스탁 예스스탁 답변

2018-04-04 15:30:20

안녕하세요 예스스탁입니다. 식을 수정했습니다. 함수를 잘못지정했습니다. 수식에서 강제청산함수를 사용해야 설정창에 관련항목이 비활성화됩니다. 상황에 따른 구분이므로 강제청산함수가 아닌 알반 청산함수로 구현한 내용입니다. 1 input : b1(11),b2(13),진입시간(090000); input : 손절1(20),TR1(20); input : 손절2(20),TR2(20); var : T1(0),entry(0),HH(0),EL(0); if Bdate != Bdate[1] Then T1 = TotalTrades; if MarketPosition == 0 Then entry = TotalTrades-T1; Else entry = (TotalTrades-T1)+1; if MarketPosition == 0 and entry == 0 and stime >= 진입시간 and C <= DayHigh-PriceScale*b1 and C[1] > DayHigh-PriceScale*b1 Then buy("b1"); if TotalTrades > TotalTrades[1] Then HH = H; if H > HH Then HH = H; if MarketPosition == 0 and entry == 1 and stime >= 진입시간 and C <= HH-PriceScale*b2 and C[1] > HH-PriceScale*b2 Then buy("b2"); if MarketPosition == 1 then { if IsEntryName("b1") == true then { ExitLong("bl1",AtStop,EntryPrice-PriceScale*손절1); ExitLong("btr1",AtStop,highest(h,BarsSinceEntry)-PriceScale*TR1); } if IsEntryName("b2") == true then { ExitLong("bl2",AtStop,EntryPrice-PriceScale*손절2); ExitLong("btr2",AtStop,highest(h,BarsSinceEntry)-PriceScale*TR2); } } 2 input : s1(20),s2(20),진입시간(090000); input : 손절1(20),TR1(20); input : 손절2(20),TR2(20); var : T1(0),entry(0),LL(0),EH(0); if Bdate != Bdate[1] Then T1 = TotalTrades; if MarketPosition == 0 Then entry = TotalTrades-T1; Else entry = (TotalTrades-T1)+1; if MarketPosition == 0 and entry == 0 and stime >= 진입시간 and C >= daylow+PriceScale*s1 and C[1] < daylow+PriceScale*s1 Then sell("s1"); if TotalTrades > TotalTrades[1] Then LL = L; if L < LL Then LL = L; if MarketPosition == 0 and entry == 1 and stime >= 진입시간 and C >= LL+PriceScale*s2 and C[1] < LL+PriceScale*s2 Then sell("s2"); if MarketPosition == -1 then { if IsEntryName("s1") == true then { ExitShort("sl1",AtStop,EntryPrice+PriceScale*손절1); ExitShort("str1",AtStop,Lowest(l,BarsSinceEntry)+PriceScale*TR1); } if IsEntryName("s2") == true then { ExitShort("sl2",AtStop,EntryPrice+PriceScale*손절2); ExitShort("str2",AtStop,Lowest(l,BarsSinceEntry)+PriceScale*TR2); } } 즐거운 하루되세요 > 좌오비우오비 님이 쓴 글입니다. > 제목 : 57335건 수식오류 > 선물차트 10틱봉과 1분봉에 모두 20으로 적용해보았는데 손절과 익절 모두 작동하지 않고 당일 청산을 위해 세팅한 03시15분에 당일청산(end of day)만 합니다. 1차 진입만 있는 경우면 설정창의 손절과 trailing stop을 이용하면 되지만 2차 진입까지 있는 경우라 수식을 요청드린 건입니다. 수식에 손절과 tr stop이 있으면 시스템설정창엔 관련 내용이 비활성화되는 것 아닌가요. 살펴주세요. *********************************** 안녕하세요 예스스탁입니다. 1 input : b1(11),b2(13),진입시간(090000); input : 손절1(20),TR1(20); input : 손절2(20),TR2(20); var : T1(0),entry(0),HH(0),EL(0); if Bdate != Bdate[1] Then T1 = TotalTrades; if MarketPosition == 0 Then entry = TotalTrades-T1; Else entry = (TotalTrades-T1)+1; if MarketPosition == 0 and entry == 0 and stime >= 진입시간 and C <= DayHigh-PriceScale*b1 and C[1] > DayHigh-PriceScale*b1 Then buy("b1"); if TotalTrades > TotalTrades[1] Then HH = H; if H > HH Then HH = H; if MarketPosition == 0 and entry == 1 and stime >= 진입시간 and C <= HH-PriceScale*b2 and C[1] > HH-PriceScale*b2 Then buy("b2"); if MarketPosition == 1 then { if IsExitName("b1") == true then { ExitLong("bl1",AtStop,EntryPrice-PriceScale*손절1); ExitLong("btr1",AtStop,highest(h,BarsSinceEntry)-PriceScale*TR1); } if IsExitName("b2") == true then { ExitLong("bl2",AtStop,EntryPrice-PriceScale*손절2); ExitLong("btr2",AtStop,highest(h,BarsSinceEntry)-PriceScale*TR2); } } 2 input : s1(20),s2(20),진입시간(090000); input : 손절1(20),TR1(20); input : 손절2(20),TR2(20); var : T1(0),entry(0),LL(0),EH(0); if Bdate != Bdate[1] Then T1 = TotalTrades; if MarketPosition == 0 Then entry = TotalTrades-T1; Else entry = (TotalTrades-T1)+1; if MarketPosition == 0 and entry == 0 and stime >= 진입시간 and C >= daylow+PriceScale*s1 and C[1] < daylow+PriceScale*s1 Then sell("s1"); if TotalTrades > TotalTrades[1] Then LL = L; if L < LL Then LL = L; if MarketPosition == 0 and entry == 1 and stime >= 진입시간 and C >= LL+PriceScale*s2 and C[1] < LL+PriceScale*s2 Then sell("s2"); if MarketPosition == -1 then { if IsExitName("s1") == true then { ExitShort("sl1",AtStop,EntryPrice+PriceScale*손절1); ExitShort("str1",AtStop,Lowest(l,BarsSinceEntry)+PriceScale*TR1); } if IsExitName("s2") == true then { ExitShort("sl2",AtStop,EntryPrice+PriceScale*손절2); ExitShort("str2",AtStop,Lowest(l,BarsSinceEntry)+PriceScale*TR2); } } 즐거운 하루되세요 > 좌오비우오비 님이 쓴 글입니다. > 제목 : 손절,trailing stop 적용 > 아래 수식은 1차 진입과 2차 진입이 가능한 수식이며 buy진입과 sell진입이 구별된 수식입니다. 각각 1차진입 손절,tr stop과 2차진입 손절,tr stop을 구별하는 수식을 원하며 input에 반영해주세요. 1.buy수식 - input: 1차진입 손절(20),tr stop(20) 2차진입 손절(20),tr stop(20) 2.sell수식 - input: 1차진입 손절(20),tr stop(20) 2차진입 손절(20),tr stop(20) ************************************************************* 1. buy수식 input : b1(11),b2(13),진입시간(090000); var : T1(0),entry(0),HH(0),EL(0); if Bdate != Bdate[1] Then T1 = TotalTrades; if MarketPosition == 0 Then entry = TotalTrades-T1; Else entry = (TotalTrades-T1)+1; if MarketPosition == 0 and entry == 0 and stime >= 진입시간 and C <= DayHigh-PriceScale*b1 and C[1] > DayHigh-PriceScale*b1 Then buy("b1"); if TotalTrades > TotalTrades[1] Then HH = H; if H > HH Then HH = H; if MarketPosition == 0 and entry == 1 and stime >= 진입시간 and C <= HH-PriceScale*b2 and C[1] > HH-PriceScale*b2 Then buy("b2"); 2. sell 수식 input : s1(20),s2(20),진입시간(090000); var : T1(0),entry(0),LL(0),EH(0); if Bdate != Bdate[1] Then T1 = TotalTrades; if MarketPosition == 0 Then entry = TotalTrades-T1; Else entry = (TotalTrades-T1)+1; if MarketPosition == 0 and entry == 0 and stime >= 진입시간 and C >= daylow+PriceScale*s1 and C[1] < daylow+PriceScale*s1 Then sell("s1"); if TotalTrades > TotalTrades[1] Then LL = L; if L < LL Then LL = L; if MarketPosition == 0 and entry == 1 and stime >= 진입시간 and C >= LL+PriceScale*s2 and C[1] < LL+PriceScale*s2 Then sell("s2");