作者Betalker (Talker)
看板Trading
标题[讨论] 包宁杰带状操作法
时间Sun Aug 24 21:54:51 2008
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
想请问一下大家,这份程式码还需要加上些什麽东西?
--
※ 发信站: 批踢踢实业坊(ptt.cc)
◆ From: 118.161.166.131
1F:推 bigtree1120:请问你想问什麽? 08/24 22:35
2F:→ bigtree1120:你的MACD的式子,value1,2,3,不用刻意改成2,3,4 08/24 22:38
3F:→ bigtree1120:看的懂的人还是看得懂,看不懂的人还是看不懂! 08/24 22:39