請教一個MC均線策略回測問題
本人初學MC, 系統自帶 跌破均線第二個交易日收盤賣出,我希望是 當天收盤前判斷是否跌破均線,如果跌破就當天收盤賣出, 請問如何變相. 系統默認 都是 Sell ( "MACrossLX" ) next bar at market ;買
inputs: Price( Close ), Length( 9 ), ConfirmBars( 1 ) ;
variables: var0( 0 ) ;
condition1 = Price > AverageFC( Price, Length ) ;
if condition1 then
var0 = var0 + 1
else
var0 = 0 ;
condition1 = CurrentBar > ConfirmBars and var0 = ConfirmBars ;
if condition1 then
Buy ( "MACrossLE" ) next bar at market ;
賣
inputs: Price( Close ), Length( 9 ) ;
variables: var0( 0 ) ;
var0 = AverageFC( Price, Length );
condition1 = CurrentBar > 1 and Price crosses under var0 ;
if condition1 then
Sell ( "MACrossLX" ) next bar at market ;
可以一張圖表放兩個商品,上面一分K,下面日K,當13:44 or 13:29時若close of data2跌破均線就sell next at market,當然其他部分都得記得改成data2的資料
如果你是想要在平倉時用Sell this bar at close的話, 可參考這篇
http://www.coco-in.net/thread-40732-1-1.html
頁:
[1]