交易危机

 找回密码
 快捷注册(禁q号)

QQ登录

只需一步,快速开始

搜索
广告位
查看: 2260|回复: 3

[代码] MT4平台显示反K线指标(主图显示分享)

  [复制链接]

2127

主题

6万

积分

157

精华

大型投行

金钱
61244 美元
权重
640
发表于 2018-8-1 22:16 | 显示全部楼层 |阅读模式
说明
1.图形背景色见图示颜色(白底蓝红K)
2.均线参数可调
3.K宽度为3像素
4.作用:未知



代码:


  1. #property indicator_chart_window
  2. #property indicator_buffers 6
  3. #property indicator_color1 SeaGreen
  4. #property indicator_color2 DeepPink
  5. #property indicator_color3 SeaGreen
  6. #property indicator_color4 DeepPink
  7. #property indicator_color6 Red

  8. double E1[];
  9. double E2[];
  10. double E3[];
  11. double E4[];
  12. double E5[];
  13. double D5[];
  14. int n;
  15. int ExtCountedBars=0;
  16. extern int MA=60;

  17. int init()
  18. {
  19. SetIndexStyle(0,DRAW_HISTOGRAM,STYLE_SOLID,2);
  20. SetIndexBuffer(0, E1);
  21. SetIndexStyle(1,DRAW_HISTOGRAM,STYLE_SOLID,2);
  22. SetIndexBuffer(1, E2);
  23. SetIndexStyle(2,DRAW_HISTOGRAM,STYLE_SOLID,1);
  24. SetIndexBuffer(2, E3);
  25. SetIndexStyle(3,DRAW_HISTOGRAM,STYLE_SOLID,1);
  26. SetIndexBuffer(3, E4);
  27. SetIndexStyle(4,DRAW_LINE,0,1,Red);
  28. SetIndexBuffer(4, E5);
  29. SetIndexBuffer(5, D5);
  30. return(0);
  31. }
  32. int deinit()
  33. {
  34. return(0);
  35. }
  36. int start()
  37. {
  38. if(Bars<=10) return(0);

  39. int pos=0,limit=Bars-IndicatorCounted();
  40. n=WindowBarsPerChart();
  41. while(pos<n)
  42. {
  43. double  x=WindowPriceMax()+WindowPriceMin();
  44.    E1[pos]=x-Open[pos];
  45.    E2[pos]=x-Close[pos];
  46.    if (Open[pos]==Close[pos]) E2[pos]=x-Close[pos]-Point*0.1;
  47.    if (Open[pos]<=Close[pos])
  48.    {
  49.       E3[pos]=x-Low[pos];
  50.       E4[pos]=x-High[pos];
  51.    }
  52.    else
  53.    {
  54.       E4[pos]=x-Low[pos];
  55.       E3[pos]=x-High[pos];
  56.    }
  57. for(int i=0; i<limit; i++)
  58.    {
  59.    D5[i]=iMA(NULL,0,MA,0,0,0,i);
  60.    E5[pos]=x-D5[pos];
  61.    }
  62. pos++;
  63. }
  64. return(0);
  65. }
  66.         
复制代码




来源: MT4平台显示反K线指标(主图显示分享)

4

主题

9227

积分

0

精华

所有交易让市场验证

操盘专家

金钱
9227 美元
权重
8
发表于 2019-1-19 21:50 来自手机 | 显示全部楼层
消灭零回复
您需要登录后才可以回帖 登录 | 快捷注册(禁q号)

本版积分规则

QQ|黄金吧|黄金论坛|手机版|指标下载|非农|目录|交易危机

版权所有: ©2014-2021 fx3q.com Powered by Discuz! X3
浙ICP备: ICP14039028

浙公网安备 33011802001420号

风险提示:杠杆风险高,交易要谨慎 声明:坛友发言和回复均为个人观点,不代表论坛立场。
若有侵权请联系fx3q@qq.com删除

快速回复 返回顶部 返回列表