小幫手你好,我寫了一個策略,要抓出午盤以後有開布林的股票 請問這樣有錯嗎
條件1: 股價大於布林上軌(日頻率的布林上軌)
條件2: 預估量爆量(比前日量或五日均量 多1.68倍)
條件3: 月線斜率大於0(月線是上揚的)
執行頻率:5min ,執行時間區段1200-1230
Input: Length(20), UpperBand(2);
settotalbar(3000);
// 高於上軌
SetInputName(1, "期數");
SetInputName(2, "通道上緣");
condition1 = close >= bollingerband(GetField("Close","D"), Length, UpperBand);
//爆量
value1 = GetField("EstimateVolume");
value2 = Average(GetField("Volume", "D")[1], 5); //五日均量
value3 = (GetField("Volume", "D")[1] );//前日量
condition2 = ((value1 > value2 * 1.68 ) OR (value1 > value3 * 1.68)) ;
//月線斜率
value4 = average(GetField("收盤價","D"),20);
condition3 = LinearRegSlope(value4,20) > 0; //計算收盤價20期的線性迴歸線斜率
Begin
if condition1 and condition2 and condition3
then ret=1;
end;
2 評論