设为首页收藏本站

 找回密码
 注册
查看: 4106|回复: 2
打印 上一主题 下一主题

版主 看看这个编绎成TB的公式么? [复制链接]

Rank: 4

精华
1
UID
117
积分
427
帖子
79
主题
12
阅读权限
50
注册时间
2007-8-15
最后登录
2016-3-30
跳转到指定楼层
1#
发表于 2007-8-28 10:09:18 |只看该作者 |倒序浏览
//+------------------------------------------------------------------+
//|                                                        Volna.mq4 |
//|                                           Copyright ?2007, SVS. |
//|                                                                  |
//+------------------------------------------------------------------+
#property copyright "Copyright ?2007, SVS."
#property link      ""

#property indicator_separate_window
#property indicator_buffers 4
#property indicator_color1 MediumSeaGreen
#property indicator_color2 Blue
#property indicator_color3 Red
#property indicator_color4 Black
extern int PT_chart=5;
extern int PT_Period=1;
//---- buffers
double ExtMapBuffer1[];
double ExtMapBuffer2[];
double ExtMapBuffer3[];
double ExtMapBuffer4[];
//+------------------------------------------------------------------+
//| Custom indicator initialization function                         |
//+------------------------------------------------------------------+
int init()
  {
//---- indicators
   SetIndexStyle(0,DRAW_HISTOGRAM,0,2);
   SetIndexBuffer(0,ExtMapBuffer1);
   SetIndexStyle(1,DRAW_HISTOGRAM,0,2);
   SetIndexBuffer(1,ExtMapBuffer2);
   SetIndexStyle(2,DRAW_HISTOGRAM,0,2);
   SetIndexBuffer(2,ExtMapBuffer3);
   SetIndexStyle(3,DRAW_HISTOGRAM,0,2);
   SetIndexBuffer(3,ExtMapBuffer4);
   IndicatorShortName("PT("+PT_Period+")");
   SetIndexLabel(0,"PT");
//----
   return(0);
  }
//+------------------------------------------------------------------+
//| Custom indicator deinitialization function                       |
//+------------------------------------------------------------------+
int deinit()
  {
//----
   
//----
   return(0);
  }
//+------------------------------------------------------------------+
//| Custom indicator iteration function                              |
//+------------------------------------------------------------------+   
int start()
  {
   double vt0,vt1;
   double vj,vk,vd;
   double vts;
   int MODE,p1,p2;
//---- TODO: add your code here
   int limit;
   int counted_bars=IndicatorCounted();
   if(counted_bars>0) counted_bars--;
   limit=Bars-counted_bars-1;
   for(int i=0;i<=limit;i++){                  
//-------------------------------------------------
MODE=0;
      p1=PT_chart*PT_Period;//
      p2=p1*2;
      vts=0;
      for (int c=0;c<=p2;c++){      
         vts=vts+iMA(NULL,0,c,0,MODE,PRICE_WEIGHTED,i);         
         if(c==p1)vt0=(vts/p1)-iMA(NULL,0,p1,0,MODE,PRICE_WEIGHTED,i);         
         if(c==p2)vt1=(vts/p2)-iMA(NULL,0,p2,0,MODE,PRICE_WEIGHTED,i);                  
         }
//---------------------------------------------------------
      //--------------------------------           
      vk=(vt0+vt1)/2;
      vd=(vt0/2);           
      vj=(vt1-vd);   
      //-----------------------------
      ExtMapBuffer4=vj;      
      if(vd<0)ExtMapBuffer3=vd;
      if(vt1<0)ExtMapBuffer1=vt1;
      if(vk<0)ExtMapBuffer2=vk;
      if(vd>0)ExtMapBuffer3=vd;
      if(vt1>0)ExtMapBuffer1=vt1;
      if(vk>0)ExtMapBuffer2=vk;
   }
//----
   return(0);
  }
//+------------------------------------------------------------------+

Rank: 10Rank: 10Rank: 10

精华
20
UID
4
积分
22709
帖子
4802
主题
64
阅读权限
255
注册时间
2007-7-20
最后登录
2024-1-15
2#
发表于 2007-8-28 14:45:25 |只看该作者
这是MetaTrader的公式语言,没怎么用过。不明白有些表达方式,最好您先翻译成自然语言,我再帮你改写!

使用道具 举报

Rank: 4

精华
1
UID
117
积分
427
帖子
79
主题
12
阅读权限
50
注册时间
2007-8-15
最后登录
2016-3-30
3#
发表于 2007-8-28 16:06:29 |只看该作者
原帖由 nopain 于 2007-8-28 14:45 发表
这是MetaTrader的公式语言,没怎么用过。不明白有些表达方式,最好您先翻译成自然语言,我再帮你改写!



看不太懂  没法翻译成自然语言


介绍一个提示买卖的指标,在俄罗斯网站卖15.99美元
PowerTrend指标,使用方法类似于宝塔线:指标中出现蓝色柱体持有当前头寸;出现绿柱要注意了,等待变盘,做反向操作;绿柱消失,在0轴上方出现红色柱体做多,在0轴下方出现红色柱体做空。
附件: 你需要登录才可以下载或查看附件。没有帐号?注册

使用道具 举报

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

bottom

静态版|手机版|联系我们|交易开拓者 ( 粤ICP备07044698   

GMT+8, 2024-5-16 02:04

Powered by Discuz! X2 LicensedChrome插件扩展

© 2011-2012 交易开拓者 Inc.

回顶部