請問MAFC函數 - 財經
By Ursula
at 2008-08-31T12:30
at 2008-08-31T12:30
Table of Contents
Parameter: Price(Numeric), Length(Numeric)
Variables: Summation(0), Counter(0), LoopCount(1), Initialized(False)
If !Initialized Then
//If CurrentBar = 1 Then
Summation = Price[0]
LoopCount = 0
For counter = 1 To Length - 1
Summation = Summation + Price[counter]
LoopCount += 1
End For
If LoopCount = Length Then
Initialized = True
End If
Else
Summation = Summation + Price - Price[Length]
End If
MAFC = 0
If Length > 0 Then
MAFC = Summation / Length
End If
===
Parameter: Price(Numeric), Length(Numeric)
Variables: Summation(0), Counter(0)
Summation = 0
For counter = 0 To Length - 1
Summation = Summation + Price[counter]
End For
If Length >= 1 Then
MA = Summation / Length
Else
MA = 0
End if
===
請問要如何把MA和MAFC改成TS可以用的程式碼?
因為我改了一陣子,還是改不出來
所以請教各位能替我解答
Thx^^
--
Variables: Summation(0), Counter(0), LoopCount(1), Initialized(False)
If !Initialized Then
//If CurrentBar = 1 Then
Summation = Price[0]
LoopCount = 0
For counter = 1 To Length - 1
Summation = Summation + Price[counter]
LoopCount += 1
End For
If LoopCount = Length Then
Initialized = True
End If
Else
Summation = Summation + Price - Price[Length]
End If
MAFC = 0
If Length > 0 Then
MAFC = Summation / Length
End If
===
Parameter: Price(Numeric), Length(Numeric)
Variables: Summation(0), Counter(0)
Summation = 0
For counter = 0 To Length - 1
Summation = Summation + Price[counter]
End For
If Length >= 1 Then
MA = Summation / Length
Else
MA = 0
End if
===
請問要如何把MA和MAFC改成TS可以用的程式碼?
因為我改了一陣子,還是改不出來
所以請教各位能替我解答
Thx^^
--
Tags:
財經
All Comments
Related Posts
請問TS交易成本的設定
By Eden
at 2008-08-31T03:03
at 2008-08-31T03:03
請問TS中如何考慮股票的除權息
By Carol
at 2008-08-30T23:47
at 2008-08-30T23:47
酒田戰法量化
By Belly
at 2008-08-30T14:49
at 2008-08-30T14:49
損失幾點 後平倉的寫法
By Jacky
at 2008-08-25T13:33
at 2008-08-25T13:33
請問HTS回測
By Sarah
at 2008-08-25T13:19
at 2008-08-25T13:19