14. 此資料僅為個人於演講之經驗分享 (內容不保證完全正確) 。投資有一定風險,交易人應先評估本身資金及所能擔負之風險。本課程內容提及之交易
策略並不代表未來獲利,投資人需審慎評估。投資人損益需自負。
市場切割檢測法(按0706TEST)
inputs:lmt(50),stp(50),EntryType(1),len1(60),Length(20),NumATRs(1.5);
variables:var0(0),var1(0),var2(0),var3(0);
var0 = AverageFC( c, Length ) ;
var1 = NumATRs * AvgTrueRange( Length ) ;
var2 = var0 + var1 ;//up
var3 = var0 - var1 ;//down
if EntryType=1 then begin
if macd(close,12,26) cross over 0 then buy next bar at high stop;
if macd(close,12,26) cross under 0 then sellshort next bar at low stop;
end;
if EntryType=2 then begin
if macd(close,12,26) cross over 0 then sellshort next bar at high limit;
if macd(close,12,26) cross under 0 then buy next bar at low limit;
end;
if EntryType=3 then begin
if rsi(close,14) cross over len1 then buy next bar at high stop;
if rsi(close,14) cross under 100-len1 then sellshort next bar at low stop;
end;
if EntryType=4 then begin
if rsi(close,14) cross over len1 then sellshort next bar at high limit;
if rsi(close,14) cross under 100-len1 then buy next bar at low limit;
end;
if EntryType=5 then begin
if close > var2 then buy next bar at high+5 stop;
if close < var3 then sellshort next bar at low-5 stop;
end;
if EntryType=6 then begin
if close cross over var2 then sellshort next bar at high+3 limit;
if close cross under var3 then buy next bar at low-3 limit;
end;
if marketposition > 0 then begin
sell next bar at entryprice(0) + (1 / PriceScale) * MinMove * lmt limit;
sell next bar at entryprice(0) - (1 / PriceScale) * MinMove * stp stop;
if barssinceentry>10 then sell("l_escape") next bar at minlist(lowd(1),lowd(2)) stop;
end;
if marketposition < 0 then begin
buytocover next bar at entryprice(0) - (1 / PriceScale) * MinMove * lmt limit;
buytocover next bar at entryprice(0) + (1 / PriceScale) * MinMove * stp stop;
if barssinceentry>10 then buytocover("s_escape") next bar at maxlist(highd(1),highd(2)) stop;
end;