📅 财经日历 📊 实时波动 📈 大盘云图 📶 行情走势 🆚 投机情绪 🚀 今日热点

    RSI

    2016-04-22 · 7414 阅读
    EURUSDM30.png


    1. //+------------------------------------------------------------------+
    2. //| 10 Minute trader                                                 |
    3. //+------------------------------------------------------------------+
    4. #property copyright "Ron T"
    5. #property link      "http://www.lightpatch.com"

    6. #property indicator_chart_window
    7. #property indicator_buffers 5
    8. #property indicator_color1 White
    9. #property indicator_color2 Red
    10. #property indicator_color3 Aqua
    11. #property indicator_color4 Blue
    12. #property indicator_color5 LimeGreen

    13. //---- buffers
    14. double ExtMapBuffer1[];
    15. double ExtMapBuffer2[];
    16. double ExtMapBuffer3[];
    17. double ExtMapBuffer4[];
    18. double ExtMapBuffer5[];


    19. // User Input


    20. //+------------------------------------------------------------------+
    21. //| Custom indicator initialization function                         |
    22. //|------------------------------------------------------------------|

    23. int init()
    24.   {

    25.    // 233 up arrow
    26.    // 234 down arrow
    27.    // 159 big dot
    28.    // 168 open square
    29.    
    30.    SetIndexStyle(0,DRAW_ARROW);
    31.    SetIndexBuffer(0, ExtMapBuffer1);
    32.    SetIndexArrow(0,233);  //up
    33.    
    34.    SetIndexStyle(1,DRAW_ARROW);
    35.    SetIndexBuffer(1, ExtMapBuffer2);
    36.    SetIndexArrow(1,234);  //down

    37.    SetIndexStyle(2,DRAW_ARROW);
    38.    SetIndexBuffer(2, ExtMapBuffer3);
    39.    SetIndexArrow(2,168);

    40.    SetIndexStyle(3,DRAW_ARROW);
    41.    SetIndexBuffer(3, ExtMapBuffer4);
    42.    SetIndexArrow(3,168);

    43.    SetIndexStyle(4,DRAW_ARROW);
    44.    SetIndexBuffer(4, ExtMapBuffer5);
    45.    SetIndexArrow(4,168);  //open square

    46.    return(0);
    47.   }


    48. //+------------------------------------------------------------------+
    49. //| Custor indicator deinitialization function                       |
    50. //+------------------------------------------------------------------+
    51. int deinit()
    52.   {
    53.    int i;
    54.    
    55.    for( i=0; i<Bars; i++ ) ExtMapBuffer1[i]=0;
    56.    for( i=0; i<Bars; i++ ) ExtMapBuffer2[i]=0;
    57.    for( i=0; i<Bars; i++ ) ExtMapBuffer3[i]=0;
    58.    for( i=0; i<Bars; i++ ) ExtMapBuffer4[i]=0;
    59.    for( i=0; i<Bars; i++ ) ExtMapBuffer5[i]=0;

    60.    return(0);
    61.   }


    62. //+------------------------------------------------------------------+
    63. //| Custom indicator iteration function                              |
    64. //+------------------------------------------------------------------+
    65. int start()
    66.   {
    67.    double   rsi0=0;
    68.    double   rsi1=0;
    69.    double   rsi2=0;
    70.    double   rsi3=0;
    71.    double   rsi4=0;
    72.    double   rsi5=0;
    73.    double   rsi6=0;
    74.    double   rsi7=0;
    75.      
    76.    int pos=Bars-100;             // leave room for moving average periods
    77.       
    78.    while(pos>=0)
    79.      {
    80.       rsi0=iRSI(Symbol(),0,28,PRICE_CLOSE,pos+0);
    81.       rsi1=iRSI(Symbol(),0,28,PRICE_CLOSE,pos+1);
    82.       rsi2=iRSI(Symbol(),0,28,PRICE_CLOSE,pos+2);
    83.       rsi3=iRSI(Symbol(),0,28,PRICE_CLOSE,pos+3);
    84.       rsi4=iRSI(Symbol(),0,28,PRICE_CLOSE,pos+4);
    85.       rsi5=iRSI(Symbol(),0,28,PRICE_CLOSE,pos+5);
    86.       rsi6=iRSI(Symbol(),0,28,PRICE_CLOSE,pos+6);
    87.       rsi7=iRSI(Symbol(),0,28,PRICE_CLOSE,pos+7);
    88.      

    89.       if (rsi0>rsi1 && rsi1>rsi2 && rsi2>rsi3 && rsi3>rsi4 && rsi4>rsi5)
    90.         {
    91.          ExtMapBuffer1[pos]=High[pos];
    92.         }

    93.       if (rsi0<rsi1 && rsi1<rsi2 && rsi2<rsi3 && rsi3<rsi4 && rsi4<rsi5)
    94.         {
    95.          ExtMapBuffer2[pos]=Low[pos];
    96.         }

    97.            pos--;
    98.      }

    99.    return(0);
    100.   }
    101. //+------------------------------------------------------------------+
    复制代码


    2rsi-01.zip
    ""
    还没有人打赏,支持一下
    回复

    举报

     

    回答|共 9 个

    zx5zx LV3

    发表于 2017-10-1 11:02:54 | 显示全部楼层

    gooddddddddddddddd

    金裕良言 LV3

    发表于 2020-7-25 14:03:54 | 显示全部楼层

    学习了,不错

    ipwzlbw772 LV4

    发表于 2020-7-31 10:52:56 | 显示全部楼层

    谢谢楼主分享

    hate LV6

    发表于 2020-8-28 12:25:37 | 显示全部楼层

    学习了,不错

    qinglifu2 LV3

    发表于 2021-7-11 22:58:30 | 显示全部楼层

    支持下

    爱后余生 LV3

    发表于 2021-7-14 10:41:48 | 显示全部楼层

    支持下

    372518112 LV3

    发表于 2021-8-9 11:58:34 | 显示全部楼层

    谢谢

    令狐冲 LV3

    发表于 2023-9-17 17:06:35 | 显示全部楼层

    支持下

    绝对诚哥 LV1

    发表于 2026-3-22 20:49:59 | 显示全部楼层

    顶下
    您需要登录后才可以回帖 登录 | 注册

    提醒: 禁止引战、谩骂、灌水内容

    微信二维码

    有问题联系客服