請問各位大哥:關於~~~~'int' - comma or semicolon expected 新评论 [删除] 2013.08.25 18:46 QQ小弟我沒寫過程式,於是照本宣科參考網路寫法 滿心期盼第一支自己打上去的指標可以生成,開心地按下F5結果出現 'int' - comma or semicolon expected 'init' - expression on global scope not allowed 'SMA' - variable not defined 'Buf3' - variable not defined <----這東西總共有九筆= =||| '}' - unbalanced parentheses 各位><大哥這是哪裡出了問題~~~~小弟不才............ #property copyright "Copyright 2013, MetaQuotes Software Corp." #property link "http://www.metaquotes.net" #property indicator_chart_window #property indicator_buffers 1 #property indicator_color1 Red #property indicator_width1 1 #property indicator_color2 Green #property indicator_width2 2 #property indicator_color3 Navy #property indicator_width3 3 #property indicator_color4 Gray #property indicator_width4 4 #property indicator_color5 Yellow #property indicator_width5 5 #property indicator_color6 Aqua #property indicator_width6 6 #property indicator_color7 Tan #property indicator_width7 7 #property indicator_color8 Pink #property indicator_width8 8 #property indicator_color9 DeepPink #property indicator_width9 9 #property indicator_color10 Black #property indicator_width10 10 double buf[10]; extern int SMA=10 //+------------------------------------------------------------------+ //| expert initialization function | //+------------------------------------------------------------------+ int init() { int darw_begin; SetIndexStyle(0,DRAW_LINE); SetIndexBuffer(0,buf); SetIndexStyle(1,DRAW_LINE); SetIndexBuffer(1,Buf2); SetIndexStyle(2,DRAW_LINE); SetIndexBuffer(2,Buf3); SetIndexStyle(3,DRAW_LINE); SetIndexBuffer(3,Buf4); SetIndexStyle(4,DRAW_LINE); SetIndexBuffer(4,Buf5); SetIndexStyle(5,DRAW_LINE); SetIndexBuffer(5,Buf6); SetIndexStyle(6,DRAW_LINE); SetIndexBuffer(6,Buf7); SetIndexStyle(7,DRAW_LINE); SetIndexBuffer(7,Buf8); SetIndexStyle(8,DRAW_LINE); SetIndexBuffer(8,Buf9); SetIndexStyle(9,DRAW_LINE); SetIndexBuffer(9,Buf10); } return(0); } //---- //---- //+------------------------------------------------------------------+ //| expert deinitialization function | //+------------------------------------------------------------------+ int deinit() { //---- //---- return(0); } //+------------------------------------------------------------------+ //| expert start function | //+------------------------------------------------------------------+ int start() { int limit=Bars-IndicatorCounted(); for(int i=0;i<limit,i++) { buf[i]=iMA(NULL,0,SMA,0,2,0,i); } //---- //---- return(0); } //+------------------------------------------------------------------+ 自己编写的枢轴点指标,以前用了好长时间,现在软件可能是软件升级从插入自定义指标里调不出来了,请高手指教,现在在家里的电脑里调不出,单位电脑还能调出来 能不能用mt4编写出这样的曲线EMA(MA(C,N),M)? 如何在两个均线之间填充颜色??? BaiChun Li 2013.08.30 17:16 #1 int函数上面的这句 extern int SMA=10少了一个;结尾的符号 当然代码中可能还有其他问题,但是其他问题不是导致'int' - comma or semicolon expected提示的问题。 新评论 您错过了交易机会: 免费交易应用程序 8,000+信号可供复制 探索金融市场的经济新闻 注册 登录 拉丁字符(不带空格) 密码将被发送至该邮箱 发生错误 使用 Google 登录 您同意网站政策和使用条款 如果您没有帐号,请注册 可以使用cookies登录MQL5.com网站。 请在您的浏览器中启用必要的设置,否则您将无法登录。 忘记您的登录名/密码? 使用 Google 登录
QQ小弟我沒寫過程式,於是照本宣科參考網路寫法
滿心期盼第一支自己打上去的指標可以生成,開心地按下F5結果出現
'int' - comma or semicolon expected
'init' - expression on global scope not allowed
'SMA' - variable not defined
'Buf3' - variable not defined <----這東西總共有九筆= =|||
'}' - unbalanced parentheses
#property copyright "Copyright 2013, MetaQuotes Software Corp."
#property link "http://www.metaquotes.net"
#property indicator_chart_window
#property indicator_buffers 1
#property indicator_color1 Red
#property indicator_width1 1
#property indicator_color2 Green
#property indicator_width2 2
#property indicator_color3 Navy
#property indicator_width3 3
#property indicator_color4 Gray
#property indicator_width4 4
#property indicator_color5 Yellow
#property indicator_width5 5
#property indicator_color6 Aqua
#property indicator_width6 6
#property indicator_color7 Tan
#property indicator_width7 7
#property indicator_color8 Pink
#property indicator_width8 8
#property indicator_color9 DeepPink
#property indicator_width9 9
#property indicator_color10 Black
#property indicator_width10 10
double buf[10];
extern int SMA=10
//+------------------------------------------------------------------+
//| expert initialization function |
//+------------------------------------------------------------------+
int init()
{
int darw_begin;
SetIndexStyle(0,DRAW_LINE);
SetIndexBuffer(0,buf);
SetIndexStyle(1,DRAW_LINE);
SetIndexBuffer(1,Buf2);
SetIndexStyle(2,DRAW_LINE);
SetIndexBuffer(2,Buf3);
SetIndexStyle(3,DRAW_LINE);
SetIndexBuffer(3,Buf4);
SetIndexStyle(4,DRAW_LINE);
SetIndexBuffer(4,Buf5);
SetIndexStyle(5,DRAW_LINE);
SetIndexBuffer(5,Buf6);
SetIndexStyle(6,DRAW_LINE);
SetIndexBuffer(6,Buf7);
SetIndexStyle(7,DRAW_LINE);
SetIndexBuffer(7,Buf8);
SetIndexStyle(8,DRAW_LINE);
SetIndexBuffer(8,Buf9);
SetIndexStyle(9,DRAW_LINE);
SetIndexBuffer(9,Buf10);
}
return(0);
}
//----
//----
//+------------------------------------------------------------------+
//| expert deinitialization function |
//+------------------------------------------------------------------+
int deinit()
{
//----
//----
return(0);
}
//+------------------------------------------------------------------+
//| expert start function |
//+------------------------------------------------------------------+
int start()
{
int limit=Bars-IndicatorCounted();
for(int i=0;i<limit,i++)
{
buf[i]=iMA(NULL,0,SMA,0,2,0,i);
}
//----
//----
return(0);
}
//+------------------------------------------------------------------+