我也來試看看
真果斷~ 感謝樓主分享 只能用強來形容了~~~ 感覺很不錯耶
我也來試看看
有人這樣搞...不知道可不可以應用... 最下面那個是什麼=口=!?
還是只是上了馬賽克 MagicPi 發表於 13-2-28 22:59 static/image/common/back.gif
最下面那個是什麼=口=!?
還是只是上了馬賽克
程式碼
{ Corona Chart Cycle Period
written by John F. Ehlers copyright (c) 2008
The spectral content of the data are measured in a bank of contiguous
filters as described in "Measuring Cycle Periods" in the March 2008 issue
of Stocks & Commodities Magazine. The filter having the strongest output
is selected as the current dominant cycle period. The cycle period is
measured as the number of bars contained in one full cycle period.
}
Inputs:
Price((H+L)/2),
LineR(255),
LineG(255),
LineB(0),
FuzzR(255),
FuzzG(0),
FuzzB(0),
ShowDC(True);
Vars:
delta(0.1),
gamma(0),
alpha(0),
beta(0),
N(0),
Period(0),
MaxAmpl(0),
Num(0),
Denom(0),
DC(0),
DomCyc(0),
Color1(0),
Color2(0),
Color3(0),
alpha1(0),
HP(0),
SmoothHP(0);
Arrays:
myI(0),
OldI(0),
OlderI(0),
Q(0),
OldQ(0),
OlderQ(0),
Real(0),
OldReal(0),
OlderReal(0),
Imag(0),
OldImag(0),
OlderImag(0),
Ampl(0),
OldAmpl(0),
DB(0),
OldDB(0);
alpha1 = (1 - Sine (360 / 30)) / Cosine(360 / 30);
HP = .5*(1 + alpha1)*(Price - Price) + alpha1*HP;
SmoothHP = (HP + 2*HP + 3*HP + 3*HP + 2*HP + HP) / 12;
IF CurrentBar < 7 Then SmoothHP = Price - Price;
IF CurrentBar = 1 THEN SmoothHP = 0;
delta = -.015*CurrentBar + .5;
If delta < .1 then delta = .1;
If CurrentBar > 12 Then Begin
For N = 12 to 60 Begin
beta = Cosine(720 / N);
gamma = 1 / Cosine(1440*delta / N);
alpha = gamma - SquareRoot(gamma*gamma - 1);
Q = (.5*N / 6.28318)*(SmoothHP - SmoothHP);
myI = SmoothHP;
Real = .5*(1 - alpha)*(myI - OlderI) + beta*(1 + alpha)*OldReal - alpha*OlderReal;
Imag = .5*(1 - alpha)*(Q - OlderQ) + beta*(1 + alpha)*OldImag - alpha*OlderImag;
Ampl = (Real*Real + Imag*Imag);
End;
End;
For N = 12 to 60 Begin
OlderI = OldI;
OldI = myI;
OlderQ = OldQ;
OldQ = Q;
OlderReal = OldReal;
OldReal = Real;
OlderImag = OldImag;
OldImag = Imag;
OldAmpl = Ampl;
OldDB = DB;
End;
MaxAmpl = Ampl;
For N = 12 to 60 Begin
If Ampl > MaxAmpl then MaxAmpl = Ampl;
End;
For N = 12 to 60 Begin
IF MaxAmpl <> 0 AND (Ampl / MaxAmpl) > 0 THEN DB = -10*Log(.01 / (1 - .99*Ampl / MaxAmpl)) / Log(10);
DB = .33*DB + .67*OldDB;
If DB > 20 then DB = 20;
End;
Num = 0;
Denom = 0;
For N = 12 to 60 Begin
If DB <= 6 Then Begin
Num = Num + N*(20 - DB);
Denom = Denom + (20 - DB);
End;
If Denom <> 0 Then DC = .5*Num / Denom;
End;
DomCyc = Median(DC, 5);
If ShowDC = True Then Plot1(DomCyc, "DC", RGB(LineR, LineG, LineB), 0, 2);
For N = 12 to 60 Begin
IF DB <= 10 THEN Begin
Color1 = LineR + DB*(FuzzR - LineR) / 10;
Color2 = LineG + DB*(FuzzG - LineG) / 10;
Color3 = LineB + DB*(FuzzB - LineB) / 10;
END;
IF DB > 10 THEN Begin
Color1 = FuzzR*(2 - DB / 10);
Color2 = FuzzG*(2 - DB / 10);
Color3 = FuzzB*(2 - DB / 10);
END;
If N = 12 Then Plot12(N/2, "S12", RGB(Color1, Color2, Color3),0,5);
If N = 13 Then Plot13(N/2, "S13", RGB(Color1, Color2, Color3),0,5);
If N = 14 Then Plot14(N/2, "S14", RGB(Color1, Color2, Color3),0,5);
If N = 15 Then Plot15(N/2, "S15", RGB(Color1, Color2, Color3),0,5);
If N = 16 Then Plot16(N/2, "S16", RGB(Color1, Color2, Color3),0,5);
If N = 17 Then Plot17(N/2, "S17", RGB(Color1, Color2, Color3),0,5);
If N = 18 Then Plot18(N/2, "S18", RGB(Color1, Color2, Color3),0,5);
If N = 19 Then Plot19(N/2, "S19", RGB(Color1, Color2, Color3),0,5);
If N = 20 Then Plot20(N/2, "S20", RGB(Color1, Color2, Color3),0,5);
If N = 21 Then Plot21(N/2, "S21", RGB(Color1, Color2, Color3),0,5);
If N = 22 Then Plot22(N/2, "S22", RGB(Color1, Color2, Color3),0,5);
If N = 23 Then Plot23(N/2, "S23", RGB(Color1, Color2, Color3),0,5);
If N = 24 Then Plot24(N/2, "S24", RGB(Color1, Color2, Color3),0,5);
If N = 25 Then Plot25(N/2, "S25", RGB(Color1, Color2, Color3),0,5);
If N = 26 Then Plot26(N/2, "S26", RGB(Color1, Color2, Color3),0,5);
If N = 27 Then Plot27(N/2, "S27", RGB(Color1, Color2, Color3),0,5);
If N = 28 Then Plot28(N/2, "S28", RGB(Color1, Color2, Color3),0,5);
If N = 29 Then Plot29(N/2, "S29", RGB(Color1, Color2, Color3),0,5);
If N = 30 Then Plot30(N/2, "S30", RGB(Color1, Color2, Color3),0,5);
If N = 31 Then Plot31(N/2, "S31", RGB(Color1, Color2, Color3),0,5);
If N = 32 Then Plot32(N/2, "S32", RGB(Color1, Color2, Color3),0,5);
If N = 33 Then Plot33(N/2, "S33", RGB(Color1, Color2, Color3),0,5);
If N = 34 Then Plot34(N/2, "S34", RGB(Color1, Color2, Color3),0,5);
If N = 35 Then Plot35(N/2, "S35", RGB(Color1, Color2, Color3),0,5);
If N = 36 Then Plot36(N/2, "S36", RGB(Color1, Color2, Color3),0,5);
If N = 37 Then Plot37(N/2, "S37", RGB(Color1, Color2, Color3),0,5);
If N = 38 Then Plot38(N/2, "S38", RGB(Color1, Color2, Color3),0,5);
If N = 39 Then Plot39(N/2, "S39", RGB(Color1, Color2, Color3),0,5);
If N = 40 Then Plot40(N/2, "S40", RGB(Color1, Color2, Color3),0,5);
If N = 41 Then Plot41(N/2, "S41", RGB(Color1, Color2, Color3),0,5);
If N = 42 Then Plot42(N/2, "S42", RGB(Color1, Color2, Color3),0,5);
If N = 43 Then Plot43(N/2, "S43", RGB(Color1, Color2, Color3),0,5);
If N = 44 Then Plot44(N/2, "S44", RGB(Color1, Color2, Color3),0,5);
If N = 45 Then Plot45(N/2, "S45", RGB(Color1, Color2, Color3),0,5);
If N = 46 Then Plot46(N/2, "S46", RGB(Color1, Color2, Color3),0,5);
If N = 47 Then Plot47(N/2, "S47", RGB(Color1, Color2, Color3),0,5);
If N = 48 Then Plot48(N/2, "S48", RGB(Color1, Color2, Color3),0,5);
If N = 49 Then Plot49(N/2, "S49", RGB(Color1, Color2, Color3),0,5);
If N = 50 Then Plot50(N/2, "S50", RGB(Color1, Color2, Color3),0,5);
If N = 51 Then Plot51(N/2, "S51", RGB(Color1, Color2, Color3),0,5);
If N = 52 Then Plot52(N/2, "S52", RGB(Color1, Color2, Color3),0,5);
If N = 53 Then Plot53(N/2, "S53", RGB(Color1, Color2, Color3),0,5);
If N = 54 Then Plot54(N/2, "S54", RGB(Color1, Color2, Color3),0,5);
If N = 55 Then Plot55(N/2, "S55", RGB(Color1, Color2, Color3),0,5);
If N = 56 Then Plot56(N/2, "S56", RGB(Color1, Color2, Color3),0,5);
If N = 57 Then Plot57(N/2, "S57", RGB(Color1, Color2, Color3),0,5);
If N = 58 Then Plot58(N/2, "S58", RGB(Color1, Color2, Color3),0,5);
If N = 59 Then Plot59(N/2, "S59", RGB(Color1, Color2, Color3),0,5);
If N = 60 Then Plot60(N/2, "S50", RGB(Color1, Color2, Color3),0,5);
End;
陳小花 發表於 13-2-28 23:08 static/image/common/back.gif
程式碼
感謝但是可以請問一下這個指標是...???
陳小花 發表於 13-2-28 23:08 static/image/common/back.gif
程式碼
花大太強了.. {:4_113:}
佩服佩服.. {:4_160:}{:4_160:}{:4_160:}
本帖最後由 賭神咖啡客 於 13-3-1 14:45 編輯
googleandy 發表於 13-1-18 20:58 static/image/common/back.gif
哈哈哈, 我也會!
您這是Price Channel線,其實操盤玩具媽踢翹的內建指標已有了,何需多此一舉再費手力寫程式{:4_87:} 賭神咖啡客 發表於 13-3-1 14:44 static/image/common/back.gif
您這是Price Channel線,其實操盤玩具媽踢翹的內建指標已有了,何需多此一舉再費手力寫程式 ...
那幾行程式 是在處理 "背景", 不是 "Price Channel線".
頁:
1
[2]