[MT4指标]变色MA指标
主图指标
mt4指标类型:趋势指标
是否能用在mt4手机版上:否
是否含有未来函数:无
//+------------------------------------------------------------------+
//| Color_MA.mq4 |
//| 腻龛? 勿腩? |
//| http://denis-or-love.narod.ru |
//+------------------------------------------------------------------+
#property copyright "腻龛? 勿腩?"
#property link "http://denis-or-love.narod.ru"
#property indicator_chart_window
#property indicator_buffers 3
#property indicator_color1 Green
#property indicator_color2 Red
#property indicator_color3 Silver
extern int PeriodAv=12;
extern int Flat=1;
extern color ColorUp=Green;
extern color ColorDown=Red;
extern color ColorFlat=Silver;
extern int Width=2;
double Line1, Line2, Line3;
//+------------------------------------------------------------------+
//| Custom indicator initialization function |
//+------------------------------------------------------------------+
int init()
{
//---- indicators
SetIndexStyle(0,DRAW_LINE,STYLE_SOLID,Width,ColorUp);//DRAW_LINE
SetIndexBuffer(0,Line1);
SetIndexStyle(1,DRAW_LINE,STYLE_SOLID,Width,ColorDown);
SetIndexBuffer(1,Line2);
SetIndexStyle(2,DRAW_LINE,STYLE_SOLID,Width,ColorFlat);//DRAW_LINE
SetIndexBuffer(2,Line3);
//----
return(0);
}
//+------------------------------------------------------------------+
//| Custom indicator deinitialization function |
//+------------------------------------------------------------------+
int deinit()
{
//----
//----
return(0);
}
//+------------------------------------------------------------------+
//| Custom indicator iteration function |
//+------------------------------------------------------------------+
int start()
{
//----
int i, Counted_bars=IndicatorCounted();
i=Bars-Counted_bars-1; // 软溴犟 镥疴钽? 礤镱聍栩囗眍泐
while(i>=0) // 骤觌 镱 礤镱聍栩囗睇? 徉疣?
{
double MA_0=iMA(NULL,0,PeriodAv,0,MODE_EMA,PRICE_CLOSE,i),
MA_2=iMA(NULL,0,PeriodAv,0,MODE_EMA,PRICE_CLOSE,i+1);
if(MA_0>MA_2) Line1=MA_0;
else
if(MA_0Color_MA.jpg
发表于:2015-06-22 00:40只看该作者
2楼
非常感谢楼主!
韬客社区www.talkfx.co
发表于:2015-06-22 07:02只看该作者
3楼
非常感谢楼主!
韬客社区www.talkfx.co
发表于:2015-06-27 03:20只看该作者
4楼
谢谢分享~!!!
发表于:2015-10-20 07:48只看该作者
6楼
没有通宝 也不能下载 只能看看了
韬客社区www.talkfx.co
发表于:2016-12-07 10:22只看该作者
7楼
谢楼主的分享
韬客社区www.talkfx.co