커뮤니티

문의바랍니다

프로필 이미지
머니사이언스
2013-11-23 12:00:57
271
글번호 69775
답변완료
작동이 안되네요..작동이 되게끔 수정바랍니다.. Input: ProfitPt(5), TrailBar(30), entryCount(1), P1(40), P2(160), P3(110); Vars: Pivot(0), Support1(0), Support2(0), Support3(0), Resistance1(0), Resistance2(0), Resistance3(0), BearMarket(false) , BullMarket(false); // Calculation of Pivot, support and resistance points Pivot = ( dayLow(1) + dayHIgh(1) + dayClose(1) ) / 3; Resistance1 = ( Pivot * 2 ) - dayLow(1); Resistance2 = Pivot + (dayhigh(1)-dayLow(1)); Resistance3 = Resistance1 + (dayhigh(1)-dayLow(1)); Support1 = ( Pivot * 2 ) - dayHIgh(1); Support2 = Pivot - (dayhigh(1)-dayLow(1)); Support3 = Support1 - (dayhigh(1)-dayLow(1)); // Determination of market character BullMarket = ma( Close , P1 ) > ma( Close , P2 ) AND ma( Close , P2 ) > ma( Close , P3 ); BearMarket = ma( Close , P1 ) < ma( Close , P2 ) AND ma( Close , P2 ) < ma( Close , P3 ); // Placement of long orders if EntriesToday(date) < entryCount then begin If BullMarket then Begin Buy ("Bull R2", atstop,Resistance2 ) ; Buy ("Bull R3", atstop, Resistance3) ; end; // Placement of short orders If bearmarket then begin Sell ("Bear S2", atstop, Support2) ; Sell ("Bear S3", atstop, Support3) ; end; end; // Exit at first Profitable Open If MarketPosition == 1 and NextBarOpen > EntryPrice + ProfitPt then ExitLong ("Long Profit", AtMarket); If MarketPosition == -1 and NextBarOpen < EntryPrice - ProfitPt then ExitShort ("Short Profit", AtMarket) ; // Exit with trailing stops ExitLong("EL", atstop,Lowest( Low , TrailBar )) ; ExitShort("ES", atstop, Highest( High , TrailBar )) ; SetStopEndofday(150000); 아래 사용자함수 작성되어 있어야 전략 적용됩니다. [사용자함수 : entriestoday] Input : nDate(Numeric); Var : Count(0); Count = 0 ; For Value1 = 0 To 10 { If EntryDate(Value1) == nDate Then Count = Count + 1; } EntriesToday = Count;
시스템
답변 1
프로필 이미지

예스스탁 예스스탁 답변

2013-11-26 14:04:12

안녕하세요 예스스탁입니다. 해당식 정상적으로 신호가 발생하는 식입니다. 첨부한 그림은 5분봉 차트에 5000개를 열고 적용한 리포트입니다. 즐거운 하루되세요 > 머니사이언스 님이 쓴 글입니다. > 제목 : 문의바랍니다 > 작동이 안되네요..작동이 되게끔 수정바랍니다.. Input: ProfitPt(5), TrailBar(30), entryCount(1), P1(40), P2(160), P3(110); Vars: Pivot(0), Support1(0), Support2(0), Support3(0), Resistance1(0), Resistance2(0), Resistance3(0), BearMarket(false) , BullMarket(false); // Calculation of Pivot, support and resistance points Pivot = ( dayLow(1) + dayHIgh(1) + dayClose(1) ) / 3; Resistance1 = ( Pivot * 2 ) - dayLow(1); Resistance2 = Pivot + (dayhigh(1)-dayLow(1)); Resistance3 = Resistance1 + (dayhigh(1)-dayLow(1)); Support1 = ( Pivot * 2 ) - dayHIgh(1); Support2 = Pivot - (dayhigh(1)-dayLow(1)); Support3 = Support1 - (dayhigh(1)-dayLow(1)); // Determination of market character BullMarket = ma( Close , P1 ) > ma( Close , P2 ) AND ma( Close , P2 ) > ma( Close , P3 ); BearMarket = ma( Close , P1 ) < ma( Close , P2 ) AND ma( Close , P2 ) < ma( Close , P3 ); // Placement of long orders if EntriesToday(date) < entryCount then begin If BullMarket then Begin Buy ("Bull R2", atstop,Resistance2 ) ; Buy ("Bull R3", atstop, Resistance3) ; end; // Placement of short orders If bearmarket then begin Sell ("Bear S2", atstop, Support2) ; Sell ("Bear S3", atstop, Support3) ; end; end; // Exit at first Profitable Open If MarketPosition == 1 and NextBarOpen > EntryPrice + ProfitPt then ExitLong ("Long Profit", AtMarket); If MarketPosition == -1 and NextBarOpen < EntryPrice - ProfitPt then ExitShort ("Short Profit", AtMarket) ; // Exit with trailing stops ExitLong("EL", atstop,Lowest( Low , TrailBar )) ; ExitShort("ES", atstop, Highest( High , TrailBar )) ; SetStopEndofday(150000); 아래 사용자함수 작성되어 있어야 전략 적용됩니다. [사용자함수 : entriestoday] Input : nDate(Numeric); Var : Count(0); Count = 0 ; For Value1 = 0 To 10 { If EntryDate(Value1) == nDate Then Count = Count + 1; } EntriesToday = Count;