比特币通信协议 - 币圈消息

比特币通信协议篇11、二、TURN简介。在典型的情况下,TURN客户端连接到内网中,并且通过一个或者多个NAT到 详细

新版mt4编译自定义函数出现这样的警告,怎么样解决?

  [复制链接]
662 13
梁子外汇 发表于 2014-4-14 16:54:17 | 只看该作者 |阅读模式 打印 上一主题 下一主题
我在新版mt4编译自定义函数时候出现declaration of 'Lots' hides global declaration at line 10这样的警告,什么意思,该怎么样解决呢?还望各位高手指教。
收藏
收藏0
转播
转播
分享
分享
分享
淘帖0

精彩评论13

跳转到指定楼层
沙发
ytpld 发表于 2014-4-14 17:47:42 | 只看该作者
帮你顶,既然不懂
板凳
jiuhongzhi 发表于 2014-4-14 21:11:23 | 只看该作者
望各位高手指教。
地板
奔富 发表于 2014-4-14 21:45:07 | 只看该作者
帮你顶望各位高手指教。
5#
jackywang5 发表于 2014-4-15 13:33:21 | 只看该作者

放到int init的前面,也就是全局变量的设置里,如下面所示..
[C] 纯文本查看 复制代码#property indicator_chart_window
#property indicator_buffers 2
#property indicator_color1 Green
#property indicator_color2 Red
//----
double TrendUp[];
double TrendDown[];
double NonTrend[];
int st=0;
int UpDownShift;
==================
将变量设置放在这里就OK了.
==================
//----
extern int TrendCCI_Period=14;
extern bool Automatic_Timeframe_setting;
extern int M1_CCI_Period=14;
extern int M5_CCI_Period=14;
extern int M15_CCI_Period=14;
extern int M30_CCI_Period=14;
extern int H1_CCI_Period=14;
extern int H4_CCI_Period=14;
extern int D1_CCI_Period=14;
extern int W1_CCI_Period=14;
extern int MN_CCI_Period=14;
//+------------------------------------------------------------------+
//| Custom indicator initialization function                         |
//+------------------------------------------------------------------+
int init()
  {
//---- indicators
   SetIndexStyle(0,DRAW_LINE,0,2);
6#
lic 发表于 2014-4-15 14:14:58 | 只看该作者
瞧不起在天
7#
绝地反击 发表于 2014-4-15 22:41:47 | 只看该作者

望各位高手指教。


8#
你妈 发表于 2014-4-16 00:28:19 | 只看该作者
真的有高手呢
9#
 楼主| 梁子外汇 发表于 2014-4-14 21:45:00 | 只看该作者

在新版里面,int init()已经更改成int OnInit()了#property copyright "Copyright 2013, MetaQuotes Software Corp."
#property link      "http://www.mql5.com"
#property version   "1.00"
#property strict
//--- input parameters
input double   Lots=0.1;//我发现把这个参数直接注释掉,它反而没有这样的警告
//+------------------------------------------------------------------+
//| Expert initialization function                                   |
//+------------------------------------------------------------------+
int OnInit()
  {
//---
//---
   return(INIT_SUCCEEDED);
  }
//+------------------------------------------------------------------+
//| Expert deinitialization function                                 |
//+------------------------------------------------------------------+
void OnDeinit(const int reason)
  {
//---
  }
//+------------------------------------------------------------------+
//| Expert tick function                                             |
//+------------------------------------------------------------------+
void OnTick()
  {
//---
  }
//+------------------------------------------------------------------+
int buylimit(double Lots,double stoploss,double takeprofit,double price,string comment,int magic)// 自定义函数
  {
  }
10#
汇神专一郎 发表于 2014-4-19 21:44:00 | 只看该作者
自定义函数也有同名变量Lots,两个用不同名的即可。一般全局变量前缀加global_Lots.
您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

发布主题
阅读排行更多+

Powered by 顺水鱼MT4外汇EA网! X3.2© 2001-2017 顺水MT4外汇EA公司.( 陕ICP备17014341号-1