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); } //+------------------------------------------------------------------+
附加的文件:
zsh226expma.mq4
3 kb
谢谢
请帮忙编成MT4指标