ArrayIsSeries

이 함수는 배열이 시계열인지 여부를 확인.

bool  ArrayIsSeries(
   const void&  array[]    // 확인된 배열
   );

매개변수

array[]

[in]  확인된 배열.

반환 값

선택된 배열이 시계열 배열이면 true를 반환하고, 그렇지 않으면 false를 반환합니다. OnCalculate() 함수에 매개변수로 전달된 배열에서 ArrayGetAsSeries()를 통한 배열 요소에 액세스하는 순서를 확인해야 합니다.

예:

#property indicator_chart_window
#property indicator_buffers 1
#property indicator_plots   1
//---- 플롯 라벨1
#property indicator_label1  "라벨1"
#property indicator_type1   DRAW_LINE
#property indicator_color1  clrRed
#property indicator_style1  STYLE_SOLID
#property indicator_width1  1
//--- 지표 버퍼
double         Label1Buffer[];
//+------------------------------------------------------------------+
//| 사용자 지정 지표 초기화 함수                         |
//+------------------------------------------------------------------+
void OnInit()
  {
//--- 지표 버퍼 맵핑
   SetIndexBuffer(0,Label1Buffer,INDICATOR_DATA);
//---
  }
//+------------------------------------------------------------------+
//| 사용자 지정 지표 반복 함수                              |
//+------------------------------------------------------------------+
int OnCalculate(const int rates_total,
                const int prev_calculated,
                const datetime &time[],
                const double &open[],
                const double &high[],
                const double &low[],
                const double &close[],
                const long &tick_volume[],
                const long &volume[],
                const int &spread[])
  {
//---
   if(ArrayIsSeries(open))
      Print("open[]이 시계열입니다");
   else
      Print("open[]이 시계열이 아닙니다!!!");
//--- 다음 호출을 위한 prev_calculated의 반환 값
   return(rates_total);
  }

추가 참조

시계열 및 지표에 대한 액세스