论坛全局菜单下方 - exness285X70 - 韬客社区论坛全局菜单下方 - 荔枝返现285X70 - 韬客社区论坛全局菜单下方 - ThinkMarkets285X70 - 韬客社区论坛全局菜单下方 - TICKMILL 285X70 - 韬客社区
查看:1580回复:0
老正韬客社区韬客社区
注册时间2003-09-21
365热心助人奖
[MT4指标][讨论]关于mt的自定义指标 谁有详细的说明啊
韬客社区
楼主发表于:2004-08-14 16:57只看该作者倒序浏览
1楼 电梯直达
电梯直达
坛子上都是关于自动化交易的。。。。 我把mt上的macd贴出来 我先把我不明白的地方说明下 大家群策群力 谢谢先 /*[[ Name := MACD Author := Copyright ?2003, MetaQuotes Software Corp. Link := http://www.metaquotes.ru/ Separate Window := Yes //定义是否是新开的窗口 First Color := White //定义第一条的颜色 First Draw Type := Histogram //定义线的类型 Use Second Data := Yes //定义是否有第二条线 Second Color := Red //定义第二条的颜色 Second Draw Type := Line //定义第二条线的类型 ]]*/ 1:上面这段定义了指标的一些定义,只能显示2条线么? -------------------------------------------------- Inputs : FastMAPeriod(12), SlowMAPeriod(26), SignalMAPeriod(9)&#59; Variables : shift(0), cnt(0), sum(0), loopbegin1(0), loopbegin2(0), first(True), prevbars(0)&#59; Variables : FastMA(0), SlowMA(0)&#59; 2:定义各个 输入的选项 和各个变量 具体的我明白的不多 谁有具体的各个变量的明确解释 英文的也可 我试着去翻译大家一块讨论下 -------------------------------------------------------------- SetLoopCount(0)&#59; // initial checkings If FastMAPeriod < 1 Or SlowMAPeriod < 1 Or SignalMAPeriod < 1 Then Exit&#59; If FastMAPeriod >= SlowMAPeriod Then Exit&#59; // check for additional bars loading or total reloading If Bars < prevbars Or Bars-prevbars>1 Then first = True&#59; prevbars = Bars&#59; // loopbegin1 and loopbegin2 prevent couning of counted bars exclude 3:检测下输入和其他的一些是否正确?????? 下面的我就有些晕了 是不是还有检测的段落???? 哪些才是指标的正文呢?这些检测是必须的么? ------------------------------------------------------ current If first Then Begin loopbegin1 = Bars-SlowMAPeriod-1&#59; If loopbegin1 < 0 Then Exit&#59; // not enough bars for counting loopbegin2 = Bars-SlowMAPeriod-SignalMAPeriod-2&#59; If loopbegin2 < 0 Then Exit&#59; // not enough bars for counting first = False&#59; // this block is to be evaluated once only End&#59; // convergence-divergence loopbegin1 = loopbegin1+1&#59; // current bar is to be recounted too For shift = loopbegin1 Downto 0 Begin FastMA = iMAEx(FastMAPeriod,MODE_EMA,0,PRICE_CLOSE,shift)&#59; SlowMA = iMAEx(SlowMAPeriod,MODE_EMA,0,PRICE_CLOSE,shift)&#59; SetIndexValue(shift,FastMA-SlowMA)&#59; loopbegin1 = loopbegin1-1&#59; // prevent to previous bars recounting End&#59; // signal line loopbegin2 = loopbegin2+1&#59; // current bar is to be recounted too For shift = loopbegin2 Downto 0 Begin sum = 0&#59; for cnt = 0 To SignalMAPeriod-1 Begin sum = sum + GetIndexValue(shift+cnt)&#59; End&#59; SetIndexValue2(shift,sum/SignalMAPeriod)&#59; loopbegin2 = loopbegin2-1&#59; // prevent to previous bars recounting End&#59;
TK29帖子1楼右侧xm竖版广告90-240
个性签名

遇到矛盾 先站在对方的立场上想想问题,先试着去理解别人
● 如何使用WinMTR查询平台连接流畅度

广告
TK30+TK31帖子一樓廣告
TK30+TK31帖子一樓廣告
版权所有:韬客外汇论坛 www.talkfx.com 联络我们:[email protected]