この関数は、対応するインジケータープロパティの値を設定します。インジケータプロパティは文字列型である必要があります。この関数には2つのバリアントがあります。
プロパティ識別子を指定して呼び出します。
bool IndicatorSetString(
int prop_id,
string prop_value
);
|
プロパティ識別子と修飾子を指定して呼び出します。
bool IndicatorSetString(
int prop_id,
int prop_modifier,
string prop_value
)
|
パラメーター
prop_id
[in]インジケータープロパティの識別子。値は、ENUM_CUSTOMIND_PROPERTY_STRING列挙の値のいずれかです。
prop_modifier
[in]指定されたプロパティの修飾子。レベルプロパティのみに修飾子が必要です。
prop_value
[in]プロパティの値。
戻り値
注意
- IndicatorSetString(INDICATOR_LEVELTEXT、0 、 “First Level”)-インデックス0は、最初のレベルのテキスト記述を設定するために使用されます。
例:テキストラベルをインジケーターの水平線に設定するインジケーター。

#property indicator_separate_window
#property indicator_minimum 0
#property indicator_maximum 100
//— display three horizontal levels in a separate indicator window
#property indicator_level1 30
#property indicator_level2 50
#property indicator_level3 70
//— set color of horizontal levels
#property indicator_levelcolor clrRed
//— set style of horizontal levels
#property indicator_levelstyle STYLE_SOLID
//+——————————————————————+
//| Custom indicator initialization function |
//+——————————————————————+
int OnInit()
{
//— set descriptions of horizontal levels
IndicatorSetString(INDICATOR_LEVELTEXT,0,“First Level (index 0)”);
IndicatorSetString(INDICATOR_LEVELTEXT,1,“Second Level (index 1)”);
IndicatorSetString(INDICATOR_LEVELTEXT,2,“Third Level (index 2)”);
//— set the short name for indicator
IndicatorSetString(INDICATOR_SHORTNAME,“IndicatorSetString() Demo”);
//—
return(INIT_SUCCEEDED);
}
//+——————————————————————+
//| Custom indicator iteration function |
//+——————————————————————+
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[])
{
//—
//— return value of prev_calculated for next call
return(rates_total);
}
|
0 people found this article useful
0 people found this article useful