画前高的指标被我写成每根K线都画一条 图上全是横线
分享个画前高的指标 我本来只想画最近 20 根里最高那一条 结果写成每根 K 线都画 图上一堆横线 对象越积越多 切个周期还卡半天 这版就是那个坑 你们画这种是只留最新一条 还是每根都留着
#property indicator_chart_window
input int N = 20;
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[])
{
for(int i=0; i<rates_total; i++)
{
double hh = high[ArrayMaximum(high, N, i)];
string nm = "PH" + (string)i;
ObjectCreate(0, nm, OBJ_HLINE, 0, 0, hh);
}
return(rates_total);
}全部回复(16)
发表回复
请先登录后再回复。
