创建(定义)数组的同时,可以赋初值,也可以不赋初值。
例:
int bb[]; 创建数组bb,不设定数组元素个数
int cc[8]; 创建数组cc,设定数组元素为8个,不赋初值
int dd[3]={9,8,7}; 创建数组dd,设定数组元素为4个,并赋初值
赋值后,dd[0]的值为9、dd[1]的值为8、dd[2]的值为7
int ee[9]={0,1,2,3}; 创建数组ee,设定数组元素为9个,但只给前4个元素赋初值
#property indicator_separate_window
#property indicator_color1 White
#property indicator_level1 0
extern int FMA=12;
extern int SMA=26;
double buf[];
int init()
{
SetIndexBuffer(0,buf);
SetIndexStyle(0,DRAW_LINE);
return(0);
}
int start()
{
int limit=Bars-IndicatorCounted();