[MT4指标]Donchian Channel 指标
主图指标
mt4指标类型:震荡指标
是否能用在mt4手机版上:否
是否含有未来函数:无
//+------------------------------------------------------------------+
//| Donchian Channel |
//+------------------------------------------------------------------+
#property copyright "ps"
#property link ""
//---- indicator settings
#property indicator_chart_window
#property indicator_buffers 2
#property indicator_color1 Gold
#property indicator_color2 Gold
#property indicator_width1 1
#property indicator_width2 1
//---- indicator parameters
extern int periods=20;
//---- indicator buffers
double upper;
double lower;
//+------------------------------------------------------------------+
//| Custom indicator initialization function |
//+------------------------------------------------------------------+
int init()
{
//---- drawing settings
SetIndexStyle(0,DRAW_LINE);
SetIndexStyle(1,DRAW_LINE);
//---- indicator buffers mapping
SetIndexBuffer(0,upper);
SetIndexBuffer(1,lower);
//---- name for DataWindow and indicator subwindow label
IndicatorShortName("Donchian Channel("+periods+")");
SetIndexLabel(0,"Upper");
SetIndexLabel(1,"Lower");
//---- initialization done
return(0);
}
//+------------------------------------------------------------------+
//| now do the dance. |
//+------------------------------------------------------------------+
int start()
{
int limit;
int counted_bars=IndicatorCounted();
//---- last counted bar will be recounted
if(counted_bars>0) counted_bars--;
limit=Bars-counted_bars;
//---- calculate values
for(int i=0; iDonchian.jpg
发表于:2014-03-10 15:39只看该作者
2楼
自定义指标都不能在手机的mt4上用吧。
韬客社区www.talkfx.co