在循环中查看 iCustom 指标的索引值
input string Indicator = "AMAngleZn";
//+------------------------------------------------------------------+
//| |
//+------------------------------------------------------------------+
int OnInit() {
return(INIT_SUCCEEDED);
}
//+------------------------------------------------------------------+
//| |
//+------------------------------------------------------------------+
int OnCalculate(const int rates_total,
const int prev_calculated,
const datetime &time[], sa
const double &open[],
const double &high[],
const double &low[],
const double &close[],
const long &tick_volume[],
const long &volume[],
const int &spread[]) {
string com = "";
for(int i = 0; i < 20; i++) {
com += StringConcatenate(i, " = ", iCustom(_Symbol, 0, Indicator, i, 0), "\n");
}
Comment(com);
return(rates_total);
}
void OnDeinit(const int reason) {
Comment("");
}