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

    SGMAR

    2016-05-19 · 6990 阅读
    sgmar.png


    1. //+------------------------------------------------------------------+
    2. //|                                                                  |
    3. //|                 Copyright ?1999-2008, MetaQuotes Software Corp. |
    4. //|                                         http://www.metaquotes.ru |
    5. //+------------------------------------------------------------------+
    6. #property indicator_separate_window
    7. #property indicator_buffers 5
    8. //----
    9. #property indicator_color1 Lime
    10. #property indicator_color2 Aqua
    11. #property indicator_color3 Red
    12. #property indicator_color4 DarkTurquoise
    13. #property indicator_color5 Red
    14. //----
    15. #property indicator_level1 70
    16. #property indicator_level2 50
    17. #property indicator_level3 30
    18. #property indicator_levelcolor Gray
    19. #property indicator_levelwidth 1
    20. #property indicator_levelstyle STYLE_DASH
    21. //----
    22. extern int    Rsi  =14;
    23. extern int    Ma  =8;
    24. extern int    cbars  =0;
    25. //----
    26. double RsiBuf[];
    27. double MaP[];
    28. double MaF[];
    29. double Up[];
    30. double Dn[];
    31. //+------------------------------------------------------------------+
    32. //|                                                                  |
    33. //+------------------------------------------------------------------+
    34.   void init()
    35.   {
    36.    SetIndexStyle (0, DRAW_LINE,0, 2);
    37.    SetIndexStyle (1, DRAW_LINE,0,2);
    38.    SetIndexStyle (2, DRAW_LINE,0,2);
    39.    SetIndexStyle (3, DRAW_ARROW);
    40.    SetIndexStyle (4, DRAW_ARROW);
    41.    SetIndexBuffer(0, RsiBuf);
    42.    SetIndexBuffer(1, MaP);
    43.    SetIndexBuffer(2, MaF);
    44.    SetIndexBuffer(3, Up);
    45.    SetIndexBuffer(4, Dn);
    46.    SetIndexEmptyValue(3,0);
    47.    SetIndexEmptyValue(4,0);
    48.    SetIndexArrow(3,108);
    49.    SetIndexArrow(4,108);
    50.   }
    51. //+------------------------------------------------------------------+
    52. //|                                                                  |
    53. //+------------------------------------------------------------------+
    54.   void deinit()
    55.   {}
    56. //+------------------------------------------------------------------+
    57. //|                                                                  |
    58. //+------------------------------------------------------------------+
    59.   int start()
    60.   {
    61.    int shift,limit=cbars;
    62.    if(limit==0) limit=Bars;
    63.      for(shift=limit-1; shift>=0; shift--)
    64.      {
    65.       RsiBuf[shift]=iRSI(NULL,0,Rsi,PRICE_CLOSE,shift);
    66.      }
    67.      for(shift=limit-1; shift>=0; shift--)
    68.      {
    69.       // First Indicator Data
    70.       MaF[shift]=iMAOnArray(RsiBuf,0,Ma,0,MODE_SMA,shift);
    71.       // Previous Indicator Data
    72.       MaP[shift]=iMAOnArray(RsiBuf,0,Ma,0,MODE_EMA,shift);
    73.         if((MaF[shift]-MaP[shift])*(MaF[shift+1]-MaP[shift+1])<0)
    74.         {
    75.          if(MaF[shift]-MaP[shift]<0) Up[shift]=MaP[shift];
    76.          else Dn[shift]=MaF[shift];
    77.         }
    78.      }
    79.   }
    80. //+------------------------------------------------------------------+
    复制代码


    ""
    还没有人打赏,支持一下
    回复

    举报

     

    回答|共 9 个

    凯民 LV5

    发表于 2016-8-6 17:18:36 | 显示全部楼层

    DDDDDDDDDDDDDDDDDD

    shine8898 LV4

    发表于 2016-9-5 00:16:36 | 显示全部楼层


    DDDDDDDDDDDDDDDDDD

    wywl2016 LV10

    发表于 2017-7-25 05:30:38 | 显示全部楼层

    浮云浮云浮云浮云浮云浮云浮云浮云浮云

    小小云 LV3

    发表于 2020-4-6 15:06:43 | 显示全部楼层

    难得一见的好帖

    真的有爱情 LV0

    发表于 2020-6-22 16:30:22 | 显示全部楼层

    帮你顶下哈!!

    二货 LV5

    发表于 2020-8-9 11:18:12 | 显示全部楼层

    谢谢楼主分享

    yuanxun LV3

    发表于 2020-8-16 14:27:04 | 显示全部楼层

    帮你顶下哈!!

    幸福烟灰 LV3

    发表于 2020-11-7 11:38:15 | 显示全部楼层

    顶下

    神秘感 LV1

    发表于 2025-5-28 14:30:54 | 显示全部楼层

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

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

    微信二维码

    有问题联系客服