发表于:2008-10-07 15:17只看该作者
4楼
#property indicator_chart_window
#property indicator_buffers 6
#property indicator_color1 Red
#property indicator_color2 Green
#property indicator_color3 Red
#property indicator_color4 Green
#property indicator_color5 Black
#property indicator_color6 Black
extern int period_1=21;
extern int period_2=7;
double post1;
double post2;
double acus1;
double acus2;
double HighBuffer;
double LowBuffer;
void init() {
SetIndexBuffer(0, post1);
SetIndexBuffer(1, post2);
SetIndexBuffer(2, acus1);
SetIndexBuffer(3, acus2);
SetIndexBuffer(4, HighBuffer);
SetIndexBuffer(5, LowBuffer);
SetIndexStyle(0,DRAW_HISTOGRAM,STYLE_SOLID,3);
SetIndexStyle(1,DRAW_HISTOGRAM,STYLE_SOLID,3);
SetIndexStyle(2,DRAW_HISTOGRAM,STYLE_SOLID,0);
SetIndexStyle(3,DRAW_HISTOGRAM,STYLE_SOLID,0);
}
void start() {
int limit;
int counted_bars=IndicatorCounted();
if(counted_bars>0) counted_bars--;
limit=Bars-counted_bars;
for(int t=0; t0.1*Point){
post1[t]=MathMin(Open[t],Close[t]);
post2[t]=MathMax(Open[t],Close[t]);
acus1[t]=Low[t];
acus2[t]=High[t];
if (Open[t]==Close[t]) post1[t]=Close[t]-0.01*Point;
}
if(temp<0.1*Point){
post1[t]=MathMax(Open[t],Close[t]);
post2[t]=MathMin(Open[t],Close[t]);
acus1[t]=High[t];
acus2[t]=Low[t];
if (Open[t]==Close[t]) post2[t]=Close[t]-0.01*Point;
}
}
}
发表于:2008-10-07 15:30只看该作者
5楼
将压缩文件解压,把解压后的mq4文件放入以下目录,重启MT4即可调用
[ 本帖最后由 秃鹫 于 2008-10-7 23:38 编辑 ]重画K线指标源码.rar
bcml.gif

发表于:2008-10-07 15:47只看该作者
6楼
由于使用本指标需要把原有K线隐藏,所以需要在图表属性中把所有颜色都设为None,就象下面这样
sx.gif

顺势
发表于:2008-10-07 15:56只看该作者
7楼
为避免原有K线对新画K线产生干扰,还必须把“图表”菜单中的“图表置前景”去勾
发表于:2008-10-07 16:01只看该作者
8楼
最后的效果是这样的
xg.gif

顺势
发表于:2008-10-07 16:09只看该作者
9楼
关于报警的问题应该不复杂吧,有兴趣的朋友可以自己修改
发表于:2008-10-07 23:13只看该作者
11楼
#property indicator_chart_window
#property indicator_buffers 6
#property indicator_color1 Red
#property indicator_color2 Green
#property indicator_color3 Red
#property indicator_color4 Green
extern int period_1=21;
extern int period_2=7;
double post1;
double post2;
double acus1;
double acus2;
double HighBuffer;
double LowBuffer;
datetime pretime=0;
void init() {
SetIndexBuffer(0, post1);
SetIndexBuffer(1, post2);
SetIndexBuffer(2, acus1);
SetIndexBuffer(3, acus2);
SetIndexBuffer(4, HighBuffer);
SetIndexBuffer(5, LowBuffer);
SetIndexStyle(0,DRAW_HISTOGRAM,STYLE_SOLID,3);
SetIndexStyle(1,DRAW_HISTOGRAM,STYLE_SOLID,3);
SetIndexStyle(2,DRAW_HISTOGRAM,STYLE_SOLID,0);
SetIndexStyle(3,DRAW_HISTOGRAM,STYLE_SOLID,0);
SetIndexStyle(4,DRAW_NONE);
SetIndexStyle(5,DRAW_NONE);
}
void start() {
int limit;
int counted_bars=IndicatorCounted();
if(counted_bars>0) counted_bars--;
limit=Bars-counted_bars;
for(int t=0; t0.1*Point){
post1[t]=MathMin(Open[t],Close[t]);
post2[t]=MathMax(Open[t],Close[t]);
acus1[t]=Low[t];
acus2[t]=High[t];
if (Open[t]==Close[t]) post1[t]=Close[t]-0.01*Point;
}
if(temp<0.1*Point){
post1[t]=MathMax(Open[t],Close[t]);
post2[t]=MathMin(Open[t],Close[t]);
acus1[t]=High[t];
acus2[t]=Low[t];
if (Open[t]==Close[t]) post2[t]=Close[t]-0.01*Point;
}
if(Time[0]>pretime) {
if(acus1[0]>acus2[0] && acus1[1]acus2[1]) {Alert(Symbol(),Period(),"转阴");pretime=Time[0];}
}
}
}
发表于:2008-10-08 05:17只看该作者
13楼
谢谢秃鹫大哥,努力学习,同时也要感谢fycfw提供的思路~~~~~
韬客社区www.talkfx.co
发表于:2008-10-08 09:52只看该作者
14楼
谢谢秃鹫老大,别的指标加不上鸟
发表于:2008-10-08 15:00只看该作者
15楼
秃鹫老大,怎么用呀
韬客社区www.talkfx.co
发表于:2008-10-08 15:06只看该作者
16楼
将压缩文件解压,把解压后的mq4文件放入以下目录,重启MT4即可调用 要怎么调用呀,找不到呀,一片黑屏呀,,急!!!!!!!!!!!!!!!!
韬客社区www.talkfx.co
发表于:2008-10-08 23:12只看该作者
17楼
加载自定义指标方法。前提是mq4或者EX4文件已经放入本贴5楼所说的目录中(不能是该目录下的子目录里),注意文件名后缀是.mq4或.EX4的文件
[ 本帖最后由 秃鹫 于 2008-10-9 07:19 编辑 ]
zdyzb.gif

发表于:2008-10-09 00:06只看该作者
18楼
秃鹰老师,这是个不错的指标,可否改成副图也可以使用啊!谢谢您!
韬客社区www.talkfx.co
发表于:2008-10-09 01:20只看该作者
19楼
秃鹰老师,谢谢了,找到了,是很不错,能否告知用在多少时间的图表上呀!配合什么指标好过滤呀
发表于:2008-10-09 02:08只看该作者
20楼
秃鹰老师,这是个不错的指标,如果改成副图也可以使用,可以指定货币对和指定周期就好了!
韬客社区www.talkfx.co