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

    Probability Density Function (PDF)

    2016-05-19 · 4998 阅读
    pdf.png


    1. //+------------------------------------------------------------------+
    2. //|                                                          PDF.mq4 |
    3. //|                         Copyright ?2006, Luis Guilherme Damiani |
    4. //|                                      http://www.damianifx.com.br |
    5. //+------------------------------------------------------------------+
    6. #property copyright "Copyright ?2006, Luis Guilherme Damiani"
    7. #property link      "http://www.damianifx.com.br"
    8. //----
    9. #property indicator_separate_window
    10. #property indicator_buffers 1
    11. #property indicator_color1 MediumSeaGreen
    12. //----
    13. double pdf[];
    14. //---- input parameters
    15. extern int       ch_size=20;
    16. //extern int limit_value=0;
    17. //+------------------------------------------------------------------+
    18. //| Custom indicator initialization function                         |
    19. //+------------------------------------------------------------------+
    20. int init()
    21.   {
    22.    SetIndexStyle(0,DRAW_LINE);
    23.    SetIndexBuffer(0,pdf);
    24. //----
    25.    return(0);
    26.   }
    27. //+------------------------------------------------------------------+
    28. //| Custom indicator deinitialization function                       |
    29. //+------------------------------------------------------------------+
    30. int deinit()
    31.   {
    32. //----
    33. //----
    34.    return(0);
    35.   }
    36. //+------------------------------------------------------------------+
    37. //| Custom indicator iteration function                              |
    38. //+------------------------------------------------------------------+
    39. int start()
    40.   {
    41. //----
    42. //---- indicators
    43.    int counter[100];
    44.    int totBars=Bars;
    45.    int value=0;
    46.    int    counted_bars=IndicatorCounted();
    47.    if(counted_bars<0) return(-1);
    48.    ArrayInitialize(counter,0);
    49.    for(int i =Bars-1-ch_size;i>=0;i--)
    50.      {
    51.       value=MathCeil(iStochastic(NULL,0,ch_size, 2,1,MODE_SMA,0,MODE_MAIN,i));
    52.       counter[100-value]=counter[100-value]+1;
    53.       //if(counter[100-value]>limit_value && limit_value!=0)counter[100-value]=limit_value;
    54.      }
    55.    pdf[0]=0;
    56.    for(i=100;i>0;i--)
    57.      {
    58.       pdf[i]=counter[i];
    59.       // Print(pdf[i]);
    60.      }
    61. //----
    62.    return(0);
    63.   }
    64. //+------------------------------------------------------------------+
    复制代码


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

    举报

     

    回答|共 9 个

    rewfdwrree LV2

    发表于 2020-6-7 15:41:58 | 显示全部楼层

    难得一见的好帖

    可否一直陪我 LV3

    发表于 2020-6-14 21:50:16 | 显示全部楼层

    学习了,不错,讲的太有道理了

    jsi544xb LV0

    发表于 2020-6-23 16:59:15 | 显示全部楼层

    难得一见的好帖

    qiofcacc369 LV3

    发表于 2020-7-11 14:01:53 | 显示全部楼层

    学习了,不错

    日本人 LV3

    发表于 2020-8-8 10:16:22 | 显示全部楼层

    谢谢楼主分享

    天鹰 LV6

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

    谢谢楼主分享

    欢喜楊陽 LV3

    发表于 2021-7-18 15:22:57 | 显示全部楼层

    谢谢

    我的乐乐 LV1

    发表于 2021-7-24 16:18:39 | 显示全部楼层

    支持下

    姜德智 LV1

    发表于 2023-8-11 21:12:16 | 显示全部楼层

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

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

    微信二维码

    有问题联系客服