王汪旺 发表于 2014-2-13 08:39:21

用起来顺手的指标源码

/*
*********************************************************************

                      Bollinger Squeeze v8
                  Original code by Nick Bilak
                   Modifications by Akuma99
                   Copyright ?2006-07Akuma99
                  http://www.beginnertrader.com

       For help on this indicator, tutorials and information
               visit http://www.beginnertrader.com

*********************************************************************
*/

#property copyright "Copyright ?2006-07, Akuma99"
#property link      "http://www.beginnertrader.com "

#property indicator_separate_window
#property indicator_buffers 3
#property indicator_color1 Green //uptrend
#property indicator_width1 2
#property indicator_color2 IndianRed//downtrend
#property indicator_width2 2
#property indicator_color3 DarkGreen // First Stochastic line
#property indicator_width3 2


extern string note1 = "First Stochastic";
extern int    StochPeriod1=14;
extern int    DPeriod1=3;
extern int    SlowingPeriod1=3;

double upB[];
double loB[];
double Stoch1[];
//+------------------------------------------------------------------+
int init() {

   IndicatorBuffers(3);

   SetIndexStyle(0,DRAW_HISTOGRAM,STYLE_SOLID,indicator_width1,indicator_color1);
   SetIndexBuffer(0,upB);
   SetIndexEmptyValue(0,EMPTY_VALUE);

   SetIndexStyle(1,DRAW_HISTOGRAM,STYLE_SOLID,indicator_width2,indicator_color2); //downtrend
   SetIndexBuffer(1,loB);
   SetIndexEmptyValue(1,EMPTY_VALUE);

   SetIndexStyle(2,DRAW_LINE);
   SetIndexBuffer(2,Stoch1);
   return(0);
}
//+------------------------------------------------------------------+
int deinit() {


}
//+------------------------------------------------------------------+
int start() {

   int counted_bars=IndicatorCounted();
   int shift,limit;

   IndicatorShortName("Stoch Histogram ("+StochPeriod1+","+DPeriod1+","+SlowingPeriod1+")");
   if (counted_bars<0) return(-1);
   if (counted_bars>0) counted_bars--;

   limit=Bars-31;
   if(counted_bars>=31) limit=Bars-counted_bars-1;

   for (shift=limit;shift>=0;shift--)   {

      Stoch1=iStochastic(NULL,0,StochPeriod1,DPeriod1,SlowingPeriod1,MODE_SMA,0,MODE_MAIN,shift)-50;      

      if(Stoch1>0) {

         upB=Stoch1;

      } else if (Stoch1<0){

         loB=Stoch1;

      }
   }

   return(0);

}
//+------------------------------------------------------------------+


TIAN2825538 发表于 2014-9-11 00:27:16


谢谢分享了

TIAN2825538 发表于 2014-9-11 00:27:19


谢谢分享了

houz 发表于 2014-11-6 10:47:24

下了的确不错

含哥点金 发表于 2015-1-21 11:25:46

谢谢分享!!!!!

绿豆宝贝 发表于 2015-1-23 10:21:32

顶楼主~~~~~~~~~~~~~~~

158569973 发表于 2015-1-28 00:53:48

研究研究

fjsmlj 发表于 2015-1-28 01:22:27

看看,看看。谢谢。你要发,我也要发。

sun001002003 发表于 2015-1-28 05:36:58

Bollinger Squeeze v8

2010c 发表于 2015-1-28 05:48:12

forexfactory.com/showthread.php?p=4207554
页: [1] 2 3 4
查看完整版本: 用起来顺手的指标源码