[MT4指标][讨论]关于mt的自定义指标 谁有详细的说明啊
坛子上都是关于自动化交易的。。。。
我把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);
Variables : shift(0), cnt(0), sum(0), loopbegin1(0), loopbegin2(0), first(True), prevbars(0);
Variables : FastMA(0), SlowMA(0);
2:定义各个 输入的选项 和各个变量 具体的我明白的不多
谁有具体的各个变量的明确解释 英文的也可 我试着去翻译大家一块讨论下
--------------------------------------------------------------
SetLoopCount(0);
// initial checkings
If FastMAPeriod < 1 Or SlowMAPeriod < 1 Or SignalMAPeriod < 1 Then Exit;
If FastMAPeriod >= SlowMAPeriod Then Exit;
// check for additional bars loading or total reloading
If Bars < prevbars Or Bars-prevbars>1 Then first = True;
prevbars = Bars;
// loopbegin1 and loopbegin2 prevent couning of counted bars exclude
3:检测下输入和其他的一些是否正确??????
下面的我就有些晕了 是不是还有检测的段落????
哪些才是指标的正文呢?这些检测是必须的么?
------------------------------------------------------
current
If first Then Begin
loopbegin1 = Bars-SlowMAPeriod-1;
If loopbegin1 < 0 Then Exit; // not enough bars for counting
loopbegin2 = Bars-SlowMAPeriod-SignalMAPeriod-2;
If loopbegin2 < 0 Then Exit; // not enough bars for counting
first = False; // this block is to be evaluated once only
End;
// convergence-divergence
loopbegin1 = loopbegin1+1; // current bar is to be recounted too
For shift = loopbegin1 Downto 0 Begin
FastMA = iMAEx(FastMAPeriod,MODE_EMA,0,PRICE_CLOSE,shift);
SlowMA = iMAEx(SlowMAPeriod,MODE_EMA,0,PRICE_CLOSE,shift);
SetIndexValue(shift,FastMA-SlowMA);
loopbegin1 = loopbegin1-1; // prevent to previous bars recounting
End;
// signal line
loopbegin2 = loopbegin2+1; // current bar is to be recounted too
For shift = loopbegin2 Downto 0 Begin
sum = 0;
for cnt = 0 To SignalMAPeriod-1 Begin
sum = sum + GetIndexValue(shift+cnt);
End;
SetIndexValue2(shift,sum/SignalMAPeriod);
loopbegin2 = loopbegin2-1; // prevent to previous bars recounting
End;
遇到矛盾 先站在对方的立场上想想问题,先试着去理解别人
● 如何使用WinMTR查询平台连接流畅度