顺水外汇EA交易网MT4
标题:
最近翻出来了n年前写的头肩顶与头肩底指标。。。
[打印本页]
作者:
daxiooong
时间:
2018-1-11 16:50
标题:
最近翻出来了n年前写的头肩顶与头肩底指标。。。
和蝴蝶类的差不多,没写太全面,还能用。。。呵呵
作者:
yunyun-35
时间:
2018-1-11 17:00
看来这次沙发坐定了,非常感谢楼主的奉献!
作者:
kings8
时间:
2018-1-11 17:18
[attach]23392[/attach]
支持支持支持。。。
作者:
jiuhongzhi
时间:
2018-1-11 17:30
咋用?????????????
作者:
daxiooong
时间:
2018-1-11 19:05
//+------------------------------------------------------------------+
//| tjd.mq4 |
//| Copyright ?2005, daxiooong | tjd.mq4 |
//| qq:123991669 |
//+------------------------------------------------------------------+
//+------------------------------------------------------------------+
#property copyright "Copyright ?2005,daxiooong."
//----
#property indicator_chart_window
//----
extern int Nzi=50;
extern int timeframe=0;
extern color color_all=Red;
extern int 顶底差=20;
extern int TP=82;
extern bool ALERTT=true;
extern bool TREND=true;
extern bool TRIANGLE=true;
extern bool 止损止盈=false;
extern bool FT=false; //false true
extern int WidthX=1;
extern int 点值=10;
//----
color color_all22 ;
int time0;
int num=0;
int MB=1;
string error="D1.";
double jilu;
int duan_0_5,duan_5_10,duan_02,duan_03,duan_06,duan_07;
double High_20,High_60,Close_00,High_All,Low_All,High_F,High_S,Low_Allx1,Low_Allx2,High_All_120p;
double 当天高点,High_127,Low_06,Low_255;
//+------------------------------------------------------------------+
//| |
//+------------------------------------------------------------------+
//+------------------------------------------------------------------+
//| |
//+------------------------------------------------------------------+
int init()
{
if(Period()==43200){time0=2592000;}
else if(Period()==10080){time0=604800;}
else if(Period()==1440){time0=86400;}
else if(Period()==240){time0=14400;}
else if(Period()==60){time0=3600;}
else if(Period()==30){time0=1800;}
else if(Period()==15){time0=900;}
else if(Period()==5){time0=300;}
else if(Period()==1){time0=60;}
else return(0);
return(0);
}
//+------------------------------------------------------------------+
//| |
//+------------------------------------------------------------------+
int deinit()
{
ObjDel();
Comment("");
return(0);
}
//+------------------------------------------------------------------+
//| |
//+------------------------------------------------------------------+
int start()
{
int i,ii;
//ObjDel();
//num=0;
//----
//----
int limit;
int counted_bars=IndicatorCounted();
if(counted_bars>0) counted_bars--;
limit=Bars-counted_bars-2;
//i=0;
for(i=limit; i>0; i--)
////////第一步 算出 最近的高点
if(
Open[i+1]Close[i+2]
&& Low[iLowest(NULL,timeframe,MODE_LOW,4,i+1)]=low_2 )
{
double high_3=High[iHighest(NULL,timeframe,MODE_HIGH,Nzi,time_l2+1)];
int time_h3=iHighest(NULL,timeframe,MODE_HIGH,Nzi,time_l2+1);
if( High[iHighest(NULL,timeframe,MODE_HIGH,5,time_h3+1)]low_05down && low_4=low_4
&& low_25 && (time_h3-time_l2)>5 && (time_l2-high_1)>5 && (time_h1-time_l0)>5
&& (iLowest(NULL,timeframe,MODE_LOW,Nzi,time_h3+1)-iHighest(NULL,timeframe,MODE_HIGH,Nzi,time_l2+1))>5
&& low_2High[iHighest(NULL,timeframe,MODE_HIGH,(time_l4-time_h3),time_h3+1)]
)
{
if(ALERTT==true)
{if(Close[i+1]==Close[1] && Open[i+1]==Open[1] && jilu!=Close[1] )
{jilu=Close[1];
Alert(Period()," 头肩底", Close[1],"!!!");}
}
if(TREND==true)
{
num++;
ObjectCreate("头肩底"+Nzi+"_"+num,OBJ_TREND,0,Time[time_l0],low_0,Time[time_l4],low_4 );
ObjectSet("头肩底"+Nzi+"_"+num, OBJPROP_WIDTH, WidthX);
ObjectSet("头肩底"+Nzi+"_"+num, OBJPROP_STYLE, 2);
ObjectSet("头肩底"+Nzi+"_"+num, OBJPROP_RAY, false);
ObjectSet("头肩底"+Nzi+"_"+num, OBJPROP_BACK, FT);
ObjectSet("头肩底"+Nzi+"_"+num, OBJPROP_COLOR, color_all);
num++;
ObjectCreate("头肩底"+Nzi+"_"+num,OBJ_TREND,0,Time[time_l4],low_4,Time[time_h1],high_1 );
ObjectSet("头肩底"+Nzi+"_"+num, OBJPROP_WIDTH, WidthX);
//ObjectSet("头肩底"+Nzi+"_"+num, OBJPROP_STYLE, 2);
ObjectSet("头肩底"+Nzi+"_"+num, OBJPROP_RAY, true);
ObjectSet("头肩底"+Nzi+"_"+num, OBJPROP_BACK, FT);
ObjectSet("头肩底"+Nzi+"_"+num, OBJPROP_COLOR, color_all);
}
if(TRIANGLE==true)
{
num++;
ObjectCreate("头肩底"+Nzi+"_"+num,OBJ_TRIANGLE,0,Time[i],low_0,Time[time_h1],high_1 ,Time[time_l2],low_2 );
ObjectSet("头肩底"+Nzi+"_"+num, OBJPROP_WIDTH, 1);
ObjectSet("头肩底"+Nzi+"_"+num, OBJPROP_STYLE, 2);
ObjectSet("头肩底"+Nzi+"_"+num, OBJPROP_RAY, false);
ObjectSet("头肩底"+Nzi+"_"+num, OBJPROP_BACK, false);
ObjectSet("头肩底"+Nzi+"_"+num, OBJPROP_COLOR, color_all);
num++;
ObjectCreate("头肩底"+Nzi+"_"+num,OBJ_TRIANGLE,0,Time[time_h3],high_3,Time[time_h1],high_1 ,Time[time_l2],low_2 );
ObjectSet("头肩底"+Nzi+"_"+num, OBJPROP_WIDTH, 1);
ObjectSet("头肩底"+Nzi+"_"+num, OBJPROP_STYLE, 2);
ObjectSet("头肩底"+Nzi+"_"+num, OBJPROP_RAY, false);
ObjectSet("头肩底"+Nzi+"_"+num, OBJPROP_BACK, false);
ObjectSet("头肩底"+Nzi+"_"+num, OBJPROP_COLOR, color_all);
num++;
ObjectCreate("头肩底"+Nzi+"_"+num,OBJ_TRIANGLE,0,Time[time_h3],high_3,Time[time_l4],low_4 ,Time[time_l2],low_2 );
ObjectSet("头肩底"+Nzi+"_"+num, OBJPROP_WIDTH, 1);
ObjectSet("头肩底"+Nzi+"_"+num, OBJPROP_STYLE, 2);
ObjectSet("头肩底"+Nzi+"_"+num, OBJPROP_RAY, false);
ObjectSet("头肩底"+Nzi+"_"+num, OBJPROP_BACK, false);
ObjectSet("头肩底"+Nzi+"_"+num, OBJPROP_COLOR, color_all);
if( ((high_3-low_4)>(low_4-low_2)*3 || (high_1-low_4)>(low_4-low_2)*2 ) //底太小
//&& high_2((high_3+low_2)/2-Low[iLowest(NULL,timeframe,MODE_LOW,255,time_l4+1)])
&& ( high_1(high_3-low_4)*3 ) /// 1:3
)
{
num++;
ObjectCreate("头肩底"+Nzi+"_"+num,OBJ_TRIANGLE,0,Time[i],Open[i],Time[i+7],Open[i]+30*点值*Point ,Time[i],Open[i]+30*点值*Point );
ObjectSet("头肩底"+Nzi+"_"+num, OBJPROP_WIDTH, WidthX);
ObjectSet("头肩底"+Nzi+"_"+num, OBJPROP_RAY, false);
ObjectSet("头肩底"+Nzi+"_"+num, OBJPROP_BACK, true);
ObjectSet("头肩底"+Nzi+"_"+num, OBJPROP_COLOR, DarkOrange);
}
else
{
num++;
ObjectCreate("头肩底"+Nzi+"_"+num,OBJ_TRIANGLE,0,Time[i],Open[i],Time[i+3],Open[i]-30*点值*Point ,Time[i],Open[i]-30*点值*Point );
ObjectSet("头肩底"+Nzi+"_"+num, OBJPROP_WIDTH, WidthX);
ObjectSet("头肩底"+Nzi+"_"+num, OBJPROP_RAY, false);
ObjectSet("头肩底"+Nzi+"_"+num, OBJPROP_BACK, true);
ObjectSet("头肩底"+Nzi+"_"+num, OBJPROP_COLOR, color_all);
}
}
if(止损止盈==true)
{
num++;
ObjectCreate("头肩底"+Nzi+"_"+num,OBJ_TREND,0,Time[i],Open[i]+TP*点值*Point,Time[i]+100*30,Open[i]+TP*点值*Point );
ObjectSet("头肩底"+Nzi+"_"+num, OBJPROP_WIDTH, 1);
ObjectSet("头肩底"+Nzi+"_"+num, OBJPROP_RAY, false);
ObjectSet("头肩底"+Nzi+"_"+num, OBJPROP_BACK, true);
ObjectSet("头肩底"+Nzi+"_"+num, OBJPROP_COLOR, White);
num++;
ObjectCreate("头肩底"+Nzi+"_"+num,OBJ_TREND,0,Time[i],Open[i]+25*点值*Point,Time[i]+100*30,Open[i]+25*点值*Point );
ObjectSet("头肩底"+Nzi+"_"+num, OBJPROP_WIDTH, 1);
ObjectSet("头肩底"+Nzi+"_"+num, OBJPROP_RAY, false);
ObjectSet("头肩底"+Nzi+"_"+num, OBJPROP_BACK, true);
ObjectSet("头肩底"+Nzi+"_"+num, OBJPROP_COLOR, White);
num++;
ObjectCreate("头肩底"+Nzi+"_"+num,OBJ_TREND,0,Time[i],Open[i]+45*点值*Point,Time[i]+100*30,Open[i]+45*点值*Point );
ObjectSet("头肩底"+Nzi+"_"+num, OBJPROP_WIDTH, 3);
ObjectSet("头肩底"+Nzi+"_"+num, OBJPROP_RAY, false);
ObjectSet("头肩底"+Nzi+"_"+num, OBJPROP_BACK, true);
ObjectSet("头肩底"+Nzi+"_"+num, OBJPROP_COLOR, White);
num++;
ObjectCreate("头肩底"+Nzi+"_"+num,OBJ_TREND,0,Time[i],Open[i]-20*点值*Point,Time[i]+100*50,Open[i]-20*点值*Point );
ObjectSet("头肩底"+Nzi+"_"+num, OBJPROP_WIDTH, 3);
ObjectSet("头肩底"+Nzi+"_"+num, OBJPROP_RAY, false);
ObjectSet("头肩底"+Nzi+"_"+num, OBJPROP_BACK, true);
ObjectSet("头肩底"+Nzi+"_"+num, OBJPROP_COLOR, Red);
}
}
}
}
}
}
return(0);
}
//+------------------------------------------------------------------+
void ObjDel()
{
for(;num>=0;num--)
ObjectDelete("头肩底"+Nzi+"_"+num);
}
作者:
daxiooong
时间:
2018-1-11 20:30
//+------------------------------------------------------------------+
//| tjd.mq4 |
//| Copyright ?2005, daxiooong | tjd.mq4 |
//| qq:123991669 |
//+------------------------------------------------------------------+
//+------------------------------------------------------------------+
#property copyright "Copyright ?2005,daxiooong."
//----
#property indicator_chart_window
//----
extern int Nzi=50;
extern int timeframe=0;
extern color color_all=Gold;
extern int 顶底差=20;
extern int TP=82;
extern bool ALERTT=true;
extern bool TREND=true;
extern bool TRIANGLE=true;
extern bool 止损止盈=false;
extern bool FT=false; //false true
extern int WidthX=1;
extern int 点值=1;
//----
color color_all22 ;
int time0;
int num=0;
int MB=1;
string error="D1.";
double jilu;
int duan_0_5,duan_5_10,duan_02,duan_03,duan_06,duan_07;
double High_20,High_60,Close_00,High_All,Low_All,High_F,High_S,Low_Allx1,Low_Allx2,High_All_120p;
double 当天高点,High_127,Low_06,Low_255;
//+------------------------------------------------------------------+
//| |
//+------------------------------------------------------------------+
//+------------------------------------------------------------------+
//| |
//+------------------------------------------------------------------+
int init()
{
if(Period()==43200){time0=2592000;}
else if(Period()==10080){time0=604800;}
else if(Period()==1440){time0=86400;}
else if(Period()==240){time0=14400;}
else if(Period()==60){time0=3600;}
else if(Period()==30){time0=1800;}
else if(Period()==15){time0=900;}
else if(Period()==5){time0=300;}
else if(Period()==1){time0=60;}
else return(0);
return(0);
}
//+------------------------------------------------------------------+
//| |
//+------------------------------------------------------------------+
int deinit()
{
ObjDel();
Comment("");
return(0);
}
//+------------------------------------------------------------------+
//| |
//+------------------------------------------------------------------+
int start()
{
int i,ii;
//ObjDel();
//num=0;
//----
//----
int limit;
int counted_bars=IndicatorCounted();
if(counted_bars>0) counted_bars--;
limit=Bars-counted_bars-2;
//i=0;
for(i=limit; i>0; i--)
////////第一步 算出 最近的高点
if(
( Open[i+1]>Close[i+1] && Open[i+2]Close[i+1] && Open[i+2]==Close[i+2] )
&& High[iHighest(NULL,timeframe,MODE_HIGH,4,i+1)]>=High[iHighest(NULL,timeframe,MODE_HIGH,10,i+1)]
)
{
double high_0=High[iHighest(NULL,timeframe,MODE_HIGH,4,i+1)];
double low_1=Low[iLowest(NULL,timeframe,MODE_LOW,Nzi,i+1)];
int time_h0=iHighest(NULL,timeframe,MODE_HIGH,4,i+1);
int time_l1=iLowest(NULL,timeframe,MODE_LOW,Nzi,i+1);
double high_05up=high_0+(high_0-low_1)*1;
double high_05down=high_0-(high_0-low_1)*1;
if( Low[iLowest(NULL,timeframe,MODE_LOW,5,time_l1)]>=low_1 )
{
double high_2=High[iHighest(NULL,timeframe,MODE_HIGH,Nzi,time_l1)];
int time_h2=iHighest(NULL,timeframe,MODE_HIGH,Nzi,time_l1);
if( High[iHighest(NULL,timeframe,MODE_HIGH,5,time_h2)]high_0 )
{
double low_3=Low[iLowest(NULL,timeframe,MODE_LOW,Nzi,time_h2)];
int time_l3=iLowest(NULL,timeframe,MODE_LOW,Nzi,time_h2);
if(Low[iLowest(NULL,timeframe,MODE_LOW,5,time_l3+1)]>=low_3 )
{
double high_4=High[iHighest(NULL,timeframe,MODE_HIGH,Nzi,time_l3)];
int time_h4=iHighest(NULL,timeframe,MODE_HIGH,Nzi,time_l3);
int time_1_0=time_l1-i;
int time_4_0=time_h4-i;
if( high_4high_05down
&& (time_l1-time_h0) >5 && (time_h4-time_l3)>5 && (time_l3-time_h2)>5 && (time_h2-time_l1)>5
&& high_0>=High[iHighest(NULL,timeframe,MODE_HIGH,time_1_0,i+1)]
//&& High[iHighest(NULL,timeframe,MODE_HIGH,time_4_0,i+1)]=High[iHighest(NULL,timeframe,MODE_HIGH,5,time_h4+1)]
&& low_3High[iHighest(NULL,timeframe,MODE_HIGH,(time_l3-time_h2),time_h2+1)]
&& low_1(high_2-high_4)*3 || (high_2-low_1)>(high_2-high_4)*3 ) //头太小
//&& high_2low_3
)
{
num++;
ObjectCreate("头肩顶"+Nzi+"_"+num,OBJ_TRIANGLE,0,Time[i],Open[i],Time[i+7],Open[i]-15*点值*Point ,Time[i],Open[i]-15*点值*Point );
ObjectSet("头肩顶"+Nzi+"_"+num, OBJPROP_WIDTH, WidthX);
ObjectSet("头肩顶"+Nzi+"_"+num, OBJPROP_RAY, false);
ObjectSet("头肩顶"+Nzi+"_"+num, OBJPROP_BACK, true);
ObjectSet("头肩顶"+Nzi+"_"+num, OBJPROP_COLOR, OrangeRed);
}
else
{
num++;
ObjectCreate("头肩顶"+Nzi+"_"+num,OBJ_TRIANGLE,0,Time[i],Open[i],Time[i+5],Open[i]+15*点值*Point ,Time[i],Open[i]+15*点值*Point );
ObjectSet("头肩顶"+Nzi+"_"+num, OBJPROP_WIDTH, WidthX);
ObjectSet("头肩顶"+Nzi+"_"+num, OBJPROP_RAY, false);
ObjectSet("头肩顶"+Nzi+"_"+num, OBJPROP_BACK, true);
ObjectSet("头肩顶"+Nzi+"_"+num, OBJPROP_COLOR, color_all);
}
}
if(止损止盈==true)
{
num++;
ObjectCreate("头肩顶"+Nzi+"_"+num,OBJ_TREND,0,Time[i],Open[i]+TP*点值*Point,Time[i]+100*30,Open[i]+TP*点值*Point );
ObjectSet("头肩顶"+Nzi+"_"+num, OBJPROP_WIDTH, 1);
ObjectSet("头肩顶"+Nzi+"_"+num, OBJPROP_RAY, false);
ObjectSet("头肩顶"+Nzi+"_"+num, OBJPROP_BACK, true);
ObjectSet("头肩顶"+Nzi+"_"+num, OBJPROP_COLOR, White);
num++;
ObjectCreate("头肩顶"+Nzi+"_"+num,OBJ_TREND,0,Time[i],Open[i]+25*点值*Point,Time[i]+100*30,Open[i]+25*点值*Point );
ObjectSet("头肩顶"+Nzi+"_"+num, OBJPROP_WIDTH, 1);
ObjectSet("头肩顶"+Nzi+"_"+num, OBJPROP_RAY, false);
ObjectSet("头肩顶"+Nzi+"_"+num, OBJPROP_BACK, true);
ObjectSet("头肩顶"+Nzi+"_"+num, OBJPROP_COLOR, White);
num++;
ObjectCreate("头肩顶"+Nzi+"_"+num,OBJ_TREND,0,Time[i],Open[i]+45*点值*Point,Time[i]+100*30,Open[i]+45*点值*Point );
ObjectSet("头肩顶"+Nzi+"_"+num, OBJPROP_WIDTH, 3);
ObjectSet("头肩顶"+Nzi+"_"+num, OBJPROP_RAY, false);
ObjectSet("头肩顶"+Nzi+"_"+num, OBJPROP_BACK, true);
ObjectSet("头肩顶"+Nzi+"_"+num, OBJPROP_COLOR, White);
num++;
ObjectCreate("头肩顶"+Nzi+"_"+num,OBJ_TREND,0,Time[i],Open[i]-20*点值*Point,Time[i]+100*50,Open[i]-20*点值*Point );
ObjectSet("头肩顶"+Nzi+"_"+num, OBJPROP_WIDTH, 3);
ObjectSet("头肩顶"+Nzi+"_"+num, OBJPROP_RAY, false);
ObjectSet("头肩顶"+Nzi+"_"+num, OBJPROP_BACK, true);
ObjectSet("头肩顶"+Nzi+"_"+num, OBJPROP_COLOR, Red);
}
}
}
}
}
}
return(0);
}
//+------------------------------------------------------------------+
void ObjDel()
{
for(;num>=0;num--)
ObjectDelete("头肩顶"+Nzi+"_"+num);
}
作者:
lantianxingkong
时间:
2018-1-11 20:55
谢谢分享
作者:
东方俊
时间:
2018-1-11 21:19
楼主 ,能否写个 三重底 的 指标呢 。
要监控所有的直盘货币对. 5m +15 m
(一个高手 实盘用此法 二周翻了 8倍。)
作者:
djwlchina
时间:
2018-1-11 22:35
什么指标啊,有交易提醒么
作者:
知音人
时间:
2018-1-11 23:41
非常感谢楼主的奉献
作者:
jiuhongzhi
时间:
2018-1-12 01:17
貌似很牛逼的指标
[attach]23393[/attach]
[attach]23393[/attach]
[attach]23393[/attach]
作者:
jiuhongzhi
时间:
2018-1-12 01:23
上两个ex4文件,5xx版的:
作者:
coolguy888
时间:
2018-1-12 02:34
感謝大大無私的分享,下載下來研究看看。
作者:
daxiooong
时间:
2018-1-12 03:35
我上传的是,mq4原文件。。。4楼5楼还有源代码的文字版
作者:
gimin
时间:
2018-1-12 05:11
感謝大大無私的分享
欢迎光临 顺水外汇EA交易网MT4 (http://www.waterforex.com/)
Powered by Discuz! X3.2