커뮤니티

수식확인 부탁드립니다.

프로필 이미지
라떼처럼
2017-08-26 10:50:32
156
글번호 112235
답변완료
수식 부탁드립니다. 감사합니다.~^^ 매수진입 Data2: MACDO2 > 0 이고,MACDO2가 전봉대비 큼. Data1: Crossup(mav2,mav3) 진입 수는 매도진입 조건 전까지 진입회수(1) 만큼 만 허용 (진입회수(2):1계약 매수진입&청산 후 매수진입 조건이면 2번째 1계약 진입함) 매도 진입 Data2: MACDO2 < 0 이고,MACDO2가 전봉대비 작음. Data1: Crossdown(mav2,mav3) 진입수는 상동 input : short(12),long(26),sig(9),P1(3),P2(30),P3(120); input : 시작시간(215000), 종료시간(030000); input : 진입회수(1); var : mav1(0,data1),mav2(0,data1),mav3(0,data1); var : Tcond(False); MACDO2 = data2(MACD_OSC(short,long,sig)); mav1 = data1(ma(c,P1)); mav2 = data1(ma(c,P2)); mav3 = data1(ma(c,P3)); if stime == 시작시간 or (stime >시작시간 and stime[1] < 시작시간) Then{ Tcond = true; } if stime == 종료시간 or (stime > 종료시간 and stime[1] < 종료시간) Then{ Tcond = false; } //진입조건 //진입 if Tcond == true Then{ if Bcount < 진입회수 Then buy("Buy"); if Scount < 진입회수 Then sell("Sell"); } //청산1 if MarketPosition == 1 Then{ if highest(H,BarsSinceEntry) >= EntryPrice+PriceScale*30 Then ExitLong("B익절1",AtStop,highest(H,BarsSinceEntry)-PriceScale*10); ExitLong("B손절2",AtStop,EntryPrice-PriceScale*30); } if MarketPosition == -1 Then{ if Lowest(L,BarsSinceEntry) <= EntryPrice-PriceScale*30 Then ExitShort("S익절1",AtStop,Lowest(L,BarsSinceEntry)+PriceScale*10); ExitShort("S손절2",AtStop,EntryPrice+PriceScale*30); } if 종료시간 <= sTime and sTime < 시작시간 then { if MarketPosition == 1 then{ ExitLong("B장종료"); } if MarketPosition == -1 then{ ExitShort("S장종료"); } }
시스템
답변 1
프로필 이미지

예스스탁 예스스탁 답변

2017-08-28 10:04:17

안녕하세요 예스스탁입니다. input : short(12),long(26),sig(9),P1(3),P2(30),P3(120); input : 시작시간(215000), 종료시간(030000); input : 진입회수(1); var : mav1(0,data1),mav2(0,data1),mav3(0,data1); var : Tcond(False,data1),Bcount(0,data1),Scount(0,data1); var : MACDO2(0,data2); MACDO2 = data2(MACD_OSC(short,long,sig)); mav1 = data1(ma(c,P1)); mav2 = data1(ma(c,P2)); mav3 = data1(ma(c,P3)); if stime == 시작시간 or (stime >시작시간 and stime[1] < 시작시간) Then{ Tcond = true; Bcount = 0; Scount = 0; } if stime == 종료시간 or (stime > 종료시간 and stime[1] < 종료시간) Then{ Tcond = false; } if MarketPosition != MarketPosition[1] and MarketPosition == 1 Then Bcount = Bcount+1; if MarketPosition != MarketPosition[1] and MarketPosition == -1 Then Scount = Scount+1; //진입조건 //진입 if Tcond == true Then{ if Bcount < 진입회수 and MACDO2 > 0 and MACDO2 > MACDO2[1] and crossup(mav2,mav3) Then buy("Buy"); if Scount < 진입회수 and MACDO2 < 0 and MACDO2 < MACDO2[1] and CrossDown(mav2,mav3) Then sell("Sell"); } //청산1 if MarketPosition == 1 Then{ if highest(H,BarsSinceEntry) >= EntryPrice+PriceScale*30 Then ExitLong("B익절1",AtStop,highest(H,BarsSinceEntry)-PriceScale*10); ExitLong("B손절2",AtStop,EntryPrice-PriceScale*30); } if MarketPosition == -1 Then{ if Lowest(L,BarsSinceEntry) <= EntryPrice-PriceScale*30 Then ExitShort("S익절1",AtStop,Lowest(L,BarsSinceEntry)+PriceScale*10); ExitShort("S손절2",AtStop,EntryPrice+PriceScale*30); } if 종료시간 <= sTime and sTime < 시작시간 then { if MarketPosition == 1 then{ ExitLong("B장종료"); } if MarketPosition == -1 then{ ExitShort("S장종료"); } } 즐거운 하루되세요 > 라떼처럼 님이 쓴 글입니다. > 제목 : 수식확인 부탁드립니다. > 수식 부탁드립니다. 감사합니다.~^^ 매수진입 Data2: MACDO2 > 0 이고,MACDO2가 전봉대비 큼. Data1: Crossup(mav2,mav3) 진입 수는 매도진입 조건 전까지 진입회수(1) 만큼 만 허용 (진입회수(2):1계약 매수진입&청산 후 매수진입 조건이면 2번째 1계약 진입함) 매도 진입 Data2: MACDO2 < 0 이고,MACDO2가 전봉대비 작음. Data1: Crossdown(mav2,mav3) 진입수는 상동 input : short(12),long(26),sig(9),P1(3),P2(30),P3(120); input : 시작시간(215000), 종료시간(030000); input : 진입회수(1); var : mav1(0,data1),mav2(0,data1),mav3(0,data1); var : Tcond(False); MACDO2 = data2(MACD_OSC(short,long,sig)); mav1 = data1(ma(c,P1)); mav2 = data1(ma(c,P2)); mav3 = data1(ma(c,P3)); if stime == 시작시간 or (stime >시작시간 and stime[1] < 시작시간) Then{ Tcond = true; } if stime == 종료시간 or (stime > 종료시간 and stime[1] < 종료시간) Then{ Tcond = false; } //진입조건 //진입 if Tcond == true Then{ if Bcount < 진입회수 Then buy("Buy"); if Scount < 진입회수 Then sell("Sell"); } //청산1 if MarketPosition == 1 Then{ if highest(H,BarsSinceEntry) >= EntryPrice+PriceScale*30 Then ExitLong("B익절1",AtStop,highest(H,BarsSinceEntry)-PriceScale*10); ExitLong("B손절2",AtStop,EntryPrice-PriceScale*30); } if MarketPosition == -1 Then{ if Lowest(L,BarsSinceEntry) <= EntryPrice-PriceScale*30 Then ExitShort("S익절1",AtStop,Lowest(L,BarsSinceEntry)+PriceScale*10); ExitShort("S손절2",AtStop,EntryPrice+PriceScale*30); } if 종료시간 <= sTime and sTime < 시작시간 then { if MarketPosition == 1 then{ ExitLong("B장종료"); } if MarketPosition == -1 then{ ExitShort("S장종료"); } }