Balance Of Power  力量平衡度指標


 



1.計算公式:
a.BalanceOfPower=(收盤價-開盤價)/(最高價-最低價)
b.用移動平均來做平滑。
c.使用者欲使用移動平均來作平滑。


2.中文註解
在極端之水平中測定達成值中之賣出與買入勢力之強度而使用之。


3.TS語法
首先…新增一個 T3Average 的 Function

input: Price(Numeric), Length(Numeric), Hot(Numeric);
Variables: b(Hot), b2(b*b), b3(b2*b),
e1(Price), e2(Price), e3(Price), e4(Price), e5(Price), e6(Price),
c1(-b3), c2(3*(b2+b3)), c3(-3*(2*b2+b+b3)), c4(1+3*b+b3+3*b2),
N(0), w1(0), w2(0);

N = Length;
If N < 1 then begin
N = 1;
End;
N = 1 + 0.5*(N-1);
w1 = 2 / (N + 1);
w2 = 1 - w1;

e1 = w1 * Price + w2 * e1;
e2 = w1 * e1 + w2 * e2;
e3 = w1 * e2 + w2 * e3;
e4 = w1 * e3 + w2 * e4;
e5 = w1 * e4 + w2 * e5;
e6 = w1 * e5 + w2 * e6;

T3Average = c1 * e6 + c2 * e5 + c3 * e4 + c4 * e3;


接著再新增一個 BalanceOfPower 的 Function

input: Length(Numeric);
Variables: BOP(0);

If High - Low > 0 Then
BOP = (Close - Open) / (High - Low)
Else begin
BOP = 0;
End;

BalanceOfPower = T3Average( BOP, Length, 0.5);

再來..來新增個指標吧..

inputs: Length(14);
Plot1(BalanceOfPower(length));

 

arrow
arrow
    全站熱搜
    創作者介紹
    創作者 millertime2 的頭像
    millertime2

    miller投資小站~程式交易、外匯期貨研究操作

    millertime2 發表在 痞客邦 留言(0) 人氣()