有没有高手知道这指标为什么编译不过啊 谢谢
mt4吧
全部回复
仅看楼主
level 1
diucis 楼主
从别处找来的 自己不懂 编译的时候有4个错误
int i;
int limit;
int counted_bars=IndicatorCounted();
if(counted_bars<0) return(-1);
if(counted_bars>0) counted_bars--;
limit=Bars-counted_bars;
for (i=limit-1;i>=0;i--)
{
double mahigh=iMA(NULL,0,ma_period,0,MODE_SMA,PRICE_HIGH,i);
double mahighp=iMA(NULL,0,4,0,MODE_SMA,PRICE_HIGH,i+1);
double malow=iMA(NULL,0,ma_period,0,MODE_SMA,PRICE_LOW,i);
double malowp=iMA(NULL,0,4,0,MODE_SMA,PRICE_LOW,i+1);
double shang=iBands(NULL,0,Length,Deviation,0,PRICE_CLOSE,MODE_UPPER,i);
double shangp=iBands(NULL,0,Length,Deviation,0,PRICE_CLOSE,MODE_UPPER,i+1);
double xia=iBands(NULL,0,Length,Deviation,0,PRICE_CLOSE,MODE_LOWER,i);
double xiap=iBands(NULL,0,Length,Deviation,0,PRICE_CLOSE,MODE_LOWER,i+1);
if((mahighp>shangp)&&(mahigh<shang))
{
{
up=Low+50*MarketInfo(Symbol(),MODE_POINT);
if(i==0)
{
if(uptime!=Time)
{
Alert(Symbol()+Period()+"UP"+Bid);
uptime=Time;
}
}
}
}
if((malowp<xiap)&&(malow>xia))
{
{
down=High-50*MarketInfo(Symbol(),MODE_POINT);
if(i==0)
{
if(downtime!=Time)
{
Alert(Symbol()+Period()+"UP"+Bid);
downtime=Time;
}
}
}
}
}
2014年05月29日 06点05分 1
level 1
你这个复制不全,如果你自己不把它当回事,胡乱拷贝复制。谁愿意回答呢?很多变量没定义,或文件头部丢失
2014年07月26日 08点07分 4
level 1
//+------------------------------------------------------------------+
//| FromMT4Bar.mq4 |
//| Copyright 2013, MetaQuotes Software Corp. |
//| http://www.mql5.com |
//+------------------------------------------------------------------+
#property copyright "Copyright 2013, MetaQuotes Software Corp."
#property link "http://www.mql5.com"
#property version "1.00"
#property strict
#property indicator_chart_window
extern int ma_period=30;
extern int Length=60;
extern double Deviation=2;
double up,down;
datetime uptime,downtime;
//+------------------------------------------------------------------+
//| Custom indicator initialization function |
//+------------------------------------------------------------------+
int init()
{
//--- indicator buffers mapping
//---
return(0);
}
int start(){
int i;
int limit;
int counted_bars=IndicatorCounted();
if(counted_bars<0) return(-1);
if(counted_bars>0) counted_bars--;
limit=Bars-counted_bars;
for (i=limit-1;i>=0;i--) {
double mahigh=iMA(NULL,0,ma_period,0,MODE_SMA,PRICE_HIGH,i);
double mahighp=iMA(NULL,0,4,0,MODE_SMA,PRICE_HIGH,i+1);
double malow=iMA(NULL,0,ma_period,0,MODE_SMA,PRICE_LOW,i);
double malowp=iMA(NULL,0,4,0,MODE_SMA,PRICE_LOW,i+1);
double shang=iBands(NULL,0,Length,Deviation,0,PRICE_CLOSE,MODE_UPPER,i);
double shangp=iBands(NULL,0,Length,Deviation,0,PRICE_CLOSE,MODE_UPPER,i+1);
double xia=iBands(NULL,0,Length,Deviation,0,PRICE_CLOSE,MODE_LOWER,i);
double xiap=iBands(NULL,0,Length,Deviation,0,PRICE_CLOSE,MODE_LOWER,i+1);
if((mahighp>shangp)&&(mahigh<shang)){
up=Low[i]+50*MarketInfo(Symbol(),MODE_POINT);
if(i==0){
if(uptime!=Time[0]){
Alert(Symbol()+IntegerToString(Period())+"UP"+DoubleToString(Bid));
uptime=Time[0];
}
}
}
if((malowp<xiap)&&(malow>xia)){
down=High[i]-50*MarketInfo(Symbol(),MODE_POINT);
if(i==0){
if(downtime!=Time[0]){
Alert(Symbol()+IntegerToString(Period())+"UP"+DoubleToString(Bid));
downtime=Time[0];
}
}
}
}
return(0);
2014年07月26日 08点07分 5
谢谢
2014年07月26日 11点07分
level 1
}
2014年07月26日 08点07分 6
level 1
这个不是指标,应该是EA,他没有画线功能,只有报警功能
2014年07月31日 07点07分 7
1