12评论

1收藏

darma system

avatar admin | 2239 人阅读 | 12 人评论 | 2018-01-18

XAUUSDH1.png

  1. //+------------------------------------------------------------------+
  2. //|                                Darma System Indicator (beta).mq4 |
  3. //|                                                tonyc2a@yahoo.com |
  4. //|                                                                  |
  5. //+------------------------------------------------------------------+

  6. #property copyright "tonyc2a@yahoo.com"
  7. #property link      ""

  8. #property indicator_chart_window
  9. #property indicator_buffers 4

  10. //---- input parameters
  11. extern int WingDings_Symbol = 108;

  12. //---- buffers
  13. double Buffer1[];
  14. double Buffer2[];
  15. double Buffer3[];
  16. double Buffer4[];
  17. double Buffer5[];
  18. double Buffer6[];

  19. //+------------------------------------------------------------------+
  20. //| Custom indicator initialization function                         |
  21. //+------------------------------------------------------------------+
  22. int init()
  23.   {
  24. //---- indicators
  25.    SetIndexStyle(0,DRAW_HISTOGRAM,STYLE_SOLID,2,Blue);
  26.    SetIndexBuffer(0,Buffer1);
  27.    SetIndexLabel(0,"Blue Bar");
  28.    SetIndexStyle(1,DRAW_HISTOGRAM,STYLE_SOLID,2,Red);
  29.    SetIndexBuffer(1,Buffer2);
  30.    SetIndexLabel(1,"Red Bar");
  31.    SetIndexStyle(2,DRAW_ARROW,STYLE_DOT,2,Blue);
  32.    SetIndexBuffer(2,Buffer3);
  33.    SetIndexLabel(2,"Blue Dot");
  34.    SetIndexArrow(2,WingDings_Symbol);
  35.    SetIndexStyle(3,DRAW_ARROW,STYLE_DOT,2,Red);
  36.    SetIndexBuffer(3,Buffer4);
  37.    SetIndexLabel(3,"Red Dot");   
  38.    SetIndexArrow(3,WingDings_Symbol);
  39.    //SetIndexStyle(4,DRAW_SECTION,STYLE_SOLID,1,Blue);
  40.    //SetIndexBuffer(4,Buffer5);
  41.    //SetIndexLabel(4,"Blue");
  42.    //SetIndexStyle(5,DRAW_SECTION,STYLE_SOLID,1,Red);
  43.    //SetIndexBuffer(5,Buffer6);
  44.    //SetIndexLabel(5,"Red");   

  45. //----
  46.    return(0);
  47.   }
  48. //+------------------------------------------------------------------+
  49. //| Custor indicator deinitialization function                       |
  50. //+------------------------------------------------------------------+
  51. int deinit()
  52.   {
  53. //---- TODO: add your code here
  54.    
  55. //----
  56.    return(0);
  57.   }
  58. //+------------------------------------------------------------------+
  59. //| Custom indicator iteration function                              |
  60. //+------------------------------------------------------------------+
  61. int start()
  62.   {
  63.    int    counted_bars=IndicatorCounted();
  64. //---- TODO: add your code here
  65.       int adjustment=0; //change this value to make the indicator behave slightly differently. valid values are 0-4.
  66.       int periods=3;
  67.       int extremes=0;
  68.       double smin, smax, SsMax, SsMin, pivothi, pivotlo, margins;
  69.       bool flag1, flag2;
  70.             
  71.       for(int i=0;i<Bars;i++){
  72.          if(extremes!=0){
  73.             SsMax = High[Highest(NULL,0,MODE_OPEN,periods,i+adjustment)];
  74.             SsMin = Low[Lowest(NULL,0,MODE_OPEN,periods,i+adjustment)];
  75.             }
  76.          else{
  77.             SsMax = Open[Highest(NULL,0,MODE_OPEN,periods,i+adjustment)];
  78.             SsMin = Open[Lowest(NULL,0,MODE_OPEN,periods,i+adjustment)];
  79.             }
  80.          smin = SsMin+(SsMax-SsMin)*margins/100;
  81.               smax = SsMax-(SsMax-SsMin)*margins/100;      
  82.          pivothi=((2*High[i])+Low[i]+(2*Close[i]))/5;
  83.          pivotlo=(High[i]+(2*Low[i])+(2*Close[i]))/5;
  84.          if(pivotlo>smin && pivothi>smax) flag1=true; else flag1=false;
  85.          if(pivothi<smax && pivotlo<smin) flag2=true; else flag2=false;
  86.       
  87.          if(flag1){
  88.             Buffer1[i]=High[i];
  89.             Buffer2[i]=Low[i];
  90.             }
  91.          if(flag2){
  92.             Buffer1[i]=Low[i];
  93.             Buffer2[i]=High[i];
  94.             }
  95.             
  96.          double sig=iSAR(NULL,0,0.5,1,i);
  97.          if(sig<Low[i]) Buffer3[i]=sig;
  98.          if(sig>High[i]) Buffer4[i]=sig;
  99.          
  100.          /*
  101.          double sig2=iSAR(NULL,0,1,0.2,i);
  102.          if(sig2<Low[i]) {Buffer5[i]=sig2; Buffer6[i]=-1;}
  103.          if(sig2>High[i]) {Buffer6[i]=sig2; Buffer5[i]=-1;}
  104.          */
  105.          
  106.          }//end for
  107. //----
  108.    return(0);
  109.   }
  110. //+------------------------------------------------------------------+
复制代码


Darma System Indicator (beta).mq4
""
还没有人打赏,支持一下

评论|共 12 个

烟草味

发表于 2018-3-13 16:40:26 | 显示全部楼层

用试试,看看效果是不是及时

姐就是这么靓

发表于 2020-4-13 17:22:01 | 显示全部楼层

我抢、我抢、我抢沙发~

孤狼(软件高手)

发表于 2020-7-4 20:41:59 | 显示全部楼层

谢谢楼主分享

招财猫

发表于 2020-8-2 15:42:36 | 显示全部楼层

学习了,不错

不爱不恨

发表于 2020-8-6 21:13:53 | 显示全部楼层

谢谢楼主分享

核工记

发表于 2020-8-25 14:32:53 | 显示全部楼层

谢谢楼主分享

fuxiaowei00

发表于 2020-8-28 17:23:39 | 显示全部楼层

谢谢楼主分享

天魔心842

发表于 2020-8-29 11:58:43 | 显示全部楼层

帮你顶下哈!!

狗官烨宝

发表于 2020-9-5 12:04:04 | 显示全部楼层

帮你顶下哈!!

12下一页
您需要登录后才可以回帖 登录 | 注册 微信登录

EA之家评论守则