當沖交時間設定0845-1329及1500-隔日0450,若與前盤收盤價落差50點以上時,
延後30分鐘交易,以MACD為例沒辦法編譯?不知道哪裡有問題,請各位高手幫忙解惑,謝謝!!
inputs: FastLength( 12 ), SlowLength( 26 ), MACDLength( 9 ) ;
variables: var0( 0 ), var1( 0 ), var2( 0 ) ;
var0 = MACD( Close, FastLength, SlowLength ) ;
var1 = XAverage( var0, MACDLength ) ;
var2 = var0 - var1 ;
If var0 cross over var1 then buy this bar on close;
If var0 cross under var1 then sellshort this bar on close;
if date = date[1] then begin
if time > 0850 and time < 1329 and time > 1500 then begin
if time =1329 then begin
if marketposition = 1 then sell this bar on close;
if marketposition = -1 then buytocover this bar on close;
end;
if date <> date[1] then begin
if date < 0450 then begin
if time =0450 then begin
if marketposition = 1 then sell this bar on close;
if marketposition = -1 then buytocover this bar on close;
end;
if date <> date[1] and opend(0) - closed(0) < 50 then begin
end else if time = 0915 then begin
end;
if time = 1345 then value1=close;
if time = 1500 and (open - close < 50 or close - open < 50) then begin
end else if time = 1530 then begin
end; |