ChartIndicatorsTotal

지정된 차트 창에 적용된 모든 지표의 수를 반환

int  ChartIndicatorsTotal(
   long  chart_id,      // 차트 id
   int   sub_window     // 하위 창의 번호
   );

매개변수

chart_id

[in]  차트 ID. 0은 현재 차트를 나타냅니다.

sub_window

[in] 차트 하위창의 번호. 0은 주 차트 하위 창을 나타냅니다.

값 반환

지정한 차트 창에 있는 지표의 수. 오류 정보를 가져오기 위해 GetLastError() 기능을 사용.

주의

이 기능을 사용하면 차트에 연결된 모든 지표를 검색할 수 있습니다. 차트의 모든 창 수는 CHART_WINDOWS_TOTAL 속성에서 ChartGetInteger() 함수를 사용하여 얻을 수 있습니다.

예:

//+------------------------------------------------------------------+
//| 스크립트 프로그램 시작 함수                                          |
//+------------------------------------------------------------------+
void OnStart()
  {
//--- 현재 차트 ID와 기본 창을 포함한 하위 창의 수를 가져옵니다.
   long chart_id = ChartID();
   int  wnd_total= (int)ChartGetInteger(0,CHART_WINDOWS_TOTAL);
   
//--- 루프의 모든 현재 차트 창을 반복합니다.
   for(int w=0w<wnd_totalw++)
     {
      //--- 루프 인덱스로 지정된 차트 창에 연결된 지표의 수를 가져옵니다.
      int ind_total=ChartIndicatorsTotal(chart_idw);
      
      //--- 지정된 차트 창에 연결된 지표 수를 가져옵니다.
      PrintFormat("Chart ID %I64d, subwindow %d. Attached indicators: %d"chart_idwind_total);
     }
   /*
   결과:
   Chart ID 133246248352168439subwindow 0Attached indicators3
   Chart ID 133246248352168439subwindow 1Attached indicators2
   Chart ID 133246248352168439subwindow 2Attached indicators1
   */
  }

추가 참조

ChartIndicatorAdd(), ChartIndicatorDelete(), iCustom(), IndicatorCreate(), IndicatorSetString()