下载MetaTrader 5
要添加评论,请登录注册
找出如何在信息编辑器中添加视频
lihx
8
lihx 2008.11.15 18:46 
(EXPMA(CLOSE,n)+MA(CLOSE,n*2)+MA(CLOSE,n*4))/3

请帮忙编成MT4指标
Rashid Umarov
管理员
6599
Rashid Umarov 2008.11.18 10:39  

Here you are


//+------------------------------------------------------------------+
//|                                                  zsh226expMA.mq4 |
//|                      Copyright © 2008, MetaQuotes Software Corp. |
//|                                   https://forum.mql4.com/cn/17189 |
//+------------------------------------------------------------------+
#property copyright "Copyright © 2008, MetaQuotes Software Corp."
#property link      "https://forum.mql4.com/cn/17189"

#property indicator_chart_window
#property indicator_buffers 1
#property indicator_color1 Red
//---- input parameters
extern int       Period_n=10;
//---- buffers
double ExtMapBuffer1[];
//+------------------------------------------------------------------+
//| Custom indicator initialization function                         |
//+------------------------------------------------------------------+
int init()
  {
//---- indicators
   SetIndexStyle(0,DRAW_LINE);
   SetIndexBuffer(0,ExtMapBuffer1);
//----
   return(0);
  }
//+------------------------------------------------------------------+
//| Custom indicator deinitialization function                       |
//+------------------------------------------------------------------+
int deinit()
  {
//----
   
//----
   return(0);
  }
//+------------------------------------------------------------------+
//| Custom indicator iteration function                              |
//+------------------------------------------------------------------+
int start()
  {
   int  limit,  counted_bars=IndicatorCounted();
   if (counted_bars>0) limit = Bars - counted_bars;
   if (counted_bars==0) limit = Bars - Period_n*4;
   
//----
   for (int i = limit; i>=0; i--)
      {
      ExtMapBuffer1[i] = (iMA(Symbol(),0,Period_n,0,MODE_EMA,PRICE_CLOSE,i) + 
         iMA(Symbol(),0,Period_n*2,0,MODE_SMA,PRICE_CLOSE,i) +
         iMA(Symbol(),0,Period_n*4,0,MODE_SMA,PRICE_CLOSE,i))/3.0; 
      }
//----
   return(0);
  }
//+------------------------------------------------------------------+



附加的文件:
lihx
8
lihx 2008.11.20 12:28  
谢谢
yalewang
577
yalewang 2008.11.22 16:34  
Rosh 写道 >>

Here you aRE

ROSH 好热心,请问一下代码如何改写?多谢。

BIAS1:=(MA(C,2)-MA(C,4))/MA(C,4)*100;

BIAS2:=(MA(C,2)-MA(C,8))/MA(C,8)*100;

BIAS3:=(MA(C,2)-MA(C,12))/MA(C,12)*100;

BIAS:MA((BIAS1+2*BIAS2+5*BIAS3)/8,5)*50,colorred;

biass:MA(BIAS,2),colorgreen;

0,colorred;

/
要添加评论,请登录注册