哪位老师帮助编写一个MT4公式
就是在原来的kdj指标基础上将原来的K值,再进行一次SMA取值,然后将这个SMA过的K值作为“慢速K”值。并且在数值80,20的位置,分别标出上、下轨虚线
只是我的指标是多了个J值。我不懂MT4公式编译,不知道怎么加上去。
在此说声谢谢了。
公式如下:
x:20,COLOR00BF00;
s:80,COLORFFA500;
RSVA:= (CLOSE-LLV(LOW,N))/(HHV(HIGH,N)-LLV(LOW,N))*100;
FASTKA:=SMA(RSVA,M1,1);
K:SMA(FASTKA,M1,1),COLOR0000FF;
D:SMA(K,M1,1),COLOR00FF00;
A:=3*K-2*D;
J:EMA(A,M2);
参数
N 1 100 12
M1 1 100 3
M2 1 100 3
以下是论坛上hawkie
老师编写的慢速kd公式,只是我的指标是多了个J值。不知道怎么加到下面那些代码里,请哪位老师帮助帮助,在此先道声谢谢了 //+------------------------------------------------------------------+ //| SLOWKD.mq4 | //| Copyright ?2005, MetaQuotes Software Corp. | //| | //+------------------------------------------------------------------+ #property copyright "Copyright ?2005, MetaQuotes Software Corp." #property link "" #property indicator_separate_window #property indicator_buffers 2 #property indicator_color1 Silver #property indicator_color2 Yellow //---- input parameters extern int NPeriod=9; extern int KPeriod=3; extern int SKPeriod=3; extern int SDPeriod=3; double ind_buffer1; double ind_buffer2; double ind_buffer3; double ind_buffer4; double HighesBuffer; double LowesBuffer; int draw_begin1=0; int draw_begin2=0; //+------------------------------------------------------------------+ //| expert initialization function | //+------------------------------------------------------------------+ int init() { string short_name; //---- 2 additional buffers are used for counting. IndicatorBuffers(6); SetIndexBuffer(0, ind_buffer3); SetIndexBuffer(1, ind_buffer4); SetIndexBuffer(2, ind_buffer1); SetIndexBuffer(3, ind_buffer2); SetIndexBuffer(4, HighesBuffer); SetIndexBuffer(5, LowesBuffer); //---- indicator lines SetIndexStyle(0,DRAW_LINE); SetIndexBuffer(0, ind_buffer3); SetIndexStyle(1,DRAW_LINE); SetIndexBuffer(1, ind_buffer4); //---- name for DataWindow and indicator subwindow label IndicatorShortName("SLOWKD("+NPeriod+","+KPeriod+","+SKPeriod+","+SDPeriod+")"); SetIndexLabel(0,"K"); SetIndexLabel(1,"D"); //---- draw_begin1=NPeriod+SKPeriod; draw_begin2=draw_begin1+KPeriod; SetIndexDrawBegin(0,draw_begin1); SetIndexDrawBegin(1,draw_begin2); return(0); } //+------------------------------------------------------------------+ //| expert deinitialization function | //+------------------------------------------------------------------+ int start() { int i,k; int counted_bars=IndicatorCounted(); double price; //---- if(Bars<=draw_begin2) return(0); //---- initial zero if(counted_bars<1) { for(i=1;i<=draw_begin1;i++) ind_buffer1[Bars-i]=0; for(i=1;i<=draw_begin2;i++) ind_buffer2[Bars-i]=0; } //---- minimums counting i=Bars-NPeriod; if(counted_bars>NPeriod) i=Bars-counted_bars-1; while(i>=0) { double min=1000000; k=i+NPeriod-1; while(k>=i) { price=Low[k]; if(min>price) min=price; k--; } LowesBuffer=min; i--; } //---- maximums counting i=Bars-NPeriod; if(counted_bars>NPeriod) i=Bars-counted_bars-1; while(i>=0) { double max=-1000000; k=i+NPeriod-1; while(k>=i) { price=High[k]; if(maxdraw_begin1) i=Bars-counted_bars-1;
while(i>=0)
{
double sumlow=0.0;
double sumhigh=0.0;
for(k=(i+SKPeriod-1);k>=i;k--)
{
sumlow+=Close[k]-LowesBuffer[k];
sumhigh+=HighesBuffer[k]-LowesBuffer[k];
}
if(sumhigh==0.0) ind_buffer1=100.0;
else ind_buffer1=sumlow/sumhigh*100;
i--;
}
//---- last counted bar will be recounted
if(counted_bars>0) counted_bars--;
int limit=Bars-counted_bars;
//---- signal line is simple movimg average
for(i=0; i
老师编写的慢速kd公式,只是我的指标是多了个J值。不知道怎么加到下面那些代码里,请哪位老师帮助帮助,在此先道声谢谢了 //+------------------------------------------------------------------+ //| SLOWKD.mq4 | //| Copyright ?2005, MetaQuotes Software Corp. | //| | //+------------------------------------------------------------------+ #property copyright "Copyright ?2005, MetaQuotes Software Corp." #property link "" #property indicator_separate_window #property indicator_buffers 2 #property indicator_color1 Silver #property indicator_color2 Yellow //---- input parameters extern int NPeriod=9; extern int KPeriod=3; extern int SKPeriod=3; extern int SDPeriod=3; double ind_buffer1; double ind_buffer2; double ind_buffer3; double ind_buffer4; double HighesBuffer; double LowesBuffer; int draw_begin1=0; int draw_begin2=0; //+------------------------------------------------------------------+ //| expert initialization function | //+------------------------------------------------------------------+ int init() { string short_name; //---- 2 additional buffers are used for counting. IndicatorBuffers(6); SetIndexBuffer(0, ind_buffer3); SetIndexBuffer(1, ind_buffer4); SetIndexBuffer(2, ind_buffer1); SetIndexBuffer(3, ind_buffer2); SetIndexBuffer(4, HighesBuffer); SetIndexBuffer(5, LowesBuffer); //---- indicator lines SetIndexStyle(0,DRAW_LINE); SetIndexBuffer(0, ind_buffer3); SetIndexStyle(1,DRAW_LINE); SetIndexBuffer(1, ind_buffer4); //---- name for DataWindow and indicator subwindow label IndicatorShortName("SLOWKD("+NPeriod+","+KPeriod+","+SKPeriod+","+SDPeriod+")"); SetIndexLabel(0,"K"); SetIndexLabel(1,"D"); //---- draw_begin1=NPeriod+SKPeriod; draw_begin2=draw_begin1+KPeriod; SetIndexDrawBegin(0,draw_begin1); SetIndexDrawBegin(1,draw_begin2); return(0); } //+------------------------------------------------------------------+ //| expert deinitialization function | //+------------------------------------------------------------------+ int start() { int i,k; int counted_bars=IndicatorCounted(); double price; //---- if(Bars<=draw_begin2) return(0); //---- initial zero if(counted_bars<1) { for(i=1;i<=draw_begin1;i++) ind_buffer1[Bars-i]=0; for(i=1;i<=draw_begin2;i++) ind_buffer2[Bars-i]=0; } //---- minimums counting i=Bars-NPeriod; if(counted_bars>NPeriod) i=Bars-counted_bars-1; while(i>=0) { double min=1000000; k=i+NPeriod-1; while(k>=i) { price=Low[k]; if(min>price) min=price; k--; } LowesBuffer=min; i--; } //---- maximums counting i=Bars-NPeriod; if(counted_bars>NPeriod) i=Bars-counted_bars-1; while(i>=0) { double max=-1000000; k=i+NPeriod-1; while(k>=i) { price=High[k]; if(max
3楼
自己顶一下,哪位高手帮帮我吧。。。
韬客社区www.talkfx.co
4楼
谁能告诉我MT4指标编写应该学什么?
韬客社区www.talkfx.co
发表于:2012-07-18 05:31只看该作者
5楼
可联系我 qq: 357435993
韬客社区www.talkfx.co
发表于:2012-07-20 05:23只看该作者
6楼
MT5 一样吗?
韬客社区www.talkfx.co