[MT4指标]某朋友要的LW%R指标
指标是LW%R
//+------------------------------------------------------------------+
//| LW%R.mq4 |
//| Copyright ?2005, MetaQuotes Software Corp. |
//| http://www.metaquotes.net |
//+------------------------------------------------------------------+
#property copyright "Copyright ?2005, MetaQuotes Software Corp."
#property link "http://www.metaquotes.net"
#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 ind_buffer5;
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(7);
SetIndexBuffer(0, ind_buffer3);
SetIndexBuffer(1, ind_buffer4);
SetIndexBuffer(2, ind_buffer1);
SetIndexBuffer(3, ind_buffer2);
SetIndexBuffer(4, HighesBuffer);
SetIndexBuffer(5, LowesBuffer);
SetIndexBuffer(6, ind_buffer5);
//---- 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("LW%R("+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
发表于:2005-06-22 05:12只看该作者
2楼
打手继续出现;P
不过 我刚才看了下 怎么和老哥编写的那个SLOWKD正好是反过来的talkforex-LW%R-BYhawkie.zip
遇到矛盾 先站在对方的立场上想想问题,先试着去理解别人
● 如何使用WinMTR查询平台连接流畅度
3楼
就是反过来的,据要公式的朋友介绍算法说就是和kd反过来的。所以就按照那个编的
发表于:2006-06-21 18:04只看该作者
4楼
谢了,测算准了,再介绍用法
韬客社区www.talkfx.co
发表于:2006-06-22 04:48只看该作者
5楼
谢谢楼主!
韬客社区www.talkfx.co
发表于:2006-06-22 07:15只看该作者
6楼
谢谢分享!
发表于:2006-12-30 01:43只看该作者
7楼
谢谢楼主
韬客社区www.talkfx.co
发表于:2013-10-24 13:23只看该作者
9楼
回复下载
韬客社区www.talkfx.co
发表于:2013-10-29 12:12只看该作者
10楼
EA不论对有经验的交易者还是初学者都起着不可或缺的作用
韬客社区www.talkfx.co
发表于:2016-03-26 09:18只看该作者
11楼
谢谢楼主
韬客社区www.talkfx.co
发表于:2017-08-09 03:48只看该作者
12楼
谢谢朋友分享
韬客社区www.talkfx.co
发表于:2017-08-15 11:17只看该作者
13楼
谢谢分享!
韬客社区www.talkfx.co
14楼
Cccccccccccccccc
韬客社区www.talkfx.co