커뮤니티

함수수정요청(합성11-1호 변형)

프로필 이미지
통큰베팅
2015-10-10 06:03:20
121
글번호 91101
답변완료
안녕하세요? 매번 감사드립니다. 아래의 함수를 수정 요청드립니다. 각 번호로 4개의 함수입니다. 1. 아래의 시스템에서 매도청산이 손절일 때, 손절 이후의 5번째 봉의 종가가 손절값보다 낮으면 신규매도 매수청산이 손절일 때, 손절 이후 5번째 봉의 종가가 손절값보다 높으면 신규매수 2. 1번 요청식에서 청산이 손절뿐만이 아니라 익절도 포함입니다. 즉, 아래의 시스템에서 매도청산 이후 5번째 봉의 종가가 청산값보다 낮으면 신규매도 매수청산 이후 5번째 봉의 종가가 청산값보다 높으면 신규매수 3. 1번식에서 추가 신규진입 후 5번째 이후 봉 종가에 강제청산입니다. 4. 2번식에서 추가 신규진입 후 5번째 이후 봉 종가에 강제청산입니다. var : entry1(0); var : ho1(0),OL1(0),HL1(0); var : maho1(0),maOL1(0),maHL1(0); var : cnt1(0),sumho1(0),sumOL1(0),sumHL1(0); var : EntryCnt1(0); var : V1(0),V2(0),V3(0),V4(0),V5(0); var : V6(0),V7(0),V8(0),V9(0),V10(0); if bdate != bdate[1] Then entry1 = 0; if MarketPosition != 0 and MarketPosition != MarketPosition[1] Then entry1 = entry1+1; ho1 = Dayhigh-Dayopen; OL1 = DayOpen-DayLow; HL1 = DayHigh-DayLow; sumho1 = 0; sumOL1 = 0; sumHL1 = 0; for cnt1 = 1 to 10{ sumho1 = sumho1 + (dayhigh(cnt1)-dayopen(cnt1)); sumOL1 = sumOL1 + (DayOpen(cnt1)-DayLow(cnt1)); sumHL1 = sumHL1 + (DayHigh(cnt1)-DayLow(cnt1)); } maho1 = sumho1/10; maOL1 = sumOL1/10; maHL1 = sumHL1/10; V1 = V2 = V3 = V4 = V5 = V6 = V7 = V8 = V9 = V10 = if MarketPosition == 0 and entry1 == 0 Then{ if V7 > V8 Then sell("s1",AtStop,V7-0.02); if V7 < V8 Then sell("s2",Atlimit,V8-0.02); } if MarketPosition == -1 and IsEntryName("s1") == true Then{ ExitShort("sp1",atlimit,V9-0.03); ExitShort("sl1",AtStop,V6); } if MarketPosition == -1 and IsEntryName("s2") == true Then{ ExitShort("sp2",atlimit,V9-0.03); ExitShort("sl2",AtStop,V6); } var : TF(0); var : Xtime(0), Etime(false),cnt(0),mav1(0),mav2(0); var : HV(0),LV(0),HV1(0),LV1(0),HV2(0),LV2(0); Array : HH[50](0),LL[50](0),CC[50](0); mav1 = ma(c,5); mav2 = ma(C,20); TF = TimeToMinutes(stime)%30; if Bdate != Bdate[1] Then{ Etime = true; if stime >= 090000 Then Xtime = 050000; Else Xtime = 060000; } if Bdate != Bdate[1] or (TF < TF[1] and stime > stime[1]) or date != date[1] Then{ HH[0] = H; LL[0] = L; for cnt = 1 to 49{ HH[cnt] = HH[cnt-1][1]; LL[cnt] = LL[cnt-1][1]; CC[cnt] = CC[cnt-1][1]; } } if H > HH[0] Then HH[0] = H; if L < LL[0] Then LL[0] = L; CC[0] = C; if HH[25+2] > 0 Then{ HV = HH[0]; LV = LL[0]; HV1 = HH[1]; LV1 = LL[1]; HV2 = HH[2]; LV2 = LL[2]; for cnt = 0 to 25{ if HH[cnt] > HV Then HV = HH[cnt]; if LL[cnt] < LV Then LV = LL[cnt]; if HH[cnt+1] > HV Then HV = HH[cnt+1]; if LL[cnt+1] < LV Then LV = LL[cnt+1]; if HH[cnt+2] > HV Then HV = HH[cnt+2]; if LL[cnt+2] < LV Then LV = LL[cnt+2]; } var1 = (HV+LV)/2; var2 = (HV1+LV1)/2; var3 = (HV2+LV2)/2; if Etime == true then{ if MarketPosition == 0 and CC[0] > var1 and CC[1] < var2 and CC[2] < var3 and C >= daylow+0.5 Then buy("b",AtMarket); if MarketPosition == 1 and c <= highest(H,BarsSinceEntry)-0.5 and CrossDown(mav1,mav2) Then ExitLong("bx",AtMarket); } } if stime == Xtime or (stime > Xtime and stime[1] < Xtime) Then{ Etime = false; ExitLong(); }
시스템
답변 1
프로필 이미지

예스스탁 예스스탁 답변

2015-10-12 18:06:59

안녕하세요 예스스탁입니다. 올리신 식에 손절과 목표수익이 어떤 청산인지 모호합니다. 매도청산쪽에는 sp나 sl이 매도포지션에 대한 수익과 손절청산인것 같은데 매수쪽에는 해당 부분이 보이지 않습니다. 수익이나 손실일때로 작성해 드립니다 참고하셔서 수정보완해 사용하시기 바랍니다. 1. var : entry1(0); var : ho1(0),OL1(0),HL1(0); var : maho1(0),maOL1(0),maHL1(0); var : cnt1(0),sumho1(0),sumOL1(0),sumHL1(0); var : EntryCnt1(0); var : V1(0),V2(0),V3(0),V4(0),V5(0); var : V6(0),V7(0),V8(0),V9(0),V10(0); if bdate != bdate[1] Then entry1 = 0; if MarketPosition != 0 and MarketPosition != MarketPosition[1] Then entry1 = entry1+1; ho1 = Dayhigh-Dayopen; OL1 = DayOpen-DayLow; HL1 = DayHigh-DayLow; sumho1 = 0; sumOL1 = 0; sumHL1 = 0; for cnt1 = 1 to 10{ sumho1 = sumho1 + (dayhigh(cnt1)-dayopen(cnt1)); sumOL1 = sumOL1 + (DayOpen(cnt1)-DayLow(cnt1)); sumHL1 = sumHL1 + (DayHigh(cnt1)-DayLow(cnt1)); } maho1 = sumho1/10; maOL1 = sumOL1/10; maHL1 = sumHL1/10; V1 = V2 = V3 = V4 = V5 = V6 = V7 = V8 = V9 = V10 = if MarketPosition == 0 and entry1 == 0 Then{ if V7 > V8 Then sell("s1",AtStop,V7-0.02); if V7 < V8 Then sell("s2",Atlimit,V8-0.02); } if MarketPosition == -1 and IsEntryName("s1") == true Then{ ExitShort("sp1",atlimit,V9-0.03); ExitShort("sl1",AtStop,V6); } if MarketPosition == -1 and IsEntryName("s2") == true Then{ ExitShort("sp2",atlimit,V9-0.03); ExitShort("sl2",AtStop,V6); } var : TF(0); var : Xtime(0), Etime(false),cnt(0),mav1(0),mav2(0); var : HV(0),LV(0),HV1(0),LV1(0),HV2(0),LV2(0); Array : HH[50](0),LL[50](0),CC[50](0); mav1 = ma(c,5); mav2 = ma(C,20); TF = TimeToMinutes(stime)%30; if Bdate != Bdate[1] Then{ Etime = true; if stime >= 090000 Then Xtime = 050000; Else Xtime = 060000; } if Bdate != Bdate[1] or (TF < TF[1] and stime > stime[1]) or date != date[1] Then{ HH[0] = H; LL[0] = L; for cnt = 1 to 49{ HH[cnt] = HH[cnt-1][1]; LL[cnt] = LL[cnt-1][1]; CC[cnt] = CC[cnt-1][1]; } } if H > HH[0] Then HH[0] = H; if L < LL[0] Then LL[0] = L; CC[0] = C; if HH[25+2] > 0 Then{ HV = HH[0]; LV = LL[0]; HV1 = HH[1]; LV1 = LL[1]; HV2 = HH[2]; LV2 = LL[2]; for cnt = 0 to 25{ if HH[cnt] > HV Then HV = HH[cnt]; if LL[cnt] < LV Then LV = LL[cnt]; if HH[cnt+1] > HV Then HV = HH[cnt+1]; if LL[cnt+1] < LV Then LV = LL[cnt+1]; if HH[cnt+2] > HV Then HV = HH[cnt+2]; if LL[cnt+2] < LV Then LV = LL[cnt+2]; } var1 = (HV+LV)/2; var2 = (HV1+LV1)/2; var3 = (HV2+LV2)/2; if Etime == true then{ if MarketPosition == 0 and CC[0] > var1 and CC[1] < var2 and CC[2] < var3 and C >= daylow+0.5 Then buy("b",AtMarket); if MarketPosition == 1 and c <= highest(H,BarsSinceEntry)-0.5 and CrossDown(mav1,mav2) Then ExitLong("bx",AtMarket); } } if stime == Xtime or (stime > Xtime and stime[1] < Xtime) Then{ Etime = false; ExitLong(); } if Etime == true And entry1 >= 1 and MarketPosition == 0 and MarketPosition(1) == 1 and PositionProfit(1) < 0 and BarsSinceExit(1) == 5 and C > ExitDate(1) then buy("reBuy1"); if Etime == true And entry1 >= 1 and MarketPosition == 0 and MarketPosition(1) == -1 and PositionProfit(1) < 0 and BarsSinceExit(1) == 5 and C < ExitDate(1) then sell("reSell1"); 2. var : entry1(0); var : ho1(0),OL1(0),HL1(0); var : maho1(0),maOL1(0),maHL1(0); var : cnt1(0),sumho1(0),sumOL1(0),sumHL1(0); var : EntryCnt1(0); var : V1(0),V2(0),V3(0),V4(0),V5(0); var : V6(0),V7(0),V8(0),V9(0),V10(0); if bdate != bdate[1] Then entry1 = 0; if MarketPosition != 0 and MarketPosition != MarketPosition[1] Then entry1 = entry1+1; ho1 = Dayhigh-Dayopen; OL1 = DayOpen-DayLow; HL1 = DayHigh-DayLow; sumho1 = 0; sumOL1 = 0; sumHL1 = 0; for cnt1 = 1 to 10{ sumho1 = sumho1 + (dayhigh(cnt1)-dayopen(cnt1)); sumOL1 = sumOL1 + (DayOpen(cnt1)-DayLow(cnt1)); sumHL1 = sumHL1 + (DayHigh(cnt1)-DayLow(cnt1)); } maho1 = sumho1/10; maOL1 = sumOL1/10; maHL1 = sumHL1/10; V1 = V2 = V3 = V4 = V5 = V6 = V7 = V8 = V9 = V10 = if MarketPosition == 0 and entry1 == 0 Then{ if V7 > V8 Then sell("s1",AtStop,V7-0.02); if V7 < V8 Then sell("s2",Atlimit,V8-0.02); } if MarketPosition == -1 and IsEntryName("s1") == true Then{ ExitShort("sp1",atlimit,V9-0.03); ExitShort("sl1",AtStop,V6); } if MarketPosition == -1 and IsEntryName("s2") == true Then{ ExitShort("sp2",atlimit,V9-0.03); ExitShort("sl2",AtStop,V6); } var : TF(0); var : Xtime(0), Etime(false),cnt(0),mav1(0),mav2(0); var : HV(0),LV(0),HV1(0),LV1(0),HV2(0),LV2(0); Array : HH[50](0),LL[50](0),CC[50](0); mav1 = ma(c,5); mav2 = ma(C,20); TF = TimeToMinutes(stime)%30; if Bdate != Bdate[1] Then{ Etime = true; if stime >= 090000 Then Xtime = 050000; Else Xtime = 060000; } if Bdate != Bdate[1] or (TF < TF[1] and stime > stime[1]) or date != date[1] Then{ HH[0] = H; LL[0] = L; for cnt = 1 to 49{ HH[cnt] = HH[cnt-1][1]; LL[cnt] = LL[cnt-1][1]; CC[cnt] = CC[cnt-1][1]; } } if H > HH[0] Then HH[0] = H; if L < LL[0] Then LL[0] = L; CC[0] = C; if HH[25+2] > 0 Then{ HV = HH[0]; LV = LL[0]; HV1 = HH[1]; LV1 = LL[1]; HV2 = HH[2]; LV2 = LL[2]; for cnt = 0 to 25{ if HH[cnt] > HV Then HV = HH[cnt]; if LL[cnt] < LV Then LV = LL[cnt]; if HH[cnt+1] > HV Then HV = HH[cnt+1]; if LL[cnt+1] < LV Then LV = LL[cnt+1]; if HH[cnt+2] > HV Then HV = HH[cnt+2]; if LL[cnt+2] < LV Then LV = LL[cnt+2]; } var1 = (HV+LV)/2; var2 = (HV1+LV1)/2; var3 = (HV2+LV2)/2; if Etime == true then{ if MarketPosition == 0 and CC[0] > var1 and CC[1] < var2 and CC[2] < var3 and C >= daylow+0.5 Then buy("b",AtMarket); if MarketPosition == 1 and c <= highest(H,BarsSinceEntry)-0.5 and CrossDown(mav1,mav2) Then ExitLong("bx",AtMarket); } } if stime == Xtime or (stime > Xtime and stime[1] < Xtime) Then{ Etime = false; ExitLong(); } if Etime == true And entry1 >= 1 and MarketPosition == 0 and MarketPosition(1) == 1 and PositionProfit(1) < 0 and BarsSinceExit(1) == 5 and C > ExitDate(1) then buy("reBuy1"); if Etime == true And entry1 >= 1 and MarketPosition == 0 and MarketPosition(1) == 1 and PositionProfit(1) > 0 and BarsSinceExit(1) == 5 and C > ExitDate(1) then buy("reBuy2"); if Etime == true And entry1 >= 1 and MarketPosition == 0 and MarketPosition(1) == -1 and PositionProfit(1) < 0 and BarsSinceExit(1) == 5 and C < ExitDate(1) then sell("reSell1"); if Etime == true And entry1 >= 1 and MarketPosition == 0 and MarketPosition(1) == -1 and PositionProfit(1) > 0 and BarsSinceExit(1) == 5 and C > ExitDate(1) then sell("reSell2"); 3. var : entry1(0); var : ho1(0),OL1(0),HL1(0); var : maho1(0),maOL1(0),maHL1(0); var : cnt1(0),sumho1(0),sumOL1(0),sumHL1(0); var : EntryCnt1(0); var : V1(0),V2(0),V3(0),V4(0),V5(0); var : V6(0),V7(0),V8(0),V9(0),V10(0); if bdate != bdate[1] Then entry1 = 0; if MarketPosition != 0 and MarketPosition != MarketPosition[1] Then entry1 = entry1+1; ho1 = Dayhigh-Dayopen; OL1 = DayOpen-DayLow; HL1 = DayHigh-DayLow; sumho1 = 0; sumOL1 = 0; sumHL1 = 0; for cnt1 = 1 to 10{ sumho1 = sumho1 + (dayhigh(cnt1)-dayopen(cnt1)); sumOL1 = sumOL1 + (DayOpen(cnt1)-DayLow(cnt1)); sumHL1 = sumHL1 + (DayHigh(cnt1)-DayLow(cnt1)); } maho1 = sumho1/10; maOL1 = sumOL1/10; maHL1 = sumHL1/10; V1 = V2 = V3 = V4 = V5 = V6 = V7 = V8 = V9 = V10 = if MarketPosition == 0 and entry1 == 0 Then{ if V7 > V8 Then sell("s1",AtStop,V7-0.02); if V7 < V8 Then sell("s2",Atlimit,V8-0.02); } if MarketPosition == -1 and IsEntryName("s1") == true Then{ ExitShort("sp1",atlimit,V9-0.03); ExitShort("sl1",AtStop,V6); } if MarketPosition == -1 and IsEntryName("s2") == true Then{ ExitShort("sp2",atlimit,V9-0.03); ExitShort("sl2",AtStop,V6); } var : TF(0); var : Xtime(0), Etime(false),cnt(0),mav1(0),mav2(0); var : HV(0),LV(0),HV1(0),LV1(0),HV2(0),LV2(0); Array : HH[50](0),LL[50](0),CC[50](0); mav1 = ma(c,5); mav2 = ma(C,20); TF = TimeToMinutes(stime)%30; if Bdate != Bdate[1] Then{ Etime = true; if stime >= 090000 Then Xtime = 050000; Else Xtime = 060000; } if Bdate != Bdate[1] or (TF < TF[1] and stime > stime[1]) or date != date[1] Then{ HH[0] = H; LL[0] = L; for cnt = 1 to 49{ HH[cnt] = HH[cnt-1][1]; LL[cnt] = LL[cnt-1][1]; CC[cnt] = CC[cnt-1][1]; } } if H > HH[0] Then HH[0] = H; if L < LL[0] Then LL[0] = L; CC[0] = C; if HH[25+2] > 0 Then{ HV = HH[0]; LV = LL[0]; HV1 = HH[1]; LV1 = LL[1]; HV2 = HH[2]; LV2 = LL[2]; for cnt = 0 to 25{ if HH[cnt] > HV Then HV = HH[cnt]; if LL[cnt] < LV Then LV = LL[cnt]; if HH[cnt+1] > HV Then HV = HH[cnt+1]; if LL[cnt+1] < LV Then LV = LL[cnt+1]; if HH[cnt+2] > HV Then HV = HH[cnt+2]; if LL[cnt+2] < LV Then LV = LL[cnt+2]; } var1 = (HV+LV)/2; var2 = (HV1+LV1)/2; var3 = (HV2+LV2)/2; if Etime == true then{ if MarketPosition == 0 and CC[0] > var1 and CC[1] < var2 and CC[2] < var3 and C >= daylow+0.5 Then buy("b",AtMarket); if MarketPosition == 1 and c <= highest(H,BarsSinceEntry)-0.5 and CrossDown(mav1,mav2) Then ExitLong("bx",AtMarket); } } if stime == Xtime or (stime > Xtime and stime[1] < Xtime) Then{ Etime = false; ExitLong(); } if Etime == true And entry1 >= 1 and MarketPosition == 0 and MarketPosition(1) == 1 and PositionProfit(1) < 0 and BarsSinceExit(1) == 5 and C > ExitDate(1) then buy("reBuy1"); if MarketPosition == 1 and IsEntryName("reBuy1") == true and BarsSinceEntry == 5 Then exitlong(); if Etime == true And entry1 >= 1 and MarketPosition == 0 and MarketPosition(1) == -1 and PositionProfit(1) < 0 and BarsSinceExit(1) == 5 and C < ExitDate(1) then sell("reSell1"); if MarketPosition == -1 and IsEntryName("reSell1") == true and BarsSinceEntry == 5 Then ExitShort(); 4. var : entry1(0); var : ho1(0),OL1(0),HL1(0); var : maho1(0),maOL1(0),maHL1(0); var : cnt1(0),sumho1(0),sumOL1(0),sumHL1(0); var : EntryCnt1(0); var : V1(0),V2(0),V3(0),V4(0),V5(0); var : V6(0),V7(0),V8(0),V9(0),V10(0); if bdate != bdate[1] Then entry1 = 0; if MarketPosition != 0 and MarketPosition != MarketPosition[1] Then entry1 = entry1+1; ho1 = Dayhigh-Dayopen; OL1 = DayOpen-DayLow; HL1 = DayHigh-DayLow; sumho1 = 0; sumOL1 = 0; sumHL1 = 0; for cnt1 = 1 to 10{ sumho1 = sumho1 + (dayhigh(cnt1)-dayopen(cnt1)); sumOL1 = sumOL1 + (DayOpen(cnt1)-DayLow(cnt1)); sumHL1 = sumHL1 + (DayHigh(cnt1)-DayLow(cnt1)); } maho1 = sumho1/10; maOL1 = sumOL1/10; maHL1 = sumHL1/10; V1 = V2 = V3 = V4 = V5 = V6 = V7 = V8 = V9 = V10 = if MarketPosition == 0 and entry1 == 0 Then{ if V7 > V8 Then sell("s1",AtStop,V7-0.02); if V7 < V8 Then sell("s2",Atlimit,V8-0.02); } if MarketPosition == -1 and IsEntryName("s1") == true Then{ ExitShort("sp1",atlimit,V9-0.03); ExitShort("sl1",AtStop,V6); } if MarketPosition == -1 and IsEntryName("s2") == true Then{ ExitShort("sp2",atlimit,V9-0.03); ExitShort("sl2",AtStop,V6); } var : TF(0); var : Xtime(0), Etime(false),cnt(0),mav1(0),mav2(0); var : HV(0),LV(0),HV1(0),LV1(0),HV2(0),LV2(0); Array : HH[50](0),LL[50](0),CC[50](0); mav1 = ma(c,5); mav2 = ma(C,20); TF = TimeToMinutes(stime)%30; if Bdate != Bdate[1] Then{ Etime = true; if stime >= 090000 Then Xtime = 050000; Else Xtime = 060000; } if Bdate != Bdate[1] or (TF < TF[1] and stime > stime[1]) or date != date[1] Then{ HH[0] = H; LL[0] = L; for cnt = 1 to 49{ HH[cnt] = HH[cnt-1][1]; LL[cnt] = LL[cnt-1][1]; CC[cnt] = CC[cnt-1][1]; } } if H > HH[0] Then HH[0] = H; if L < LL[0] Then LL[0] = L; CC[0] = C; if HH[25+2] > 0 Then{ HV = HH[0]; LV = LL[0]; HV1 = HH[1]; LV1 = LL[1]; HV2 = HH[2]; LV2 = LL[2]; for cnt = 0 to 25{ if HH[cnt] > HV Then HV = HH[cnt]; if LL[cnt] < LV Then LV = LL[cnt]; if HH[cnt+1] > HV Then HV = HH[cnt+1]; if LL[cnt+1] < LV Then LV = LL[cnt+1]; if HH[cnt+2] > HV Then HV = HH[cnt+2]; if LL[cnt+2] < LV Then LV = LL[cnt+2]; } var1 = (HV+LV)/2; var2 = (HV1+LV1)/2; var3 = (HV2+LV2)/2; if Etime == true then{ if MarketPosition == 0 and CC[0] > var1 and CC[1] < var2 and CC[2] < var3 and C >= daylow+0.5 Then buy("b",AtMarket); if MarketPosition == 1 and c <= highest(H,BarsSinceEntry)-0.5 and CrossDown(mav1,mav2) Then ExitLong("bx",AtMarket); } } if stime == Xtime or (stime > Xtime and stime[1] < Xtime) Then{ Etime = false; ExitLong(); } if Etime == true And entry1 >= 1 and MarketPosition == 0 and MarketPosition(1) == 1 and PositionProfit(1) < 0 and BarsSinceExit(1) == 5 and C > ExitDate(1) then buy("reBuy1"); if Etime == true And entry1 >= 1 and MarketPosition == 0 and MarketPosition(1) == 1 and PositionProfit(1) > 0 and BarsSinceExit(1) == 5 and C > ExitDate(1) then buy("reBuy2"); if MarketPosition == 1 and (IsEntryName("reBuy1") == true or IsEntryName("reBuy2") == true) and BarsSinceEntry == 5 Then exitlong(); if Etime == true And entry1 >= 1 and MarketPosition == 0 and MarketPosition(1) == -1 and PositionProfit(1) < 0 and BarsSinceExit(1) == 5 and C < ExitDate(1) then sell("reSell1"); if Etime == true And entry1 >= 1 and MarketPosition == 0 and MarketPosition(1) == -1 and PositionProfit(1) > 0 and BarsSinceExit(1) == 5 and C > ExitDate(1) then sell("reSell2"); if MarketPosition == -1 and (IsEntryName("reSell1") == true or IsEntryName("reSell2") == true) and BarsSinceEntry == 5 Then ExitShort(); 즐거운 하루되세요 > 통큰베팅 님이 쓴 글입니다. > 제목 : 함수수정요청(합성11-1호 변형) > 안녕하세요? 매번 감사드립니다. 아래의 함수를 수정 요청드립니다. 각 번호로 4개의 함수입니다. 1. 아래의 시스템에서 매도청산이 손절일 때, 손절 이후의 5번째 봉의 종가가 손절값보다 낮으면 신규매도 매수청산이 손절일 때, 손절 이후 5번째 봉의 종가가 손절값보다 높으면 신규매수 2. 1번 요청식에서 청산이 손절뿐만이 아니라 익절도 포함입니다. 즉, 아래의 시스템에서 매도청산 이후 5번째 봉의 종가가 청산값보다 낮으면 신규매도 매수청산 이후 5번째 봉의 종가가 청산값보다 높으면 신규매수 3. 1번식에서 추가 신규진입 후 5번째 이후 봉 종가에 강제청산입니다. 4. 2번식에서 추가 신규진입 후 5번째 이후 봉 종가에 강제청산입니다. var : entry1(0); var : ho1(0),OL1(0),HL1(0); var : maho1(0),maOL1(0),maHL1(0); var : cnt1(0),sumho1(0),sumOL1(0),sumHL1(0); var : EntryCnt1(0); var : V1(0),V2(0),V3(0),V4(0),V5(0); var : V6(0),V7(0),V8(0),V9(0),V10(0); if bdate != bdate[1] Then entry1 = 0; if MarketPosition != 0 and MarketPosition != MarketPosition[1] Then entry1 = entry1+1; ho1 = Dayhigh-Dayopen; OL1 = DayOpen-DayLow; HL1 = DayHigh-DayLow; sumho1 = 0; sumOL1 = 0; sumHL1 = 0; for cnt1 = 1 to 10{ sumho1 = sumho1 + (dayhigh(cnt1)-dayopen(cnt1)); sumOL1 = sumOL1 + (DayOpen(cnt1)-DayLow(cnt1)); sumHL1 = sumHL1 + (DayHigh(cnt1)-DayLow(cnt1)); } maho1 = sumho1/10; maOL1 = sumOL1/10; maHL1 = sumHL1/10; V1 = V2 = V3 = V4 = V5 = V6 = V7 = V8 = V9 = V10 = if MarketPosition == 0 and entry1 == 0 Then{ if V7 > V8 Then sell("s1",AtStop,V7-0.02); if V7 < V8 Then sell("s2",Atlimit,V8-0.02); } if MarketPosition == -1 and IsEntryName("s1") == true Then{ ExitShort("sp1",atlimit,V9-0.03); ExitShort("sl1",AtStop,V6); } if MarketPosition == -1 and IsEntryName("s2") == true Then{ ExitShort("sp2",atlimit,V9-0.03); ExitShort("sl2",AtStop,V6); } var : TF(0); var : Xtime(0), Etime(false),cnt(0),mav1(0),mav2(0); var : HV(0),LV(0),HV1(0),LV1(0),HV2(0),LV2(0); Array : HH[50](0),LL[50](0),CC[50](0); mav1 = ma(c,5); mav2 = ma(C,20); TF = TimeToMinutes(stime)%30; if Bdate != Bdate[1] Then{ Etime = true; if stime >= 090000 Then Xtime = 050000; Else Xtime = 060000; } if Bdate != Bdate[1] or (TF < TF[1] and stime > stime[1]) or date != date[1] Then{ HH[0] = H; LL[0] = L; for cnt = 1 to 49{ HH[cnt] = HH[cnt-1][1]; LL[cnt] = LL[cnt-1][1]; CC[cnt] = CC[cnt-1][1]; } } if H > HH[0] Then HH[0] = H; if L < LL[0] Then LL[0] = L; CC[0] = C; if HH[25+2] > 0 Then{ HV = HH[0]; LV = LL[0]; HV1 = HH[1]; LV1 = LL[1]; HV2 = HH[2]; LV2 = LL[2]; for cnt = 0 to 25{ if HH[cnt] > HV Then HV = HH[cnt]; if LL[cnt] < LV Then LV = LL[cnt]; if HH[cnt+1] > HV Then HV = HH[cnt+1]; if LL[cnt+1] < LV Then LV = LL[cnt+1]; if HH[cnt+2] > HV Then HV = HH[cnt+2]; if LL[cnt+2] < LV Then LV = LL[cnt+2]; } var1 = (HV+LV)/2; var2 = (HV1+LV1)/2; var3 = (HV2+LV2)/2; if Etime == true then{ if MarketPosition == 0 and CC[0] > var1 and CC[1] < var2 and CC[2] < var3 and C >= daylow+0.5 Then buy("b",AtMarket); if MarketPosition == 1 and c <= highest(H,BarsSinceEntry)-0.5 and CrossDown(mav1,mav2) Then ExitLong("bx",AtMarket); } } if stime == Xtime or (stime > Xtime and stime[1] < Xtime) Then{ Etime = false; ExitLong(); }