커뮤니티

추가부탁드립니다.

프로필 이미지
팽구
2015-05-22 09:47:05
120
글번호 86332
답변완료
아래의 수식에서 직전거래가 손실이 나면, 손실기간(봉의갯수) 만큼 쉬었다가(진입금지) 다시 가동하게 만들어주세요.. 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
프로필 이미지

예스스탁 예스스탁 답변

2015-05-22 11:24:20

안녕하세요 예스스탁입니다. Input : shortPeriod(5), longPeriod(20); value1 = ma(C, shortPeriod); value2 = ma(C, longPeriod); # 매수/매도청산 If CrossUP(value1, value2) Then { if MarketPosition == 0 and PositionProfit(1) >= 0 Then Buy(); if MarketPosition == -1 and C > EntryPrice Then ExitShort(); if MarketPosition == -1 and C <= EntryPrice Then buy(); if MarketPosition == 0 and PositionProfit(1) < 0 And BarsSinceExit(1) >= abs(BarsSinceEntry(1)-BarsSinceExit(1)) Then buy(); } # 매도/매수청산 If CrossDown(value1, value2) Then { if MarketPosition == 0 and PositionProfit(1) >= 0 Then sell(); if MarketPosition == 1 and C < EntryPrice Then ExitLong(); if MarketPosition == 1 and C >= EntryPrice Then Sell(); if MarketPosition == 0 and PositionProfit(1) < 0 And BarsSinceExit(1) >= abs(BarsSinceEntry(1)-BarsSinceExit(1)) Then Sell(); } 즐거운 하루되세요 > 팽구 님이 쓴 글입니다. > 제목 : 추가부탁드립니다. > 아래의 수식에서 직전거래가 손실이 나면, 손실기간(봉의갯수) 만큼 쉬었다가(진입금지) 다시 가동하게 만들어주세요.. 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(); }