Q&A 게시판 HOME > Q&A 게시판
작성자 : 예스스탁 작성일 : 2021-06-23 10:55:27 조회수 : 346
Re:자동추세선 A/T 기능에 대한 질문 
안녕하세요?

과거 추세선을 지우는 내용을 주석으로 처리하였습니다.
아래 식으로 적용하시면 과거 추세선도 모두 표시합니다.

감사합니다.


input : 비교고저점기준(5); 
 var : cnt(0),BTL(0),STL(0); 
 Array : HH[20](0),HD[20](0),HT[20](0); 
 Array : LL[20](0),LD[20](0),LT[20](0); 

 if SwingHigh(1,H,비교고저점기준,비교고저점기준,비교고저점기준*2+1) != -1 Then{ 
       HH[0] = H[비교고저점기준]; 
       HD[0] = sdate[비교고저점기준]; 
       HT[0] = sTime[비교고저점기준]; 
       Condition1 = false; 
       for cnt = 1 to 19{ 
           HH[cnt] = HH[cnt-1][1]; 
           HD[cnt] = HD[cnt-1][1]; 
           HT[cnt] = HT[cnt-1][1]; 
           if Condition1 == false and HH[cnt] > HH[0] and HH[cnt] > 0 Then{ 
                 Condition1 = true; 
                 //TL_Delete(BTL); 
                 BTL = TL_New(HD[cnt],HT[cnt],HH[cnt],HD[0],HT[0],HH[0]); 
                 TL_SetExtRight(BTL,true); 
                 TL_SetColor(BTL,RED); 
           } 
       } 
        
 } 

 if SwingLow(1,L,비교고저점기준,비교고저점기준,비교고저점기준*2+1) != -1 Then{ 
       LL[0] = L[비교고저점기준]; 
       LD[0] = sdate[비교고저점기준]; 
       LT[0] = sTime[비교고저점기준]; 
       Condition2 = false; 
       for cnt = 1 to 19{ 
           LL[cnt] = LL[cnt-1][1]; 
           LD[cnt] = LD[cnt-1][1]; 
           LT[cnt] = LT[cnt-1][1]; 
           if Condition2 == false and LL[cnt] < LL[0] and LL[cnt] > 0 Then{ 
                 Condition2 = true; 
                 //TL_Delete(STL); 
                 STL = TL_New(LD[cnt],LT[cnt],LL[cnt],LD[0],LT[0],LL[0]); 
                 TL_SetExtRight(STL,true); 
                 TL_SetColor(STL,blue); 
           } 
       } 
 } 

 if C > TL_GetValue(BTL,sdate,stime) and C[1] < TL_GetValue(BTL,sdate[1],stime[1]) Then{ 
       buy(); 
 } 

 if C < TL_GetValue(STL,sdate,stime) and C[1] > TL_GetValue(STL,sdate[1],stime[1]) Then{ 
       sell(); 
 } 
목록 답변