커뮤니티

수식 좀 부탁드립니다

프로필 이미지
아카디아
2014-06-18 18:43:46
166
글번호 75936
답변완료
Input : shortPeriod(5), longPeriod(20); value1 = ma(C, shortPeriod); value2 = ma(C, longPeriod); # 매수/매도청산  If CrossUP(value1, value2) Then          {                 Buy();         } # 매도/매수청산 If CrossDown(value1, value2) Then          {             Sell();     } ........................................................................................................ 문의 ) 이상은 예스 글로벌에서 제공하는 골든데스 기본 시스템입니다. 알고자 하는 것은 1) 미청산 수익 또는 손실이 5포인트에 다다르면 무조건 청산하고 2) 청산후 5분 전에는 재진입 금지되고 3) 하루 수익 손실이 20포인트에 다다르면 거래 중지 정말 고맙습니다....
시스템
답변 1
프로필 이미지

예스스탁 예스스탁 답변

2014-06-18 19:07:50

Input : shortPeriod(5), longPeriod(20); var : NP(0),preNP(0),dayPL(0); NP = NetProfit; if date != date[1] Then preNP = NP[1]; dayPL = NP-PreNP; value1 = ma(C, shortPeriod); value2 = ma(C, longPeriod); Condition1 = ExitDate(1) == sdate and (IsExitName("StopLoss",1) or IsExitName("StopProfittarget",1)); if dayPL < 20 and DayPL > -20 Then{ If CrossUP(value1, value2) Then { if MarketPosition == -1 or (MarketPosition == 0 and Condition1 == false) Or (MarketPosition == 0 and Condition1 == true and TimeToMinutes(stime) >= TimeToMinutes(ExitTime(1))+5) Then Buy(); } If CrossDown(value1, value2) Then { if MarketPosition == -1 or (MarketPosition == 0 and Condition1 == false) Or (MarketPosition == 0 and Condition1 == true and TimeToMinutes(stime) >= TimeToMinutes(ExitTime(1))+5) Then Sell(); } } SetStopLoss(5,PointStop); SetStopProfittarget(5,PointStop); > 아카디아 님이 쓴 글입니다. > 제목 : 수식 좀 부탁드립니다 > Input : shortPeriod(5), longPeriod(20); value1 = ma(C, shortPeriod); value2 = ma(C, longPeriod); # 매수/매도청산&nbsp; If CrossUP(value1, value2) Then&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;{ &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Buy(); &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;} # 매도/매수청산 If CrossDown(value1, value2) Then&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;{ &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Sell(); &nbsp;&nbsp;&nbsp;&nbsp;} ........................................................................................................ 문의 ) 이상은 예스 글로벌에서 제공하는 골든데스 기본 시스템입니다. 알고자 하는 것은 1) 미청산 수익 또는 손실이 5포인트에 다다르면 무조건 청산하고 2) 청산후 5분 전에는 재진입 금지되고 3) 하루 수익 손실이 20포인트에 다다르면 거래 중지 정말 고맙습니다....