交易危机

 找回密码
 快捷注册(禁q号)

QQ登录

只需一步,快速开始

搜索
广告位
查看: 1564|回复: 1

[代码] 双色布林线,上绿下红

[复制链接]

2127

主题

6万

积分

157

精华

大型投行

金钱
61244 美元
权重
640
发表于 2018-8-1 22:14 | 显示全部楼层 |阅读模式
本帖最后由 frlin2003 于 2017-8-18 11:38 编辑





  1. #property indicator_chart_window
  2. #property indicator_buffers 6
  3. #property indicator_color1 Red
  4. #property indicator_color2 Green
  5. #property indicator_color3 Red
  6. #property indicator_color4 Green
  7. #property indicator_color5 Red
  8. #property indicator_color6 Green
  9. int  变色布林=60;
  10. double sha[];
  11. double shaa[];
  12. double zho[];
  13. double zhon[];
  14. double xia[];
  15. double xiaa[];
  16. int init()
  17.    {     
  18.    SetIndexBuffer(0,sha);   
  19.    SetIndexBuffer(1,shaa);
  20.    SetIndexBuffer(2,zho);   
  21.    SetIndexBuffer(3,zhon);
  22.    SetIndexBuffer(4,xia);   
  23.    SetIndexBuffer(5,xiaa);
  24.    SetIndexStyle(0,0,DRAW_LINE,1,Red);   
  25.    SetIndexStyle(1,0,DRAW_LINE,1,Green);
  26.    SetIndexStyle(2,0,DRAW_LINE,1,Red);   
  27.    SetIndexStyle(3,0,DRAW_LINE,1,Green);
  28.    SetIndexStyle(4,0,DRAW_LINE,1,Red);   
  29.    SetIndexStyle(5,0,DRAW_LINE,1,Green);
  30.    SetIndexDrawBegin(0,变色布林);   
  31.    SetIndexDrawBegin(1,变色布林);
  32.    SetIndexDrawBegin(2,变色布林);   
  33.    SetIndexDrawBegin(3,变色布林);
  34.    SetIndexDrawBegin(4,变色布林);   
  35.    SetIndexDrawBegin(5,变色布林);
  36.    IndicatorDigits(Digits);   
  37.    return(0);
  38.    }
  39. int start()
  40.    {     
  41.    double temp0,temp1,temp2,temp3,temp4,temp5;  
  42.    int limit;     
  43.    int counted_bars=IndicatorCounted();   
  44.    if(counted_bars<0) return(-1);     
  45.    if(counted_bars>0) counted_bars--;   
  46.    limit=Bars-counted_bars;   
  47.    for(int i=limit; i>=0; i--)      
  48.    {            
  49.    sha[i]=EMPTY_VALUE;      
  50.    shaa[i]=EMPTY_VALUE;   
  51.    zho[i]=EMPTY_VALUE;      
  52.    zhon[i]=EMPTY_VALUE;   
  53.    xia[i]=EMPTY_VALUE;      
  54.    xiaa[i]=EMPTY_VALUE;   
  55.    temp0=iCustom(NULL,0,"Bands",0,i);      
  56.    temp1=iCustom(NULL,0,"Bands",0,i+1);
  57.    temp2=iCustom(NULL,0,"Bands",1,i);   
  58.    temp3=iCustom(NULL,0,"Bands",1,i+1);
  59.    temp4=iCustom(NULL,0,"Bands",2,i);     
  60.    temp5=iCustom(NULL,0,"Bands",2,i+1);
  61.       
  62.    if(temp0>=temp1)               
  63.    {
  64.    sha[i]=temp0;
  65.    sha[i+1]=temp1;
  66.    zho[i]=temp2;
  67.    zho[i+1]=temp3;
  68.    xia[i]=temp4;
  69.    xia[i+1]=temp5;
  70.    }      
  71.    else  
  72.    {
  73.    shaa[i]=temp0;
  74.    shaa[i+1]=temp1;
  75.    zhon[i]=temp2;
  76.    zhon[i+1]=temp3;
  77.    xiaa[i]=temp4;
  78.    xiaa[i+1]=temp5;
  79.     }      
  80.    }         
  81. return(0);   
  82.    }

复制代码








来源: 双色布林线,上绿下红

4

主题

9227

积分

0

精华

所有交易让市场验证

操盘专家

金钱
9227 美元
权重
8
发表于 2019-1-19 21:50 来自手机 | 显示全部楼层
消灭零回复
您需要登录后才可以回帖 登录 | 快捷注册(禁q号)

本版积分规则

QQ|黄金吧|黄金论坛|手机版|指标下载|非农|目录|交易危机

版权所有: ©2014-2021 fx3q.com Powered by Discuz! X3
浙ICP备: ICP14039028

浙公网安备 33011802001420号

风险提示:杠杆风险高,交易要谨慎 声明:坛友发言和回复均为个人观点,不代表论坛立场。
若有侵权请联系fx3q@qq.com删除

快速回复 返回顶部 返回列表