kjjjklll 发表于 2014-8-30 20:02:36

[指标] 不知为什么无法显示,麻烦高手看看

//+------------------------------------------------------------------+
//|                                          BoundTheoryCandle.mq4 |
//|                     Copyright ?2008, MetaQuotes Software Corp. |
//|                                 
//+------------------------------------------------------------------+
#property copyright "Copyright 2011, Xilin Lu ( Zhejiang Lanxi )"
//----
#property indicator_chart_window
#property indicator_buffers 4
#property indicator_color1 Blue
#property indicator_color2 Blue
#property indicator_color3 Red
#property indicator_color4 Red
//----
double Up1[], Up2[], Dn1[], Dn2[];
//+------------------------------------------------------------------+
int init() {
//----
SetIndexStyle(0,DRAW_HISTOGRAM, 0, 2);
SetIndexBuffer(0, Up1);
SetIndexStyle(1,DRAW_HISTOGRAM, 0, 2);
SetIndexBuffer(1, Up2);
SetIndexStyle(2,DRAW_HISTOGRAM, 0, 2);
SetIndexBuffer(2, Dn1);
SetIndexStyle(3,DRAW_HISTOGRAM, 0, 2);
SetIndexBuffer(3, Dn2);
//----
SetIndexBuffer(0,Up1);
SetIndexBuffer(1,Up2);
SetIndexBuffer(2,Dn1);
SetIndexBuffer(3,Dn2);
//----
return(0); }
//+------------------------------------------------------------------+
int deinit() {
return(0);
}
//+------------------------------------------------------------------+
int start() {
double ThisHigh, ThisLow, NextHigh, NextLow, BeforeHigh, BeforeLow;
//----
int j,k,i=IndicatorCounted();
if( i<0 ) return(-1);
if( i>0 ) i--;
i = Bars - i;
//----
j=i;
while( i>0 ){
   Up1=0.0;
   Up2=0.0;
   Dn1=0.0;
   Dn2=0.0;
   j--;
}
//------------
while(i>0){
//-----
if( Up1 > 0.0 ) {
BeforeHigh = Up1;
BeforeLow = Up2;

} else {
if( Dn1 > 0.0 ) {
BeforeHigh = Dn1;
BeforeLow = Dn2;
} else {
BeforeHigh = High;
BeforeLow = Low;
}
}
//--
ThisHigh = High;
ThisLow=Low;
NextHigh = High;
NextLow=Low;
j=0;
//---------发生包含
while((ThisHigh>NextHigh && ThisLow<NextLow) || (ThisHigh<NextHigh && ThisLow>NextLow)){
if(i<2){break;}
j++;

//+------------------------------------------------------------------向上
if(ThisHigh>BeforeHigh){
ThisHigh = MathMax(ThisHigh,NextHigh);
ThisLow=MathMax(ThisLow,NextLow);
NextHigh = High;
NextLow=Low;
} else {

//+------------------------------------------------------------------+向下
ThisHigh = MathMin(ThisHigh,NextHigh);
ThisLow=MathMin(ThisLow,NextLow);
NextHigh = High;
NextLow=Low;
}
}

//---
if(j>0){
//向上
if(ThisHigh>BeforeHigh){
for(k=j;k>=0;k--){
Up1=ThisHigh;
Up2=ThisLow;
}
} else {
//向下
for(k=j;k>=0;k--){
Dn1=ThisHigh;
Dn2=ThisLow;
}
}
} else {
//向上
if(ThisHigh>BeforeHigh){
Up1=ThisHigh;
Up2=ThisLow;
} else {
//向下
Dn1=ThisHigh;
Dn2=ThisLow;
}
}
//--
i-=j;
i--;
}


//+------------------------------------------------------------------+

   return(0);
}
//+------------------------------------------------------------------+


ml1437849 发表于 2014-8-30 20:56:36

1111111111

/aiq/猴哥再现 发表于 2014-8-31 00:05:38

点击我 赚金元宝

jiuhongzhi 发表于 2014-8-31 10:33:44

点击我 赚金元宝

zsh6888 发表于 2014-8-31 18:02:12

点击我 赚金元宝

digit 发表于 2014-9-2 00:22:57

:)
这是个禅里个禅,指标重绘:
你知道你的未来不是梦

你认真地过每一分钟

你的未来不是梦

你的心跟着希望在动

guoguangdong 发表于 2014-9-14 11:06:54

点击我 赚金元宝

123aa123 发表于 2014-9-28 21:20:11

路过挣钱

Hx.C 发表于 2015-6-17 22:55:08

今天偶然路过此贴,顺便帮你解决,别嫌晚哦,这就是缘分

hapeacock 发表于 2017-5-18 23:57:17


BoundTheoryCandle.mq4

hapeacock 发表于 2017-5-18 23:58:47

我擦。左边那个是空白的
页: [1]
查看完整版本: [指标] 不知为什么无法显示,麻烦高手看看