
不是在黃金交叉發生就買進,是在黃金交叉發生時記下發生交叉當根的高點,在其後如果發生收盤價站上這個記下的高點,才買進,放空則是反之。
不過因為有可能因為這樣記下的放空點高於買進點,如此會造成反覆交易的訊號,因此在發生黃金交叉的時候,把放空點的紀錄改為很大的值,而發生死亡交叉的時候,把買進點改為0。
Parameter:L1(5),L2(63);
Var:BuyPrice(999999),SellPrice(0);
if MA(C,L1)[1] < MA(C,L2)[1] and MA(C,L1)[0] > MA(C,L2)[0] then
BuyPrice= High
SellPrice= 0
end if
if MA(C,L1)[1] > MA(C,L2)[1] and MA(C,L1)[0] < MA(C,L2)[0] then
SellPrice= Low
BuyPrice= 999999
end if
if C > BuyPrice then
Buy next bar at Market
end if
if C < SellPrice then
Sell next bar at Market
end if