afala 發表於 09-10-7 09:48

AmiBroker公式:鱷魚指標

SetChartBkColor(ParamColor("BkColor", colorBlack));
_N(Title = StrFormat("{{NAME}} - {{INTERVAL}} {{DATE}} Open %g, Hi %g, Lo %g, Close %g (%.1f%%) {{VALUES}} ", O, H, L, C, SelectedValue( ROC( C, 1 ) ) ));

A = (H + L)/2;

MAL = MA(A, Param("LPeriods", 34));
MAS = MA(A, Param("SPeriods", 5));
AO = MAS - MAL;
AC = MA((AO - MA(AO, 5)), 5);

ACCOLOR = IIf(AC >= Ref(AC, -1), 1, -1);
AOCOLOR = IIf(AO >= Ref(AO, -1), 1, -1);

COLOR = IIf(ACCOLOR != AOCOLOR, colorGrey50, IIf(AOCOLOR == 1, colorRed, colorBrightGreen));
PlotOHLC(Open,High,Low,Close,"", COLOR, styleCandle);

AlligatorBlue=Ref(Wilders(A,13),-8);
AlligatorRed=Ref(Wilders(A,8),-5);
AlligatorGreen=Ref(Wilders(A,5),-3);

Plot(AlligatorGreen, "Green", ColorRGB(0, 255, 0), styleLine|styleNoLabel);
Plot(AlligatorRed, "Red", ColorRGB(255, 0, 0), styleLine|styleNoLabel);
Plot(AlligatorBlue, "Blue", ColorRGB(0, 0, 255), styleLine|styleNoLabel);

/*The following builds Fractal Up*/
var1=
(Ref(H,-2) >= Ref(H, -4)) AND
(Ref(H,-2) >= Ref(H, -3)) AND
(Ref(H,-2) >= Ref(H, -1)) AND
(Ref(H,-2) >= Ref(H, 0));
FractalUp=ValueWhen(var1,Ref(H, -2),1);
Plot(FractalUp, "F-Up", IIf(Close > FractalUp, colorBlack, colorPink), styleBar);

/*The following builds Fractal Down*/
var2=
(Ref(L,-2) <= Ref(L, -1)) AND
(Ref(L,-2) <= Ref(L, 0)) AND
(Ref(L,-2) <= Ref(L, -3)) AND
(Ref(L,-2) <= Ref(L, -4));
FractalDown=ValueWhen( var2,Ref(L,-2),1);
Plot(FractalDown, "F-Down", IIf(Close < FractalDown, colorBlack, colorGold), styleBar);

Buy = Cross(Close, FractalUp);
IIf(Buy, PlotShapes(shapeHollowUpArrow*Buy, colorRed, 0, Low), 0);
Short = Cross(FractalDown, Close);
IIf(Short, PlotShapes(shapeHollowDownArrow*Short, colorBrightGreen, 0, High), 0);

綠茶妹 發表於 09-10-7 10:04

AmiBroker公式:鱷魚指標

有沒有實圖可以放上來給大家欣賞?
公司裡沒有裝AmiBroker。

afala 發表於 09-10-7 10:45

參考一下實圖

綠茶妹 發表於 09-10-7 11:01

謝謝分享,
鱷魚嘴巴張開是好點。

inova1818 發表於 09-10-7 11:49

看不太董意思,有人可以幫忙解釋一下嗎?感恩!

afala 發表於 09-10-7 12:58

本帖最後由 afala 於 2009-10-7 13:01 編輯

5# inova1818
參考一下(非廣告,此站與本人無關)
http://tw.myblog.yahoo.com/jozen-wang/article?mid=748

inova1818 發表於 09-10-7 14:36

謝謝啦,好好的來k一下.{:5_219:}

hkcarnby 發表於 09-12-25 20:13

鱷魚指標有甚麼特別??{:5_256:}

我愛紅茶 發表於 09-12-25 21:09

{:4_186:}這篇到底是在聊什麼啊!!

小娃 發表於 09-12-25 22:23

抱歉。因為之前把文章切出來放到程式發佈區,
害大家看不懂。
合併回去了。

我愛紅茶 發表於 09-12-26 02:50

小娃美女站大客氣了^^
謝謝你補足剩餘部分
辛苦你了!

hkcarnby 發表於 09-12-26 18:41

大家有沒有做鱷魚指標的BACK TEST?{:5_261:}

hsiao13 發表於 11-11-28 08:17

這有點看不太懂哪!

hangye 發表於 11-12-14 15:46

這有點看不太懂哪!

joelhuang 發表於 11-12-14 19:21

這有點看不太懂哪!
頁: [1] 2
查看完整版本: AmiBroker公式:鱷魚指標