[MT4指标]请高手帮忙添加(Schaff Trend Cycle.mq4 )指标信号报警
当(Schaff Trend Cycle.mq4 )指标相交水平线50时,就立即声音报警。指标源码: |eP5iy wg
#property copyright "Copyright ?2004, FostarFX." 8_T9[ ]7V8
#property link "mail: [email protected]
" $dF$-y<[0 |F&02 f!]@ #property indicator_separate_window &M6Zsmo #property indicator_minimum -10 Jj~|2Zt #property indicator_maximum 110 =!IoL7x #property indicator_buffers 1 q5\iQ2f{WV #property indicator_color1 DarkOrchid yBfX4aH:` RhkTN'vO //---- input parameters t@q==VHF extern int MAShort=23; h8icF}m extern int MALong=50; ;3+_aoY extern double Cycle=10; 'ji|'x T extern int CountBars=300; XzPUll;ZU //---- buffers b fI= = double MA; 5. +_'bF| double ST; I/go$@E" //+------------------------------------------------------------------+ %]N|?9L"= //| Custom indicator initialization function | a&u!KAQ //+------------------------------------------------------------------+ aev(CY,z int init() b"w@am>& { (W?t'J^# // string short_name; -#,4rN# //---- indicator line sW76RKX8 IndicatorBuffers(2); \cK#/;a# SetIndexBuffer(0, MA); u-*z#e_L0 SetIndexBuffer(1, ST); }yw>d\] f SetIndexStyle(0,DRAW_LINE,STYLE_SOLID,2,DarkOrchid); f6 s .xQ w!-MMT4y //---- zF(abQ0 //---- 1 ]ePU8 return(0); Q=Liy@/+! } @U9`V&])F[ //+------------------------------------------------------------------+ k106fT]eX //| Schaff Trend Cycle | Vq'n$k} //+------------------------------------------------------------------+ >ByqM{? int start() N?O^" { ElKMd SetIndexDrawBegin(0,Bars-CountBars+MALong+MAShort+1); 0[ (kFe int shift,u,counted_bars=IndicatorCounted(); KNR7Igw?} double MCD, LLV, HHV, MA_Short, MA_Long, sum ,prev, smconst; @FF80U4' int n, i, s; z m]R76 bool check_begin=false, check_begin_MA=false; &MPlSIg double MCD_Arr[100]; 1DGl[k/zv Ao#bR Em if(Bars<=MALong) return(0); Wevd6)\ if (CountBars==0) CountBars=Bars; 2/\I/QkTs //---- initial zero | GN/{KH] if(counted_bars=MALong) shift=Bars-counted_bars-1; ]9c{qm}y
1_l)$"
check_begin = false; H!Dj.]T
check_begin_MA = false; Z
n = 1; MZxU)QW1
s = 1; TK%q} bK,
smconst = 2 / (1 + Cycle/2); H9(UzyN>i
)1gT&sU0
while(shift>=0) RLzqpEj
MCD = MA_Short - MA_Long; B9$pG
hJ8% r_
if (n >= Cycle) hh5h \ZI%
{ 5rc3jIXc{|
n = 1; check_begin = true; } else {n = n + 1;} UEt78eN
&4 #%xg
if (check_begin) lj:.}+]r
{ 7/_|/4&
for (i = 1; i<=Cycle; i++) uFhPNR2l
{ FP7N^HVBG=
if (i == 1) {LLV = MCD_Arr;} A$n.'*gK
else { .*xO/pn
if (LLV > MCD_Arr) LLV = MCD_Arr; 49O_A[(d
} ~l. C -
iT s" RW
if (i == 1) {HHV = MCD_Arr;} .6y*Z+Zg
else { ^ k{/Yl
if (HHV < MCD_Arr) HHV = MCD_Arr; ,,6lQ]wG
} ~X %cbFom=
} ;`kOFg#`)c
ST[shift] = ((MCD - LLV)/(HHV - LLV))*100 + 0.01; nD>X?yz2
s = s + 1; w 40*vBz
if (s >= (Cycle)/2) !{ _:k%B
{ (!0_s48f
s = 1; Z![#Uz.z
check_begin_MA = true; @{Fa=".Ch
} 1rU\ !GfR
} else {ST[shift] = 0;} u:J4Az^!
if (check_begin_MA) { cXN0D\%`
prev = MA[shift + 1]; 6z/&j} (
MA[shift] = smconst * (ST[shift] - prev) + prev; } ?duw0SZ
e%{7CR'~TD
shift--; kI5LG6
} E)X_
#.Ly
return(0); /w2IL7}
} G4#Yz6O
//+------------------------------------------------------------------+
" $dF$-y<[0 |F&02 f!]@ #property indicator_separate_window &M6Zsmo #property indicator_minimum -10 Jj~|2Zt #property indicator_maximum 110 =!IoL7x #property indicator_buffers 1 q5\iQ2f{WV #property indicator_color1 DarkOrchid yBfX4aH:` RhkTN'vO //---- input parameters t@q==VHF extern int MAShort=23; h8icF}m extern int MALong=50; ;3+_aoY extern double Cycle=10; 'ji|'x T extern int CountBars=300; XzPUll;ZU //---- buffers b fI= = double MA; 5. +_'bF| double ST; I/go$@E" //+------------------------------------------------------------------+ %]N|?9L"= //| Custom indicator initialization function | a&u!KAQ //+------------------------------------------------------------------+ aev(CY,z int init() b"w@am>& { (W?t'J^# // string short_name; -#,4rN# //---- indicator line sW76RKX8 IndicatorBuffers(2); \cK#/;a# SetIndexBuffer(0, MA); u-*z#e_L0 SetIndexBuffer(1, ST); }yw>d\] f SetIndexStyle(0,DRAW_LINE,STYLE_SOLID,2,DarkOrchid); f6 s .xQ w!-MMT4y //---- zF(abQ0 //---- 1 ]ePU8 return(0); Q=Liy@/+! } @U9`V&])F[ //+------------------------------------------------------------------+ k106fT]eX //| Schaff Trend Cycle | Vq'n$k} //+------------------------------------------------------------------+ >ByqM{? int start() N?O^" { ElKMd SetIndexDrawBegin(0,Bars-CountBars+MALong+MAShort+1); 0[ (kFe int shift,u,counted_bars=IndicatorCounted(); KNR7Igw?} double MCD, LLV, HHV, MA_Short, MA_Long, sum ,prev, smconst; @FF80U4' int n, i, s; z m]R76 bool check_begin=false, check_begin_MA=false; &MPlSIg double MCD_Arr[100]; 1DGl[k/zv Ao#bR Em if(Bars<=MALong) return(0); Wevd6)\ if (CountBars==0) CountBars=Bars; 2/\I/QkTs //---- initial zero | GN/{KH] if(counted_bars
发表于:2012-01-15 14:11只看该作者
2楼
水平很高谢谢
韬客社区www.talkfx.co