9评论

2收藏

Brooky_Rsi_Ichimoku_V2

avatar admin | 2292 人阅读 | 9 人评论 | 2018-01-19

GBPUSDH1.png

  1. //+------------------------------------------------------------------+
  2. //|                                       Brooky_Rsi_Ichimoku_V2.mq4 |
  3. //|                      Copyright ?2004, MetaQuotes Software Corp. |
  4. //|                                       http://www.metaquotes.net/ |
  5. //+------------------------------------------------------------------+
  6. #property copyright "Copyright ?2004, MetaQuotes Software Corp."
  7. #property link      "http://www.metaquotes.net/"

  8. #property indicator_separate_window
  9. #property indicator_buffers 8

  10. #property indicator_color1 Blue
  11. #property indicator_color2 Red
  12. #property indicator_color3 C'241,139,56'
  13. #property indicator_color4 Thistle
  14. #property indicator_color5 Lime
  15. #property indicator_color6 C'241,139,56'
  16. #property indicator_color7 Thistle
  17. #property indicator_color8 C'82,82,82'

  18. #property indicator_width1 3
  19. #property indicator_width2 3
  20. #property indicator_width5 3



  21. #property indicator_level1 50
  22. #property indicator_level2 30
  23. #property indicator_level3 70

  24. //--auto color
  25. #import "user32.dll"
  26.    int GetDC(int hwnd);
  27.    int ReleaseDC(int hwnd,int hdc);
  28. #import "gdi32.dll"
  29.    color GetPixel(int hdc,int x,int y);

  30. //---- input parameters
  31. extern string Author_Site = "www.Brooky-Indicators.com";
  32. extern string NOTE  = "+--DLL Must Be Allowed--+";
  33. extern string NOTE2 = "+--For Auto Clear Backgound--+";
  34. extern int Tenkan=9;
  35. extern int Kijun=26;
  36. extern int Senkou=52;
  37. extern string RSI_Period =" Set RSI Period Below";
  38. extern int Rsip  =14;
  39. extern string Cloud_Style ="2 for Dots : 0 for Line";
  40. extern int CL_Style  =0;
  41. //---- buffers
  42. double Tenkan_Buffer[];
  43. double Kijun_Buffer[];
  44. double SpanA_Buffer[];
  45. double SpanB_Buffer[];
  46. double Chinkou_Buffer[];
  47. double SpanA2_Buffer[];
  48. double SpanB2_Buffer[];
  49. double Fill_Buffer[];
  50. //----
  51. int a_begin;
  52. //+------------------------------------------------------------------+
  53. //| Custom indicator initialization function                         |
  54. //+------------------------------------------------------------------+
  55. int init()
  56.   {
  57. //----
  58.    IndicatorShortName("Brooky-Indicators.com RSI Ichimoku ("+Rsip);
  59.    SetIndexStyle(0,DRAW_LINE);
  60.    SetIndexBuffer(0,Tenkan_Buffer);
  61.    SetIndexDrawBegin(0,Tenkan-1);
  62.    SetIndexLabel(0,"Tenkan Sen");
  63. //----
  64.    SetIndexStyle(1,DRAW_LINE);
  65.    SetIndexBuffer(1,Kijun_Buffer);
  66.    SetIndexDrawBegin(1,Kijun-1);
  67.    SetIndexLabel(1,"Kijun Sen");
  68. //----
  69.    a_begin=Kijun; if(a_begin<Tenkan) a_begin=Tenkan;
  70.    SetIndexStyle(2,DRAW_HISTOGRAM,CL_Style);
  71.    SetIndexBuffer(2,SpanA_Buffer);
  72.    SetIndexDrawBegin(2,Kijun+a_begin-1);
  73.    SetIndexShift(2,Kijun);
  74.    SetIndexLabel(2,NULL);
  75.    
  76.    SetIndexStyle(5,DRAW_LINE,CL_Style);
  77.    SetIndexBuffer(5,SpanA2_Buffer);
  78.    SetIndexDrawBegin(5,Kijun+a_begin-1);
  79.    SetIndexShift(5,Kijun);
  80.    SetIndexLabel(5,"Senkou Span A");
  81. //----
  82.   SetIndexStyle(3,DRAW_HISTOGRAM,CL_Style);
  83.    SetIndexBuffer(3,SpanB_Buffer);
  84.    SetIndexDrawBegin(3,Kijun+Senkou-1);
  85.    SetIndexShift(3,Kijun);
  86.    SetIndexLabel(3,NULL);
  87.    
  88.    SetIndexStyle(6,DRAW_LINE,CL_Style);
  89.    SetIndexBuffer(6,SpanB2_Buffer);
  90.    SetIndexDrawBegin(6,Kijun+Senkou-1);
  91.    SetIndexShift(6,Kijun);
  92.    SetIndexLabel(6,"Senkou Span B");

  93. //----
  94.    SetIndexStyle(4,DRAW_LINE);
  95.    SetIndexBuffer(4,Chinkou_Buffer);
  96.    SetIndexShift(4,-Kijun);
  97.    SetIndexLabel(4,"Chinkou Span");
  98.    
  99.    //SetIndexStyle(7,DRAW_HISTOGRAM);
  100.    SetIndexBuffer(7,Fill_Buffer);
  101.    SetIndexDrawBegin(7,Kijun+Senkou-1);
  102.    SetIndexShift(7,Kijun);
  103.    
  104. //----
  105.    return(0);
  106.   }
  107. //+------------------------------------------------------------------+
  108. //| Ichimoku Kinko Hyo on RSI                                        |
  109. //+------------------------------------------------------------------+
  110. int start()
  111.   {
  112.    int hwnd=WindowHandle(Symbol(),Period());
  113.    int hdc=GetDC(hwnd);
  114.    color back_ground=GetPixel(hdc,1,2);
  115.    ReleaseDC(hwnd,hdc);
  116.    SetIndexStyle(7,DRAW_HISTOGRAM,0,EMPTY,back_ground);
  117.    
  118.    
  119.    int    i,k;
  120.    int    counted_bars=IndicatorCounted();
  121.    double high,low,price;
  122. //----
  123.    if(Bars<=Tenkan || Bars<=Kijun || Bars<=Senkou) return(0);
  124. //---- initial zero
  125.    if(counted_bars<1)
  126.      {
  127.       for(i=1;i<=Tenkan;i++)    Tenkan_Buffer[Bars-i]=0;
  128.       for(i=1;i<=Kijun;i++)     Kijun_Buffer[Bars-i]=0;
  129.       for(i=1;i<=a_begin;i++) { SpanA_Buffer[Bars-i]=0; SpanA2_Buffer[Bars-i]=0; }
  130.       for(i=1;i<=Senkou;i++)  { SpanB_Buffer[Bars-i]=0; SpanB2_Buffer[Bars-i]=0; }
  131.      }
  132. //---- Tenkan Sen
  133.    i=Bars-Tenkan;
  134.    if(counted_bars>Tenkan) i=Bars-counted_bars-1;
  135.    while(i>=0)
  136.      {
  137.          high=iRSI(NULL,0,Rsip,PRICE_HIGH,i);
  138.          low=iRSI(NULL,0,Rsip,PRICE_LOW,i); k=i-1+Tenkan;
  139.       while(k>=i)
  140.         {
  141.          price=iRSI(NULL,0,Rsip,PRICE_HIGH,k);
  142.          if(high<price) high=price;
  143.          price=iRSI(NULL,0,Rsip,PRICE_LOW,k);
  144.          if(low>price)  low=price;
  145.          k--;
  146.         }
  147.       Tenkan_Buffer[i]=(high+low)/2;
  148.       i--;
  149.      }
  150. //---- Kijun Sen
  151.    i=Bars-Kijun;
  152.    if(counted_bars>Kijun) i=Bars-counted_bars-1;
  153.    while(i>=0)
  154.      {
  155.          high=iRSI(NULL,0,Rsip,PRICE_HIGH,i);
  156.          low=iRSI(NULL,0,Rsip,PRICE_LOW,i); k=i-1+Kijun;
  157.       while(k>=i)
  158.         {
  159.          price=iRSI(NULL,0,Rsip,PRICE_HIGH,k);
  160.          if(high<price) high=price;
  161.          price=iRSI(NULL,0,Rsip,PRICE_LOW,k);
  162.          if(low>price)  low=price;
  163.          k--;
  164.         }
  165.       Kijun_Buffer[i]=(high+low)/2;
  166.       i--;
  167.      }
  168. //---- Senkou Span A
  169.    i=Bars-a_begin+1;
  170.    if(counted_bars>a_begin-1) i=Bars-counted_bars-1;
  171.    while(i>=0)
  172.      {
  173.       price=(Kijun_Buffer[i]+Tenkan_Buffer[i])/2;
  174.       SpanA_Buffer[i]=price;
  175.       SpanA2_Buffer[i]=price;
  176.       i--;
  177.      }
  178. //---- Senkou Span B
  179.    i=Bars-Senkou;
  180.    if(counted_bars>Senkou) i=Bars-counted_bars-1;
  181.    while(i>=0)
  182.      {
  183.       high=iRSI(NULL,0,Rsip,PRICE_HIGH,i);
  184.       low=iRSI(NULL,0,Rsip,PRICE_LOW,i);k=i-1+Senkou;
  185.       while(k>=i)
  186.         {
  187.          price=iRSI(NULL,0,Rsip,PRICE_HIGH,k);
  188.          if(high<price) high=price;
  189.          price=iRSI(NULL,0,Rsip,PRICE_LOW,k);
  190.          if(low>price)  low=price;
  191.          k--;
  192.         }
  193.       price=(high+low)/2;
  194.       SpanB_Buffer[i]=price;
  195.       SpanB2_Buffer[i]=price;
  196.          if(SpanA_Buffer[i]<=SpanB_Buffer[i])
  197.          {
  198.          Fill_Buffer[i]=SpanA_Buffer[i];
  199.          }
  200.         if(SpanA_Buffer[i]>SpanB_Buffer[i])
  201.          {
  202.          Fill_Buffer[i]=SpanB_Buffer[i];
  203.          }
  204.       i--;
  205.      }
  206. //---- Chinkou Span
  207.    i=Bars-1;
  208.    if(counted_bars>1) i=Bars-counted_bars-1;
  209.    while(i>=0) { Chinkou_Buffer[i]=iRSI(NULL,0,Rsip,PRICE_CLOSE,i); i--; }
  210. //----
  211.    return(0);
  212.   }
  213. //+------------------------------------------------------------------+
复制代码


Brooky_Rsi_Ichimoku_V2.mq4
""
还没有人打赏,支持一下

评论|共 9 个

夜班屌凶

发表于 2020-1-17 16:31:56 | 显示全部楼层

相当不错,感谢无私分享精神!

2357186528

发表于 2020-1-17 18:29:32 | 显示全部楼层

感谢无私分享精神

靖雨仇

发表于 2020-7-6 16:27:29 | 显示全部楼层

谢谢楼主分享

石冰心

发表于 2020-7-12 16:21:40 | 显示全部楼层

谢谢楼主分享

ttofx

发表于 2020-7-17 20:35:03 | 显示全部楼层

谢谢楼主分享

susan

发表于 2020-7-31 13:17:18 | 显示全部楼层

帮你顶下哈!!

628719

发表于 2020-8-1 11:39:08 | 显示全部楼层

谢谢楼主分享

QQ1554830979

发表于 2020-8-29 12:03:47 | 显示全部楼层

谢谢楼主分享

zhangnan78

发表于 2021-8-10 12:50:03 | 显示全部楼层

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

EA之家评论守则