在諸多先賣後買的當沖策略中,跟人性最有關係的,莫過於
以下附上公司高手針對這個策略所寫的腳本
1if barfreq <> "Tick" then RaiseRuntimeError("請設定頻率為TICK"); 2variable:BarNumberOfToday(0); if Date <> Date[1] then 3BarNumberOfToday=1 else BarNumberOfToday+=1;{記錄今天的Bar數} 4 5if date=currentdate and date[10] =Date and {今日曾經大漲} 6Close > Close[10]*1.015 then condition1=true else condition1=false; 7 8if condition1 and close[1] >= q_RefPrice and close < q_RefPrice then 9condition2 =true else condition2 =false; 10{大漲後曾跌破平盤} 11 12if condition2 and close = q_RefPrice then condition3 =true 13else condition3 =false; 14{跌破後曾回到平盤} 15 16if q_Last = q_DailyLow and condition3 {來到今低且前面各種狀況皆成立} 17then ret=1;