커뮤니티

수식부탁드립니다---------------

프로필 이미지
leekss1
2011-09-26 15:04:26
485
글번호 43026
답변완료
var: 테마기간(0),채널기간(10),수평(10),이익(7),손절(10),전봉차(1),진입가(1),Per1(0.01),X1(15); VAR : TCHAN(0), BCHAN(0), aa(0), bb(0), highV(0), LowV(0); TCHAN = HIGHEST(HIGH, 채널기간)[1]; BCHAN = LOWEST(LOW, 채널기간)[1]; var77 = (3 * Ema(c,테마기간)) - (3 * Ema(Ema(c,테마기간),테마기간)) + (Ema(Ema(Ema(c,테마기간),테마기간),테마기간)); Condition1 = highest(h,x1) >= lowest(L,x1)*(1+(Per1/100)); if stime >= 090100 then { #매수 if DayIndex>=7 && MarketPosition == 0 and stime < 150000 and Condition1 then { if var77 >= var77[1]+전봉차 and CountIF(Tchan==Tchan[1],수평) == 수평 Then aa = TCHAN + PriceScale*진입가; buy("매수",atstop, aa); } highV = highest(H,BarsSinceEntry); if MarketPosition == 1 Then { ExitLong("수익", atlimit, entryPrice+PriceScale*이익); exitlong("bxxxxx",atstop,entryPrice-PriceScale*손절); } if MarketPosition == 1 or var77 < var77[1] Then aa = 999999; #매도 if DayIndex>=7 && MarketPosition == 0 and stime < 150000 and Condition1 then { if var77 <= var77[1]-전봉차 and CountIF(Bchan==Bchan[1],수평) == 수평 Then bb = BCHAN - PriceScale*진입가; sell("매도",atstop, bb); } LowV = Lowest(L,BarsSinceEntry); if MarketPosition == -1 Then { ExitShort("도익", atlimit, entryPrice-PriceScale*이익); exitshort("sxxxxx",atstop,entryPrice+PriceScale*손절); } if MarketPosition == -1 or var77 > var77[1] Then bb = 0.000001; } //시간청산-------------------- var11 = int(date/100)-int(date/10000)*100; //월 var22 = date - int(date/100)*100; //일 var33 = DayOfWeek(date); //요일 if var11%3 == 0 and var22 >= 8 and var22 <= 14 and var33 == 4 then { SetStopEndofday(144800); //만 } else { SetStopEndofday(150100); //평 } 위에다 하루이익이 아침시가의1.2%면 청산 하루손실이 아침시가의0.5%면 청산해주세요 또 스토케스틱 80 이상에서 매수금지 20 이하에서 매도금지 해주세요
시스템
답변 1
프로필 이미지

예스스탁 예스스탁 답변

2011-09-26 18:29:16

안녕하세요 예스스탁입니다. var: 테마기간(0),채널기간(10),수평(10),이익(7),손절(10),전봉차(1),진입가(1),Per1(0.01),X1(15); VAR : TCHAN(0), BCHAN(0), aa(0), bb(0), highV(0), LowV(0),stok(0); var : PLR(0),XCommission(0),XSlippage(0),OpenPL(0),dayPL(0),count(0); #당일누적손익계산 시작 XCommission = ((C*ExitCommission)/100)*CurrentContracts; #%설정 XSlippage = (ExitSlippage)*CurrentContracts; #Pt설정 PLR = 0; count = 0; for var1 = 1 to 10{ if sdate == EntryDate(var1) Then{ count = count+1; PLR = PLR+PositionProfit(var1); } } if MarketPosition() == 0 Then{ OpenPL = 0; dayPL = PLR; } Else{ OpenPL = (PositionProfit-(XCommission+XSlippage)); dayPL = PLR+OpenPL; } TCHAN = HIGHEST(HIGH, 채널기간)[1]; BCHAN = LOWEST(LOW, 채널기간)[1]; var77 = (3 * Ema(c,테마기간)) - (3 * Ema(Ema(c,테마기간),테마기간)) + (Ema(Ema(Ema(c,테마기간),테마기간),테마기간)); Condition1 = highest(h,x1) >= lowest(L,x1)*(1+(Per1/100)); stok = StochasticsK(10,5); if stime >= 090100 then { #매수 if DayIndex>=7 && MarketPosition == 0 and stime < 150000 and Condition1 and stok < 80 and (daypl < dayopen*0.012 or daypl > -(dayopen*0.005)) then { if var77 >= var77[1]+전봉차 and CountIF(Tchan==Tchan[1],수평) == 수평 Then aa = TCHAN + PriceScale*진입가; buy("매수",atstop, aa); } highV = highest(H,BarsSinceEntry); if MarketPosition == 1 Then { ExitLong("수익", atlimit, entryPrice+PriceScale*이익); exitlong("bxxxxx",atstop,entryPrice-PriceScale*손절); } if MarketPosition == 1 or var77 < var77[1] Then aa = 999999; #매도 if DayIndex>=7 && MarketPosition == 0 and stime < 150000 and Condition1 and stok > 20 and (daypl < dayopen*0.012 or daypl > -(dayopen*0.005)) then { if var77 <= var77[1]-전봉차 and CountIF(Bchan==Bchan[1],수평) == 수평 Then bb = BCHAN - PriceScale*진입가; sell("매도",atstop, bb); } LowV = Lowest(L,BarsSinceEntry); if MarketPosition == -1 Then { ExitShort("도익", atlimit, entryPrice-PriceScale*이익); exitshort("sxxxxx",atstop,entryPrice+PriceScale*손절); } if MarketPosition == -1 or var77 > var77[1] Then bb = 0.000001; } //시간청산-------------------- var11 = int(date/100)-int(date/10000)*100; //월 var22 = date - int(date/100)*100; //일 var33 = DayOfWeek(date); //요일 if var11%3 == 0 and var22 >= 8 and var22 <= 14 and var33 == 4 then { SetStopEndofday(144800); //만 } else { SetStopEndofday(150100); //평 } if MarketPosition == 1 Then{ exitlong("bx1",AtStop,EntryPrice+(-(dayopen*0.005)-(PLR))); exitlong("bx2",AtStop,EntryPrice+((dayopen*0.012)-(PLR))); } if MarketPosition == -1 Then{ ExitShort("sx1",AtStop,EntryPrice+((dayopen*0.005)+(PLR))); ExitShort("sx2",AtStop,EntryPrice+(-(dayopen*0.012)+(PLR))); } 즐거운 하루되세요 > leekss1 님이 쓴 글입니다. > 제목 : 수식부탁드립니다--------------- > var: 테마기간(0),채널기간(10),수평(10),이익(7),손절(10),전봉차(1),진입가(1),Per1(0.01),X1(15); VAR : TCHAN(0), BCHAN(0), aa(0), bb(0), highV(0), LowV(0); TCHAN = HIGHEST(HIGH, 채널기간)[1]; BCHAN = LOWEST(LOW, 채널기간)[1]; var77 = (3 * Ema(c,테마기간)) - (3 * Ema(Ema(c,테마기간),테마기간)) + (Ema(Ema(Ema(c,테마기간),테마기간),테마기간)); Condition1 = highest(h,x1) >= lowest(L,x1)*(1+(Per1/100)); if stime >= 090100 then { #매수 if DayIndex>=7 && MarketPosition == 0 and stime < 150000 and Condition1 then { if var77 >= var77[1]+전봉차 and CountIF(Tchan==Tchan[1],수평) == 수평 Then aa = TCHAN + PriceScale*진입가; buy("매수",atstop, aa); } highV = highest(H,BarsSinceEntry); if MarketPosition == 1 Then { ExitLong("수익", atlimit, entryPrice+PriceScale*이익); exitlong("bxxxxx",atstop,entryPrice-PriceScale*손절); } if MarketPosition == 1 or var77 < var77[1] Then aa = 999999; #매도 if DayIndex>=7 && MarketPosition == 0 and stime < 150000 and Condition1 then { if var77 <= var77[1]-전봉차 and CountIF(Bchan==Bchan[1],수평) == 수평 Then bb = BCHAN - PriceScale*진입가; sell("매도",atstop, bb); } LowV = Lowest(L,BarsSinceEntry); if MarketPosition == -1 Then { ExitShort("도익", atlimit, entryPrice-PriceScale*이익); exitshort("sxxxxx",atstop,entryPrice+PriceScale*손절); } if MarketPosition == -1 or var77 > var77[1] Then bb = 0.000001; } //시간청산-------------------- var11 = int(date/100)-int(date/10000)*100; //월 var22 = date - int(date/100)*100; //일 var33 = DayOfWeek(date); //요일 if var11%3 == 0 and var22 >= 8 and var22 <= 14 and var33 == 4 then { SetStopEndofday(144800); //만 } else { SetStopEndofday(150100); //평 } 위에다 하루이익이 아침시가의1.2%면 청산 하루손실이 아침시가의0.5%면 청산해주세요 또 스토케스틱 80 이상에서 매수금지 20 이하에서 매도금지 해주세요