实时显示ticks指标
#property copyright "Copyright ?2007, okwh."
#property link "http://blog.sina.com.cn/"
//#property indicator_chart_window
#property indicator_separate_window
#property indicator_buffers 1
#property indicator_color1 Red
#property indicator_color2 Aqua
#property indicator_color3 CornflowerBlue
#property indicator_color4 Gold
#property indicator_color5 SkyBlue
//---- input parameters
extern intTbars = 1000; //Ц»јЗВјЧоЅь1000μг
//---- buffers
double ExtMapBuffer1[];
//+------------------------------------------------------------------+
//| Custom indicator initialization function tick |
//+------------------------------------------------------------------+
int init()
{
//---- indicators
SetIndexStyle(0,DRAW_LINE);
SetIndexBuffer(0,ExtMapBuffer1);
return(0);
}
//+------------------------------------------------------------------+
//| Custom indicator deinitialization function |
//+------------------------------------------------------------------+
int deinit()
{
//----
//----
return(0);
}
//+------------------------------------------------------------------+
//| Custom indicator iteration function |
//+------------------------------------------------------------------+
double nows=0;
int num=0,i=0;
int start()
{
int Ncounted_bars = Bars-IndicatorCounted();
if (Ncounted_bars == Bars) //КЧґОЈ¬ёґЦЖcloseКэѕЭ ІўЗТУРК±¶аКэѕЭ±д»ЇЈ¬MTЅцμчУГЦё±кТ»ґО
{
num = Ncounted_bars;
for (int i=num;i>0;i--)
ExtMapBuffer1= Close; //ТФ¶УБР·ЅКЅјЗВјticks јЫёс
return(0);
}
nows = MarketInfo(Symbol(),MODE_BID);//MarketInfo(Symbol(),MODE_ASK);//+MarketInfo(Symbol(),MODE_BID))/2.0;
SetLevelValue(0, nows) ;
if (Ncounted_bars>1) //УРК±¶аКэѕЭ±д»ЇЈ¬MTЅцμчУГЦё±кТ»ґО,РиМоідїХ°Ч УЙУЪMTμДКэѕЭёьРВ·ЅКЅ
{
for ( i=Ncounted_bars;i>0;i--)
ExtMapBuffer1= ExtMapBuffer1; //ТФ¶УБР·ЅКЅјЗВјticks јЫёс
}
if (num>0)
{
if (nows == ExtMapBuffer1) return (0);//Ц»јЗВјУР±д»ЇμДКэѕЭ
if (num>Tbars)num = Tbars;
for ( i=num;i>0;i--)
{
ExtMapBuffer1= ExtMapBuffer1; //ТФ¶УБР·ЅКЅјЗВјticks јЫёс
}
}
ExtMapBuffer1 = nows;
num++;
WindowRedraw( ) ;
return(0);
}
谢谢楼主,共同发展 沙发!沙发! 有竞争才有进步嘛 好好 学习了 确实不错 路过,学习下 路过,学习下 谢谢楼主分享 谢谢楼主分享 谢谢楼主分享
页:
[1]
2