#property indicator_separate_window
#property indicator_minimum 0
#property indicator_maximum 100
//--- 별도의 지표 창에 3개의 수평 레벨을 표시
#property indicator_level1 30
#property indicator_level2 50
#property indicator_level3 70
//--- 수평선 색상을 설정
#property indicator_levelcolor clrRed
//--- 수평 레벨의 스타일 설정
#property indicator_levelstyle STYLE_SOLID
//+------------------------------------------------------------------+
//| 사용자 지정 지표 초기화 함수 |
//+------------------------------------------------------------------+
int OnInit()
{
//--- 수평 레벨의 설명 설정
IndicatorSetString(INDICATOR_LEVELTEXT,0,"First Level (index 0)");
IndicatorSetString(INDICATOR_LEVELTEXT,1,"Second Level (index 1)");
IndicatorSetString(INDICATOR_LEVELTEXT,2,"Third Level (index 2)");
//--- 지표를 약칭을 설정
IndicatorSetString(INDICATOR_SHORTNAME,"IndicatorSetString() Demo");
//---
return(INIT_SUCCEEDED);
}
//+------------------------------------------------------------------+
//| 사용자 지정 지표 반복 함수 |
//+------------------------------------------------------------------+
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[])
{
//---
//--- 다음 호출을 위한 prev_calculated의 반환 값
return(rates_total);
}
|