核心代码如下,有问题可以问我
int limit;
int counted_bars=IndicatorCounted();
//---- check for possible errors
if(counted_bars<0) return(-1);
//---- the last counted bar will be recounted
if(counted_bars>0) counted_bars--;
limit=rates_total-prev_calculated;
datetime TimeArray[];
int i,i_1,y=0,y_1;
ArrayCopySeries(TimeArray,MODE_TIME,NULL,TimeFrame);
int TimeDiff=(Time[0]-TimeArray[0])/(60*ChartPeriod());
for(i=TimeDiff,y=1;i<=limit;i++)
{
if(Time[i]<TimeArray[y])y++;
{
ExtMapBuffer1[i]=iCustom(NULL,TimeFrame,"Signal3",36,58,9,1,30,0,0,y);
ExtMapBuffer2[i]=iCustom(NULL,TimeFrame,"Signal3",36,58,9,1,30,0,1,y);
}
}
for(i_1=0,y_1=0;i_1<=TimeDiff;i_1++)
{
if(Time[i_1]<TimeArray[y_1])y_1++;
{
ExtMapBuffer1[i_1]=iCustom(NULL,TimeFrame,"Signal3",36,58,9,1,30,0,0,y_1);
ExtMapBuffer2[i_1]=iCustom(NULL,TimeFrame,"Signal3",36,58,9,1,30,0,1,y_1);
}
}
return(rates_total);
|