커뮤니티

63163 재문의 드립니다

프로필 이미지
vlfaud3
2019-07-04 20:46:16
246
글번호 130064
답변완료
답변 감사 합니다.. 버전1에서 목표수익 0.2%와 도달목표수익 0.15%에 10%도 시뮬레이션 가능하게 변경 할수 있도록 수정 부탁 드립니다. 감사합니다 . input : starttime(90000),endtime(152000); input : x(20),maPeriod(5); var : Tcond(false),R(0),S(0),E(0); if (sdate != sdate[1] and stime >= starttime) or (sdate == sdate[1] and stime >= starttime and stime[1] < starttime) then { Tcond = true; } if (sdate != sdate[1] and stime >= endtime) or (sdate == sdate[1] and stime >= endtime and stime[1] < endtime) then { Tcond = false; if MarketPosition == 1 Then ExitLong("bx"); if MarketPosition == -1 Then ExitShort("sx"); } R = highest(H,X); S = lowest(L,X); E = ma(c,maPeriod); if crossUp(E,R[1]) Then buy("b"); if CrossDown(E,S[1]) Then sell("s"); if MarketPosition == 1 Then { ExitLong("bp1",atlimit,EntryPrice*1.002); if highest(H,BarsSinceEntry) >= EntryPrice*1.0015 Then ExitLong("btr",AtStop,highest(H,BarsSinceEntry)-(highest(H,BarsSinceEntry)-EntryPrice)*0.1); } if MarketPosition == -1 Then { ExitShort("sp1",atlimit,EntryPrice*0.998); if Lowest(L,BarsSinceEntry) <= EntryPrice*0.9985 Then ExitShort("str",AtStop,Lowest(L,BarsSinceEntry)-(EntryPrice-lowest(L,BarsSinceEntry))*0.1); }
시스템
답변 1
프로필 이미지

예스스탁 예스스탁 답변

2019-07-05 09:51:26

안녕하세요 예스스탁입니다. input : starttime(90000),endtime(152000); input : x(20),maPeriod(5); input : 목표수익율(0.2),도달목표수익(0.15),per(10); var : Tcond(false),R(0),S(0),E(0); if (sdate != sdate[1] and stime >= starttime) or (sdate == sdate[1] and stime >= starttime and stime[1] < starttime) then { Tcond = true; } if (sdate != sdate[1] and stime >= endtime) or (sdate == sdate[1] and stime >= endtime and stime[1] < endtime) then { Tcond = false; if MarketPosition == 1 Then ExitLong("bx"); if MarketPosition == -1 Then ExitShort("sx"); } R = highest(H,X); S = lowest(L,X); E = ma(c,maPeriod); if crossUp(E,R[1]) Then buy("b"); if CrossDown(E,S[1]) Then sell("s"); if MarketPosition == 1 Then { ExitLong("bp1",atlimit,EntryPrice*(1+목표수익율/100)); if highest(H,BarsSinceEntry) >= EntryPrice*(1+도달목표수익/100) Then ExitLong("btr",AtStop,highest(H,BarsSinceEntry)-(highest(H,BarsSinceEntry)-EntryPrice)*(per/100)); } if MarketPosition == -1 Then { ExitShort("sp1",atlimit,EntryPrice*(1-목표수익율/100)); if Lowest(L,BarsSinceEntry) <= EntryPrice*(1-도달목표수익/100) Then ExitShort("str",AtStop,Lowest(L,BarsSinceEntry)-(EntryPrice-lowest(L,BarsSinceEntry))*(per/100)); } 즐거운 하루되세요 > vlfaud3 님이 쓴 글입니다. > 제목 : 63163 재문의 드립니다 > 답변 감사 합니다.. 버전1에서 목표수익 0.2%와 도달목표수익 0.15%에 10%도 시뮬레이션 가능하게 변경 할수 있도록 수정 부탁 드립니다. 감사합니다 . input : starttime(90000),endtime(152000); input : x(20),maPeriod(5); var : Tcond(false),R(0),S(0),E(0); if (sdate != sdate[1] and stime >= starttime) or (sdate == sdate[1] and stime >= starttime and stime[1] < starttime) then { Tcond = true; } if (sdate != sdate[1] and stime >= endtime) or (sdate == sdate[1] and stime >= endtime and stime[1] < endtime) then { Tcond = false; if MarketPosition == 1 Then ExitLong("bx"); if MarketPosition == -1 Then ExitShort("sx"); } R = highest(H,X); S = lowest(L,X); E = ma(c,maPeriod); if crossUp(E,R[1]) Then buy("b"); if CrossDown(E,S[1]) Then sell("s"); if MarketPosition == 1 Then { ExitLong("bp1",atlimit,EntryPrice*1.002); if highest(H,BarsSinceEntry) >= EntryPrice*1.0015 Then ExitLong("btr",AtStop,highest(H,BarsSinceEntry)-(highest(H,BarsSinceEntry)-EntryPrice)*0.1); } if MarketPosition == -1 Then { ExitShort("sp1",atlimit,EntryPrice*0.998); if Lowest(L,BarsSinceEntry) <= EntryPrice*0.9985 Then ExitShort("str",AtStop,Lowest(L,BarsSinceEntry)-(EntryPrice-lowest(L,BarsSinceEntry))*0.1); }