【正文】
or_color1 Silver// indicator parametersextern int FastEMA=12。extern int SlowEMA=26。extern int SignalSMA=9。// indicator buffersdouble ind_buffer1[]。double ind_buffer2[]。double ind_buffer3[]。//++//| Custom indicator initialization function |//++int init(){// 2 additional buffers are used for counting.IndicatorBuffers(3)。// drawing settingsSetIndexStyle(0,DRAW_HISTOGRAM,STYLE_SOLID,3)。SetIndexDrawBegin(0,SignalSMA)。IndicatorDigits(MarketInfo(Symbol(),MODE_DIGITS)+2)。// 3 indicator buffers mappingSetIndexBuffer(0,ind_buffer1)。SetIndexBuffer(1,ind_buffer2)。SetIndexBuffer(2,ind_buffer3)。// name for DataWindow and indicator subwindow labelIndicatorShortName(OsMA(+FastEMA+,+SlowEMA+,+SignalSMA+))。// initialization donereturn(0)。}int IndicatorCounted()返回緩存數(shù)量示例:int start(){int limit。int counted_bars=IndicatorCounted()。// check for possible errorsif(counted_bars0) return(1)。// last counted bar will be recountedif(counted_bars0) counted_bars。limit=Barscounted_bars。// main loopfor(int i=0。 i{// ma_shift set to 0 because SetIndexShift called aboweExtBlueBuffer=iMA(NULL,0,JawsPeriod,0,MODE_SMMA,PRICE_MEDIAN,i)。ExtRedBuffer=iMA(NULL,0,TeethPeriod,0,MODE_SMMA,PRICE_MEDIAN,i)。ExtLimeBuffer=iMA(NULL,0,LipsPeriod,0,MODE_SMMA,PRICE_MEDIAN,i)。}// donereturn(0)。}void IndicatorDigits( int digits)設(shè)置指標(biāo)精確度 :: 輸入?yún)?shù)digits 小數(shù)點(diǎn)后的小數(shù)位數(shù) 示例:property indicator_separate_windowproperty indicator_buffers 1property indicator_color1 Silver// indicator parametersextern int FastEMA=12。extern int SlowEMA=26。extern int SignalSMA=9。// indicator buffersdouble ind_buffer1[]。double ind_buffer2[]。double ind_buffer3[]。//++//| Custom indicator initialization function |//++int init(){// 2 additional buffers are used for counting.IndicatorBuffers(3)。// drawing settingsSetIndexStyle(0,DRAW_HISTOGRAM,STYLE_SOLID,3)。SetIndexDrawBegin(0,SignalSMA)。IndicatorDigits(MarketInfo(Symbol(),MODE_DIGITS)+2)。// 3 indicator buffers mappingSetIndexBuffer(0,ind_buffer1)。SetIndexBuffer(1,ind_buffer2)。SetIndexBuffer(2,ind_buffer3)。// name for DataWindow and indicator subwindow labelIndicatorShortName(OsMA(+FastEMA+,+SlowEMA+,+SignalSMA+))。// initialization donereturn(0)。}void IndicatorShortName( string name)設(shè)置指標(biāo)的簡稱 :: 輸入?yún)?shù)name 新的簡稱 示例:property indicator_separate_windowproperty indicator_buffers 1property indicator_color1 Silver// indicator parametersextern int FastEMA=12。extern int SlowEMA=26。extern int SignalSMA=9。// indicator buffersdouble ind_buffer1[]。double ind_buffer2[]。double ind_buffer3[]。//++//| Custom indicator initialization function |//++int init(){// 2 additional buffers are used for counting.IndicatorBuffers(3)。// drawing settingsSetIndexStyle(0,DRAW_HISTOGRAM,STYLE_SOLID,3)。SetIndexDrawBegin(0,SignalSMA)。IndicatorDigits(MarketInfo(Symbol(),MODE_DIGITS)+2)。// 3 indicator buffers mappingSetIndexBuffer(0,ind_buffer1)。SetIndexBuffer(1,ind_buffer2)。SetIndexBuffer(2,ind_buffer3)。// name for DataWindow and indicator subwindow labelIndicatorShortName(OsMA(+FastEMA+,+SlowEMA+,+SignalSMA+))。// initialization donereturn(0)。}void SetIndexArrow( int index, int code)在指標(biāo)上設(shè)置一個(gè)箭頭符號 :: 輸入?yún)?shù)index 第幾根指標(biāo)線 07code 符號的編碼,參照 Wingdings 字體 示例:SetIndexArrow(0, 217)。bool SetIndexBuffer( int index, double array[])設(shè)置指標(biāo)線的緩存數(shù)組 :: 輸入?yún)?shù)index 第幾根指標(biāo)線 07array[] 緩存的數(shù)組 示例:double ExtBufferSilver[]。int init(){SetIndexBuffer(0, ExtBufferSilver)。 // set buffer for first line// ...}void SetIndexDrawBegin( int index, int begin)設(shè)置劃線的開始點(diǎn) :: 輸入?yún)?shù)index 第幾根指標(biāo)線 07begin 劃線的開始點(diǎn) 示例:property indicator_separate_windowproperty indicator_buffers 1property indicator_color1 Silver// indicator parametersextern int FastEMA=12。extern int SlowEMA=26。extern int SignalSMA=9。// indicator buffersdouble ind_buffer1[]。double ind_buffer2[]。double ind_buffer3[]。//++//| Custom indicator initialization function |//++int init(){// 2 additional buffers are used for counting.IndicatorBuffers(3)。// drawing settingsSetIndexStyle(0,DRAW_HISTOGRAM,STYLE_SOLID,3)。SetIndexDrawBegin(0,SignalSMA)。IndicatorDigits(MarketInfo(Symbol(),MODE_DIGITS)+2)。// 3 indicator buffers mappingSetIndexBuffer(0,ind_buffer1)。SetIndexBuffer(1,ind_buffer2)。SetIndexBuffer(2,ind_buffer3)。// name for DataWindow and indicator subwindow labelIndicatorShortName(OsMA(+FastEMA+,+SlowEMA+,+SignalSMA+))。// initialization donereturn(0)。}void SetIndexEmptyValue( int index, double value) 設(shè)置劃線的空值,空值不劃在和出現(xiàn)在數(shù)據(jù)窗口 :: 輸入?yún)?shù)index 第幾根指標(biāo)線 07value 新的空值 示例:SetIndexEmptyValue(6,)。void SetIndexLabel( int index, string text) 設(shè)置指標(biāo)線的名稱 :: 輸入?yún)?shù)index 第幾根指標(biāo)線 07text 線的名稱,Null不會顯示在數(shù)據(jù)窗口中 示例://++//| Ichimoku Kinko Hyo initialization function |//++int init(){//SetIndexStyle(0,DRAW_LINE)。SetIndexBuffer(0,Tenkan_Buffer)。SetIndexDrawBegin(0,Tenkan1)。SetIndexLabel(0,Tenkan Sen)。//SetIndexStyle(1,DRAW_LINE)。SetIndexBuffer(1,Kijun_Buffer)。SetIndexDrawBegin(1,Ki