包寧傑帶狀操作法 - 財經
By Heather
at 2008-08-24T21:54
at 2008-08-24T21:54
Table of Contents
Parameter: UpColor(Red), DnColor(Green), CompBars(6),FastMA(10),SlowMA(20),MacdMA(9)
Variables: haClose(0), haOpen(0), haHigh(0), haLow(0), color(0),value1(0)
value2=MACD(close,FastMA,SlowMA)
value3= EMA(value1,MacdMA)
value4=value2-value1
If BarNumber = 1 then
haOpen = open
haClose = (Open + High + Low + Close) / 4
haHigh = MaxList( high, haOpen, haClose)
haLow = MinList( low, haOpen, haClose)
End If
if BarNumber > 1 then
haClose = (Open + High + Low + Close) / 4
haOpen = (haOpen [1] + haClose [1]) / 2
haHigh = MaxList(High, haOpen, haClose)
haLow = MinList(Low, haOpen, haClose)
if haClose > haOpen then
color = UpColor
else
color = DnColor
End If
for value1 = 1 to CompBars
if haOpen <= MaxList(haOpen[value1], haClose[value1]) and
haOpen >= MinList(haOpen[value1], haClose[value1]) and
haClose <= MaxList(haOpen[value1], haClose[value1]) and
haClose >= MinList(haOpen[value1], haClose[value1]) then
color = color[value1]
End If
End For
If Color = UpColor And Value1 Cross Over 0 And CurrentContracts <= 0 Then
buy("買進") next bar at market
End If
If Color = DnColor and value4<-20 And CurrentContracts >= 0 Then
sell("賣出") next bar at market
End If
end If
想請問一下大家,這份程式碼還需要加上些什麼東西?
--
Variables: haClose(0), haOpen(0), haHigh(0), haLow(0), color(0),value1(0)
value2=MACD(close,FastMA,SlowMA)
value3= EMA(value1,MacdMA)
value4=value2-value1
If BarNumber = 1 then
haOpen = open
haClose = (Open + High + Low + Close) / 4
haHigh = MaxList( high, haOpen, haClose)
haLow = MinList( low, haOpen, haClose)
End If
if BarNumber > 1 then
haClose = (Open + High + Low + Close) / 4
haOpen = (haOpen [1] + haClose [1]) / 2
haHigh = MaxList(High, haOpen, haClose)
haLow = MinList(Low, haOpen, haClose)
if haClose > haOpen then
color = UpColor
else
color = DnColor
End If
for value1 = 1 to CompBars
if haOpen <= MaxList(haOpen[value1], haClose[value1]) and
haOpen >= MinList(haOpen[value1], haClose[value1]) and
haClose <= MaxList(haOpen[value1], haClose[value1]) and
haClose >= MinList(haOpen[value1], haClose[value1]) then
color = color[value1]
End If
End For
If Color = UpColor And Value1 Cross Over 0 And CurrentContracts <= 0 Then
buy("買進") next bar at market
End If
If Color = DnColor and value4<-20 And CurrentContracts >= 0 Then
sell("賣出") next bar at market
End If
end If
想請問一下大家,這份程式碼還需要加上些什麼東西?
--
Tags:
財經
All Comments
By Margaret
at 2008-08-29T04:01
at 2008-08-29T04:01
By Thomas
at 2008-09-01T09:56
at 2008-09-01T09:56
By Carol
at 2008-09-06T09:11
at 2008-09-06T09:11
Related Posts
HTS取一分K棒平均的問題
By Ida
at 2008-08-24T16:15
at 2008-08-24T16:15
請問期貨版在哪裡?找不到
By Elvira
at 2008-08-21T22:58
at 2008-08-21T22:58
請問TS中如何考慮股票的除權息
By Mary
at 2008-08-19T10:36
at 2008-08-19T10:36
請問TS中如何考慮股票的除權息
By Zanna
at 2008-08-18T23:11
at 2008-08-18T23:11
好像沒有HTS之外的系統研討?
By Oliver
at 2008-08-14T20:28
at 2008-08-14T20:28