커뮤니티

문의

프로필 이미지
sefswef
2015-10-01 12:00:26
115
글번호 90819
답변완료
Sell();
시스템
답변 1
프로필 이미지

예스스탁 예스스탁 답변

2015-10-01 11:30:17

안녕하세요 예스스탁입니다. 1. 차트 전체 거래에서 해당 상황이후에 거래를 더이상 하지 않는 식이면 아래와 같습니다. input : af(0.02), maxAF(0.2); Var : value(0); value = sar(af,maxAF); Condition1 = (IsExitName("sx",1) == true or IsExitName("bx",1) == true); If Condition1 == false and crossup(C,value) and C > O Then { if MarketPosition == -1 and PositionProfit < 0 and PositionProfit(1) < 0 and PositionProfit(2) < 0 Then ExitShort("sx"); Else Buy("b"); } If Condition1 == false and crossdown(C,value) and C < O Then{ if MarketPosition == 1 and PositionProfit < 0 and PositionProfit(1) < 0 and PositionProfit(2) < 0 Then ExitLong("bx"); else sell("s"); } 2. 당일 거래로만 3번연속 손실로 마감하면 당일 더이상 진입을 하지 않는 내용이시면 아래와 같습니다. input : af(0.02), maxAF(0.2); Var : value(0),cnt(0),count(0); value = sar(af,maxAF); #당일 진입횟수 카운트 count = 0; for cnt = 0 to 20{ if sdate == EntryDate(cnt) Then count = count+1; } Condition1 = ExitDate(1) == sdate and (IsExitName("sx",1) == true or IsExitName("bx",1) == true); If Condition1 == false and crossup(C,value) and C > O Then { if count >= 3 and MarketPosition == -1 and PositionProfit < 0 and PositionProfit(1) < 0 and PositionProfit(2) < 0 Then ExitShort("sx"); Else Buy("b"); } If Condition1 == false and crossdown(C,value) and C < O Then{ if count >= 3 and MarketPosition == 1 and PositionProfit < 0 and PositionProfit(1) < 0 and PositionProfit(2) < 0 Then ExitLong("bx"); else sell("s"); } 즐거운 하루되세요 > sefswef 님이 쓴 글입니다. > 제목 : 문의 > 아래의 수식을 세번연속으로 신호가 손실로 마감하면 네번째 신호에서 청산후 재진입하지 않도록 수식을 변형 시켜주십시요 즉 신호1 -> 신호2(손실1회)-> 신호3(손실2회)-> 신호4(손실3회) 여기서 청산후 더이상 새로운진입 하지 않도록 해주십시요.(즉 더이상 신호 나오지 않게 종료) 항상 감사드립니다. Input : af(0.02), maxAF(0.2); Var : value(0); value = sar(af,maxAF); If crossup(C,value) and C > O Then Buy(); If crossdown(C,value) and C < O Then Sell();