|
代码:
显示实时ticks指标.zip
(1.04 KB, 下载次数: 0, 售价: 20 金钱)
- #property copyright "Copyright ?2007, okwh."
- #property link "http://blog.sina.com.cn/FXTrade"
- //#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 int Tbars = 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[i]= Close[i-1]; //ТФ¶УБР·ЅКЅјЗВј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[i-1]= ExtMapBuffer1[i]; //ТФ¶УБР·ЅКЅјЗВјticks јЫёс
- }
- if (num>0)
- {
- if (nows == ExtMapBuffer1[0]) return (0);//Ц»јЗВјУР±д»ЇμДКэѕЭ
- if (num>Tbars)num = Tbars;
- for ( i=num;i>0;i--)
- {
- ExtMapBuffer1[i]= ExtMapBuffer1[i-1]; //ТФ¶УБР·ЅКЅјЗВјticks јЫёс
- }
- }
- ExtMapBuffer1[0] = nows;
- num++;
- WindowRedraw( ) ;
- return(0);
- }
复制代码 |
|