请求会写指标的朋友改进下这个指标![已解决!谢谢!]
heaven
|
4754 人阅读
|
15 人评论
|
2011-11-17
2012-10-14 13:43 上传
下载附件 (20.31 KB)
//+------------------------------------------------------------------+
//| LargeTimeFrame.mq4 |
//| Copyright ?2005, Miramaxx. |
//| mailto: morrr2001[dog]mail.ru |
//+------------------------------------------------------------------+
//|项耱痤屙桢 磬 沭圄桕?疋鬻彘 耱囵泐 蜞殪麴彘爨. |
//+------------------------------------------------------------------+
#property copyright "Copyright ?2005, Miramaxx."
#property link "mailto: morrr2001[dog]mail.ru"
//----
#property indicator_chart_window
//----
extern string Timeframe="D1";
extern int CountBars=10;
extern color Bear=Maroon;
extern color Bull=MidnightBlue;
//----
datetime time1;
datetime time2;
double open_price,close_price;
int bar_tf;
int PeriodName=0;
int num=0;
string error="相疣戾蝠 Timeframe 玎溧?礤 忮痦?n橡桁屦: 潆 鬣耦忸泐 沭圄桕?恹徨痂蝈 镟疣戾蝠 D1.";
//+------------------------------------------------------------------+
//| |
//+------------------------------------------------------------------+
void ObjDel()
{
for(;num>=0;num--)
ObjectDelete("Objtf"+num);
}
//+------------------------------------------------------------------+
//| |
//+------------------------------------------------------------------+
int init()
{
if (Timeframe=="M1") PeriodName=PERIOD_M1; //?蝾?驽 镱?潢? 黩??觏铒觇 磬 镟礤腓
else
if (Timeframe=="M5") PeriodName=PERIOD_M5;
else
if (Timeframe=="M15")PeriodName=PERIOD_M15;
else
if (Timeframe=="M30")PeriodName=PERIOD_M30;
else
if (Timeframe=="H1") PeriodName=PERIOD_H1;
else
if (Timeframe=="H4") PeriodName=PERIOD_H4;
else
if (Timeframe=="D1") PeriodName=PERIOD_D1;
else
if (Timeframe=="W1") PeriodName=PERIOD_W1;
else
if (Timeframe=="MN") PeriodName=PERIOD_MN1;
else
{
Comment(error);
return(0);
}
Comment("LargeTimeframe(",Timeframe,")");
return(0);
}
//+------------------------------------------------------------------+
//| |
//+------------------------------------------------------------------+
int deinit()
{
ObjDel();
Comment("");
return(0);
}
//+------------------------------------------------------------------+
//| |
//+------------------------------------------------------------------+
int start()
{
int i;
ObjDel();
num=0;
//----
if (PeriodName=0;bar_tf--)
{
time1=iTime(NULL,PeriodName,bar_tf);
i=bar_tf-1;
if (i |
|
|
|
|