数据窗口也能看,还是不太清楚,这里有一个查看 iCustom 序列值的 EA。 https://www.dr-ea.com/meta-blog/metatrader4/free-tool-mt4/customchecker_ea.html
//+------------------------------------------------------------------+
//| CustomChecker.mq4 |
//+------------------------------------------------------------------+
#property copyright "keiji"
#property link "http://www.dr-ea.com/meta-blog/"
extern string IndicatorName = "";
//+------------------------------------------------------------------+
//| expert initialization function |
//+------------------------------------------------------------------+
int init() {
//----
FuncLabelSet("IndicatorName", 10, 20, "【" + IndicatorName + "】", 10, White);
FuncLabelSet("sep1-1", 10, 30, "――――――――――――――――", 10, White);
FuncLabelSet("sep1-2", 215, 30, "――――――――――――――――", 10, White);
FuncLabelSet("bar s3", 60, 40, "Shift3", 10, White);
FuncLabelSet("bar s2", 160, 40, "Shift2", 10, White);
FuncLabelSet("bar s1", 260, 40, "Shift1", 10, White);
FuncLabelSet("bar cur", 360, 40, "Current", 10, White);
FuncLabelSet("sep2-1", 10, 50, "――――――――――――――――", 10, White);
FuncLabelSet("sep2-2", 215, 50, "――――――――――――――――", 10, White);
for (int i = 0; i < 8; i++)
FuncLabelSet("#" + i, 10, 60 + 15 * i, "#" + i, 10, White);
start();
//----
return (0);
}
//+------------------------------------------------------------------+
//| expert deinitialization function |
//+------------------------------------------------------------------+
int deinit() {
//----
ObjectsDeleteAll(0, OBJ_LABEL);
//----
return (0);
}
//+------------------------------------------------------------------+
//| expert start function |
//+------------------------------------------------------------------+
int start() {
//----
string buf_str[4][8];
for (int i = 0; i < 4; i++) {
for (int j = 0; j < 8; j++) {
double buf = iCustom(NULL, 0, IndicatorName, j, i);
if (buf == EMPTY_VALUE)
buf_str[i][j] = "EMPTY_VALUE";
else {
buf_str[i][j] = DoubleToStr(buf, 8);
if (StringLen(buf_str[i][j]) > 12)
buf_str[i][j] = StringSubstr(buf_str[i][j], 0, 12);
}
FuncLabelSet(i + "buf" + j, 340 - 100 * i, 60 + 15 * j, buf_str[i][j], 10, White);
}
}
//----
return (0);
}
//+------------------------------------------------------------------+
void FuncLabelSet(string labelname, int x, int y, string text, int size, color labelcolor, int corner = 0) {
if (ObjectFind(labelname) == -1)
ObjectCreate(labelname, OBJ_LABEL, 0, 0, 0);
ObjectSet(labelname, OBJPROP_CORNER, corner);
ObjectSet(labelname, OBJPROP_XDISTANCE, x);
ObjectSet(labelname, OBJPROP_YDISTANCE, y);
ObjectSetText(labelname, text, size, "メイリオ", labelcolor);
}