小男孩‘自慰网亚洲一区二区,亚洲一级在线播放毛片,亚洲中文字幕av每天更新,黄aⅴ永久免费无码,91成人午夜在线精品,色网站免费在线观看,亚洲欧洲wwwww在线观看

分享

【新提醒】 本帖最后由 olwin 于 2010-10-11 12:59 編輯 那位高手幫我看看,如果K線的最高價(jià)格穿過上線,最低價(jià)穿過下線,這個(gè)蠟燭圖就高亮顯示。這個(gè)程序要怎么寫,謝謝!...

 li0k 2017-04-25

  • #property indicator_chart_window
  • #property indicator_buffers 6
  • #property indicator_color1 White
  • #property indicator_color2 Yellow
  • #property indicator_color3 Yellow
  • #property indicator_color4 Yellow
  • #property indicator_color5 Yellow
  • #property indicator_color6 Yellow
  • //---- input parameters
  • extern int BBI_Ma1 = 3;
  • extern int BBI_Ma2 = 6;
  • extern int BBI_Ma3 = 12;
  • extern int BBI_Ma4 = 24;
  • extern int Boll_Ma = 9;
  • extern int Boll_P = 3;
  • extern int Ma_Method = 0;//=0:Simple moving average,=1:Exponential moving average,=2:Smoothed moving average,=3:Linear weighted moving average
  • //---- indicator buffers
  • double up[];
  • double lower[];
  • double BBI[];
  • double Flag[];
  • double BBI_std[];//standard deviation
  • double BBI_av[];//average

  • //+------------------------------------------------------------------+
  • //| Custom indicator initialization function |
  • //+------------------------------------------------------------------+
  • int init()
  • {
  • //---- first positions skipped when drawing
  • SetIndexDrawBegin(0,BBI_Ma4+Boll_Ma*2);
  • SetIndexDrawBegin(1,BBI_Ma4+Boll_Ma*2);
  • SetIndexDrawBegin(2,BBI_Ma4+Boll_Ma*2);
  • SetIndexDrawBegin(3,BBI_Ma4+Boll_Ma*2);
  • //---- 3 indicator buffers mapping
  • SetIndexBuffer(0,BBI);
  • SetIndexBuffer(1,up);
  • SetIndexBuffer(2,lower);
  • SetIndexBuffer(3,Flag);
  • SetIndexBuffer(4,BBI_std);
  • SetIndexBuffer(5,BBI_av);
  • //---- drawing settings
  • SetIndexStyle(0,DRAW_LINE);
  • SetIndexStyle(1,DRAW_LINE);
  • SetIndexStyle(2,DRAW_LINE);
  • SetIndexStyle(3,DRAW_ARROW);
  • SetIndexStyle(4,DRAW_NONE);
  • SetIndexStyle(5,DRAW_NONE);
  • SetIndexArrow(3,108);
  • //---- index labels
  • SetIndexLabel(0,"BBI");
  • SetIndexLabel(1,"BBI UPR");
  • SetIndexLabel(2,"BBI DWR");
  • SetIndexLabel(3,"BBI Flag");
  • IndicatorShortName("BBIboll band");
  • SetIndexEmptyValue(0,0);
  • SetIndexEmptyValue(1,0);
  • SetIndexEmptyValue(2,0);
  • SetIndexEmptyValue(3,0);
  • SetIndexEmptyValue(4,0);
  • SetIndexEmptyValue(5,0);
  • //---- initialization done
  • return(0);
  • }

  • int start()
  • {
  • int limit,i,ii;
  • int counted_bars=IndicatorCounted();
  • double ma1,ma2,ma3,ma4,std;

  • if(Bars<BBI_Ma4+Boll_Ma*2)return(-1);
  • //---- check for possible errors
  • if(counted_bars<0) return(-1);
  • //---- last counted bar will be recounted
  • if(counted_bars>0) counted_bars--;
  • limit=Bars-counted_bars;//+BBI_Ma4+Boll_Ma;
  • //---- main loop
  • while(limit>-1)
  • {
  • ma1 = iMA(NULL,0,BBI_Ma1,0,Ma_Method,PRICE_WEIGHTED,limit);
  • ma2 = iMA(NULL,0,BBI_Ma2,0,Ma_Method,PRICE_WEIGHTED,limit);
  • ma3 = iMA(NULL,0,BBI_Ma3,0,Ma_Method,PRICE_WEIGHTED,limit);
  • ma4 = iMA(NULL,0,BBI_Ma4,0,Ma_Method,PRICE_WEIGHTED,limit);
  • BBI[limit] = 0.25 * (ma1 + ma2 + ma3 + ma4);
  • limit --;
  • }
  • limit=Bars-counted_bars;//+BBI_Ma4+Boll_Ma;
  • while(limit>-1)
  • {
  • BBI_av[limit] = iMAOnArray(BBI,0,Boll_Ma,0,Ma_Method,limit);
  • std = 0;
  • for (i =0;i<Boll_Ma;i++){
  • ii = limit + i;
  • double d = (BBI_av[limit] - BBI[ii]);
  • std += d*d;
  • }
  • BBI_std[limit] = MathSqrt(std/Boll_Ma);
  • up[limit] = BBI[limit] + Boll_P * BBI_std[limit];
  • lower[limit] = BBI[limit] - Boll_P * BBI_std[limit];

  • // std = iStdDevOnArray(BBI,0,Boll_Ma,Ma_Method,0,limit);
  • // up[limit] = BBI[limit] + Boll_P * std;
  • // lower[limit] = BBI[limit] - Boll_P * std;
  • if(up[limit]<High[limit]&&lower[limit]>Low[limit])Flag[limit]=High[limit]+5*Point;
  • limit --;
  • }
  • Comment("BBI: ",BBI[0]," ",up[0]," ",lower[0]);

  • //---- done
  • return(0);
  • }
  • //+------------------------------------------------------------------+
    • 本站是提供個(gè)人知識(shí)管理的網(wǎng)絡(luò)存儲(chǔ)空間,所有內(nèi)容均由用戶發(fā)布,不代表本站觀點(diǎn)。請(qǐng)注意甄別內(nèi)容中的聯(lián)系方式、誘導(dǎo)購(gòu)買等信息,謹(jǐn)防詐騙。如發(fā)現(xiàn)有害或侵權(quán)內(nèi)容,請(qǐng)點(diǎn)擊一鍵舉報(bào)。
      轉(zhuǎn)藏 分享 獻(xiàn)花(0

      0條評(píng)論

      發(fā)表

      請(qǐng)遵守用戶 評(píng)論公約

      類似文章 更多