比特币通信协议 - 币圈消息

比特币通信协议篇11、二、TURN简介。在典型的情况下,TURN客户端连接到内网中,并且通过一个或者多个NAT到 详细

我也请牛版修改一下指标

  [复制链接]
252 8
myhaomm 发表于 2018-1-11 11:56:37 | 只看该作者 |阅读模式 打印 上一主题 下一主题
这是在论坛里找到的一个掘金者的指标,加载后  走过的K线有些不自动消除,需要重新加载模板或切换下时间才能完整显示,如下图


,请牛版看看源码
//+------------------------------------------------------------------------+
//|                                 Symphonie_Trendline_Indicator_v3.0.mq4 |
//|Based on basic Trendline by MetaTrader_Experts_and_Indicators           |
//+------------------------------------------------------------------------+
#property copyright "Symphonie Trader System"
#property link      "MetaTrader_Experts_and_Indicators"
#property indicator_chart_window
#property indicator_buffers 2
#property indicator_color1 Red
#property indicator_color2 DodgerBlue
extern int CCIPeriod=89;
extern int ATRPeriod=1;
double TrendUp[];
double TrendDown[];
int st = 0;
//extern int SlowerEMA = 6;
//+------------------------------------------------------------------+
//| Custom indicator initialization function|
//+------------------------------------------------------------------+
int init()
{
//---- indicators
  SetIndexStyle(0, DRAW_LINE, STYLE_SOLID, 2);
  SetIndexBuffer(0, TrendUp);
  SetIndexStyle(1, DRAW_LINE, STYLE_SOLID, 2);
  SetIndexBuffer(1, TrendDown);
  /*SetIndexStyle(0, DRAW_ARROW, EMPTY);
  SetIndexArrow(0, 159);
  SetIndexBuffer(0, TrendUp);
  SetIndexStyle(1, DRAW_ARROW, EMPTY);
  SetIndexArrow(1, 159);
  SetIndexBuffer(1, TrendDown);*/
  /*for(int i = 0; i  0) counted_bars--;
  limit=Bars-counted_bars;
  for(i = limit; i >= 0; i--) {
     cciTrendNow = iCCI(NULL, 0, CCIPeriod, PRICE_TYPICAL, i);
     cciTrendPrevious = iCCI(NULL, 0, CCIPeriod, PRICE_TYPICAL, i+1);
     //st = st * 100;
     counter = i;
     Range = 0;
     AvgRange = 0;
     for (counter = i; counter >= i-9; counter--) {
        AvgRange = AvgRange + MathAbs(Low[counter]-High[counter]);
     }
     Range = AvgRange/10;
     if (cciTrendNow >= st && cciTrendPrevious  st) {
        TrendDown[i+1] = TrendUp[i+1];
     }
     if (cciTrendNow >= st) {
        TrendUp = Close - iATR(NULL, 0, ATRPeriod, i);
        if (TrendUp  TrendDown[i+1]) {
           TrendDown = TrendDown[i+1];
        }
     }
  }
//----
//----
  return(0);
}
//+------------------------------------------------------------------+

本帖子中包含更多资源

您需要 登录 才可以下载或查看,没有帐号?立即注册

x
收藏
收藏0
转播
转播
分享
分享
分享
淘帖0

精彩评论8

跳转到指定楼层
沙发
stefanlife 发表于 2018-1-11 12:27:39 | 只看该作者
帮你顶了
板凳
stefanlife 发表于 2018-1-11 13:45:40 | 只看该作者
帮你顶了
地板
nanaliu 发表于 2018-1-11 14:19:52 | 只看该作者
顶顶顶顶。。。。
5#
hjsn2025 发表于 2018-1-11 15:51:46 | 只看该作者
不错,还好你有源码
6#
ferrari0078 发表于 2018-1-11 17:08:34 | 只看该作者
还好你有源码..
7#
凡人凡事 发表于 2018-1-11 18:09:37 | 只看该作者
谢谢楼主分享!!!!!
8#
XGLONG 发表于 2018-1-11 19:44:51 | 只看该作者
不错,还好你有源码
9#
福相随 发表于 2018-1-11 20:10:17 | 只看该作者
伸手习惯了,慢慢我的习气就变坏了
您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

发布主题
阅读排行更多+

Powered by 顺水鱼MT4外汇EA网! X3.2© 2001-2017 顺水MT4外汇EA公司.( 陕ICP备17014341号-1