커뮤니티

부탁드려요

프로필 이미지
data
2011-02-23 00:28:26
1037
글번호 35989
답변완료
(1)진입청산 macd(12 26) = A (2)필터1:진입시간 10:00~14:30 (3)필터2 macd osc(12 26 9) = B (4)필터3 DMI(50) (5)필터4 5이평>60이평 A가 필터1 &#54613;터2 필터3 필터4를 만족하면 0을 상승돌파하거나 A가 필터1 필터3 필터4를 만족하면 0을 상승돌파한 후 필터2로 사용했던 B가 0을 상승 돌파하면 매수하려고 해서 다음과 같이 식을 만들었을때 오류은 안 나왔지만 지표를 띄어 놓고 보면 의도한 바와 다르게 나와서 가령 A가 필터3 또는 필터4를 만족하지 않고 돌파했는데도 B돌파시 A와 필터3 필터4만 맞으면 돌파식이 나온다든지 하는 에러가 나옵니다 한번 봐주세요 Input : shortperiod(12),longperiod(26),period1(9),period2(50),period3(5),period4(60); var1 = MACD(shortperiod, longperiod); var2 = MACD(shortperiod, longperiod)-ema(MACD(shortperiod, longperiod), period1); var3 = DiPlus(period2)-DiMinus(period2); var4 = Ma(C,period3)-Ma(C,period4); condition1= stime >= 095900 and stime <= 142900 ; condition2 = var2 > 0; condition3 = var3 > 0; condition4 = var4 > 0; if dayindex == 0 Then Condition5 = false; if condition1 and crossup(var1,0) Then Condition5 = true; if Condition1 == true Then{ if (condition2 and condition3 and condition4 and crossup(var1,0)) or (Condition5 == true and var1 > 0 and condition3 and condition4 and crossup(var2,0)) Then buy(); } if crossdown(var1, 0) then exitlong();
시스템
답변 1
프로필 이미지

예스스탁 예스스탁 답변

2011-02-23 11:33:16

안녕하세요 예스스탁입니다. "A가 필터1 &#54613;터2 필터3 필터4를 만족하면 0을 상승돌파하면 매스" 해당진입은 문제가 없습니다. 다만 "A가 필터1 필터3 필터4를 만족하면 0을 상승돌파한 후 필터2로 사용했던 B가 0을 상승 돌파하면 매수"하는 부분이 작성한 내용으로 보면 당일 지정된 시간이내에 var1이 0을 상향돌파한적이 있고 현재 var1 > 0 and condition3 and condition4 and crossup(var2,0) 이 만족하면 매수하는 내용입니다. 즉 condition3 and condition4가 crossup(var1,0)와 관련된 것이 아니고 현재 신호나는 봉이 해당 조건을 만족해야 매수한다는 식입니다. 아래와 같이 작성되어야 합니다. Input : shortperiod(12),longperiod(26),period1(9),period2(50),period3(5),period4(60); var1 = MACD(shortperiod, longperiod); var2 = MACD(shortperiod, longperiod)-ema(MACD(shortperiod, longperiod), period1); var3 = DiPlus(period2)-DiMinus(period2); var4 = Ma(C,period3)-Ma(C,period4); condition1= stime >= 095900 and stime <= 142900 ; condition2 = var2 > 0; condition3 = var3 > 0; condition4 = var4 > 0; if dayindex == 0 Then Condition5 = true; #필터1,2,3,4만족하고 var1이 0을 상향돌파하면 매수 if Condition1 and Condition2 and Condition3 and Condition4 and crossup(var1,0) Then buy("b1"); if Condition1 and Condition3 and Condition4 and crossup(var1,0) Then Condition5 = true; #직전에 필터1,3,4와 var1이 0을 상향돌파가 동시에 만족한 봉이 있고 #현재 var4가 0을 상향돌파하면 매수 if Condition5 == true and crossup(var2,0) Then buy("b2"); if crossdown(var1, 0) then exitlong(); 유의하신 부분은 Condition5는 당일 Condition1 and Condition3 and Condition4 and crossup(var1,0) 조건을 만족한 봉이 생기면 그 이후에 계속 true이므로 청산후에 다시 crossup(var2,0) 조건이 성립되면 또 매수들어가게 됩니다. 즐거운 하루되세요 > data 님이 쓴 글입니다. > 제목 : 부탁드려요 > (1)진입청산 macd(12 26) = A (2)필터1:진입시간 10:00~14:30 (3)필터2 macd osc(12 26 9) = B (4)필터3 DMI(50) (5)필터4 5이평>60이평 A가 필터1 &#54613;터2 필터3 필터4를 만족하면 0을 상승돌파하거나 A가 필터1 필터3 필터4를 만족하면 0을 상승돌파한 후 필터2로 사용했던 B가 0을 상승 돌파하면 매수하려고 해서 다음과 같이 식을 만들었을때 오류은 안 나왔지만 지표를 띄어 놓고 보면 의도한 바와 다르게 나와서 가령 A가 필터3 또는 필터4를 만족하지 않고 돌파했는데도 B돌파시 A와 필터3 필터4만 맞으면 돌파식이 나온다든지 하는 에러가 나옵니다 한번 봐주세요 Input : shortperiod(12),longperiod(26),period1(9),period2(50),period3(5),period4(60); var1 = MACD(shortperiod, longperiod); var2 = MACD(shortperiod, longperiod)-ema(MACD(shortperiod, longperiod), period1); var3 = DiPlus(period2)-DiMinus(period2); var4 = Ma(C,period3)-Ma(C,period4); condition1= stime >= 095900 and stime <= 142900 ; condition2 = var2 > 0; condition3 = var3 > 0; condition4 = var4 > 0; if dayindex == 0 Then Condition5 = false; if condition1 and crossup(var1,0) Then Condition5 = true; if Condition1 == true Then{ if (condition2 and condition3 and condition4 and crossup(var1,0)) or (Condition5 == true and var1 > 0 and condition3 and condition4 and crossup(var2,0)) Then buy(); } if crossdown(var1, 0) then exitlong();