2013年12月26日 星期四

大漲的股票跌破開盤價後未立即站回

      
if barfreq <> "Min" or barinterval <> 1 then RaiseRuntimeError("請設定頻率為1分鐘");
variable:KBarOfDay(0); if Date<> Date[1] then KBarOfDay = 1 else KBarOfDay+=1;
{9.   開高後大幅拉回後橫盤第三次跌破今日低點區(第三次到底而破)}

variable:LowCount(0); if Date<>Date[1] then LowCount=0;
if q_DailyOpen > q_RefPrice *1.02  and  {開高2%以上}
   q_DailyHigh >  Close *1.02  then  {已大幅回檔2%}
   condition1 = true else condition1 =false;
  
if condition1 and Low = Lowest(Low,KBarOfDay) then LowCount+=1;


if LowCount > 3 and AbsValue(close/q_DailyOpen-1) < 0.01 and
   Low < Lowest(Low[1], KBarOfDay-1) {橫盤觸低3 再破低}

then ret=1;

拉尾盤



下午一點以後創今天最高價且漲幅低於2%的非大型股
if barfreq <> "Tick" then RaiseRuntimeError("請設定頻率為TICK");
variable:BarNumberOfToday(0); if Date <> Date[1] then  BarNumberOfToday=1 else  BarNumberOfToday+=1;{記錄今天的Bar}

variable: Half12(0);


if Half12=0 and  Time >130000 then Half12 =BarNumberOfToday; {一過13:00記錄之前的交易筆數}

if Time < 131000 and  BarNumberOfToday > Half12*2  and{10分鐘內就產生了今天13:00前相同的交易筆數}//為何*2?
   q_Last > q_DailyHigh   {來到今天高點}

then ret=1;





多方撤守。 開盤第一個小時一直在平盤上下游走但突然殺破平盤。


if barfreq <> "Tick" then RaiseRuntimeError("請設定頻率為TICK");
variable:BarNumberOfToday(0); if Date <> Date[1] then  BarNumberOfToday=1 else  BarNumberOfToday+=1;{記錄今天的Bar}

if TimeDiff(Time,Time[BarNumberOfToday-1],"M") < 60  and {開盤60分鐘內}
   (q_DailyHigh-q_DailyLow)/q_RefPrice < 0.0 and {振幅小於1%才繼續}
   highest(high,BarNumberOfToday-1) < q_RefPrice *1.005 and {最高在漲0.5%以內}//應可以調到1%以內
   lowest(low,BarNumberOfToday-1) > q_RefPrice *0.995   {最低在跌0.5%以內}//應可以調到1%以內
   then condition1 =true else condition1 =false;


if condition1 and TimeDiff(Time,Time[BarNumberOfToday-1],"M")> 60 and {開盤一小時後}
   q_Last =  q_DailyLow   {來到今天低點}//只是來到今天的低點,說不定這低點跟原來盤整的低點一樣,並沒有出現急殺的情況

then ret=1;







開盤前十五分鐘最低價被更新超過五次且跌幅尚未超過2%


if barfreq <> "Tick" then RaiseRuntimeError("請設定頻率為TICK");
variable:BarNumberOfToday(0); if Date <> Date[1] then  BarNumberOfToday=1 else  BarNumberOfToday+=1;{記錄今天的Bar}

if Date =currentdate  then begin

  variable: Point(0),idx(0),tTime(0);tTime=0;
  Point = intportion( BarNumberOfToday/10);
   for idx = 0 to 9
   begin
      if  Close[idx*Point] < Close[(idx+1)*Point] then  tTime+=1; {下跌時記1}
   end; 
  
   if tTime >=5 and{一路向下過低5}
      Timediff(Time,Time[BarNumberOfToday-1],"M") < 15{分鐘} and {離開盤第1個價15分鐘內}
      q_PriceChangeRatio > -2 {跌幅仍在2%}
   then   ret=1;
  

end;





殺尾盤

12點以後跌破今天多次觸及但一直未跌破的低檔區
if barfreq <> "Min" or barinterval <> 1 then RaiseRuntimeError("請設定頻率為1分鐘");
variable:KBarOfDay(0); if Date<> Date[1] then KBarOfDay = 1 else KBarOfDay+=1;

variable:TouchLowCounter(0),HLRatio12(0),tLow(0);

if Time > 93000 and Low = lowest(Low,KBarOfDay-1) then TouchLowCounter+=1;
{9:30以後觸低次數}

if Time < 120000 then
begin
  HLRatio12 = ((q_DailyHigh-q_DailyLow)/q_RefPrice-1)*100;
  {12:00以前高低點波幅}
  tLow = q_DailyLow;
  {記下低點}
end;

if date=currentdate and  Time > 120000 and Low > 3 and  {今日 12:00有後多次觸及低點}
   HLRatio12 <2 and    tLow > q_RefPrice *0.98  and  {波幅在2%內且12:00前還沒跌超過2%}
   Low = q_DailyLow   {來到今日低點時觸發}//最好帶量跌破才觸發
then ret=1;




大漲後的股票第一次跌破平盤後站回平盤,接著再跌破一次但站不回平盤時,殺


if barfreq <> "Tick" then RaiseRuntimeError("請設定頻率為TICK");
variable:BarNumberOfToday(0); if Date <> Date[1] then  BarNumberOfToday=1 else  BarNumberOfToday+=1;{記錄今天的Bar}


if date=currentdate and date[10] =Date and  {今日曾經大漲}//這邊說的不是當日大漲,而是先前大漲
   Close > Close[10]*1.015 then condition1=true else condition1=false;

if condition1 and close[1] >= q_RefPrice and close < q_RefPrice then
   condition2 =true else condition2 =false;
   {大漲後曾跌破平盤}
  
if condition2 and close = q_RefPrice then condition3 =true else condition3 =false;
   {跌破後曾回到平盤}
  
if q_Last = q_DailyLow  and condition3 {來到今低且前面各種狀況皆成立}

then ret=1;



狹幅長時間盤整後的突破盤整區


if barfreq <> "Min" or barinterval <> 1 then RaiseRuntimeError("請設定頻率為1分鐘");
variable:KBarOfDay(0); if Date<> Date[1] then KBarOfDay = 1 else KBarOfDay+=1;


input:P1(60); setinputname(1,"狹幅盤整計算期間(分鐘)");

if high = q_DailyHigh and  {來到今日最高價}
   KBarOfDay > 30 and {今日至少有30K棒交易}
   TrueAll( AbsValue(Close[1]/Close[2]-1) < 0.005,KBarOfDay-1) and{必需只有小波動}
   AbsValue(  Close[1]/Close[KBarOfDay-1]-1 ) < 0.02 {開盤到前分收K不超過2%}//不一定要押那麼死啦,我是覺得主要是要早盤到發動前的高低點差距不超過2%且每分鐘波動不要太大即可,0.005感覺有點太狹小

then ret=1;

開盤後十五分鐘內一路向上不回頭但漲幅在2%以內


if barfreq <> "Tick" then RaiseRuntimeError("請設定頻率為TICK");
variable:BarNumberOfToday(0); if Date <> Date[1] then  BarNumberOfToday=1 else  BarNumberOfToday+=1;{記錄今天的Bar}

if Date =currentdate  then begin

  variable: Point(0),idx(0),tTime(0);tTime=0;
  Point = intportion( BarNumberOfToday/10);
   for idx = 0 to 9
   begin
      if  Close[idx*Point] > Close[(idx+1)*Point] then  tTime+=1; {推升時記1}
   end; 
  
   if tTime > Point*0.7 and Point>= 3 and{30多個價幾乎一路向上}
      Timediff(Time,Time[BarNumberOfToday-1],"M") < 15{分鐘} and {離開盤第1個價15分鐘內}
      q_PriceChangeRatio < 2 {漲幅仍在2%}
   then   ret=1;
  

end;

小型股出量急拉

  
先前沒量,今天有量且急拉,早盤量就遠超過前幾日均量
if barfreq<> "D" then raiseruntimeerror("請設定頻率為日線");

if q_Last = q_DailyHigh and {來到今日最高}
   Time < 100000 and volume > average(volume,10) and {10點前已出量}
   (q_DailyHigh-q_DailyLow)/q_RefPrice > 0.02  {振幅大於2%}
And average(volume[1],10)<1000//小型股沒量,均量不到一千張

then ret=1;



開高急破平盤後又拉上平盤且站穩


if barfreq <> "Tick" then RaiseRuntimeError("請設定頻率為TICK");
variable:BarNumberOfToday(0); if Date <> Date[1] then  BarNumberOfToday=1 else  BarNumberOfToday+=1;{記錄今天的Bar}

variable: Ref(q_RefPrice);

if q_DailyOpen > q_RefPrice *1.02  and {開高2%}
   (q_DailyHigh-q_DailyLow)/q_RefPrice > 0.05 and {振幅大於5%}
        q_DailyLow < q_RefPrice  and{曾跌破平盤}
        TrueAll(Close > Ref ,5 ) {連續5筆都在盤上}
then ret=1;



開高後大幅拉回後橫盤第三次跌破今日低點區(第三次到底而破)

 開高後大幅拉回後橫盤第三次跌破今日低點區(第三次到底而破)

if barfreq <> "Tick" then RaiseRuntimeError("請設定頻率為TICK");
variable:BarNumberOfToday(0); if Date <> Date[1] then  BarNumberOfToday=1 else  BarNumberOfToday+=1;{記錄今天的Bar}

variable:idx(0),adx(0),temp(0),H1(0),H2(0),M1(0),Mp(0);
array:arr[500](0);

if Time <93000 and Close[1] >= q_RefPrice and Close < q_RefPrice and{9:30前跌破平盤}
   q_DailyOpen > q_RefPrice *1.01 then {開高}
begin {兩次急殺搜尋}

{先去雜訊}

arr[adx] =  Close[BarNumberOfToday-1];
for  idx = BarNumberOfToday-2 to 0
begin
     if Close[idx] <> arr[adx] then adx+=1;
         arr[adx]=Close[idx];
end;

{先找到兩次急殺中Peak 低點}
for idx = 0 to adx
begin

if  arr[idx] < arr[idx-1]  and  arr[idx] < arr[idx-2]  and
    arr[idx] < arr[idx+1]  and  arr[idx] < arr[idx+2]  then
        begin M1 = arr[idx] ; Mp = idx; end;
end;

if M1 < q_RefPrice then return ; {如果已殺破平盤則不予考慮}


{找到第一次起跌的最高點}
for idx = 0 to Mp
begin
    if  arr[idx] > arr[idx-1]  and  arr[idx] > arr[idx-2]  and
                arr[idx] >arr[idx+1]  and  arr[idx] > arr[idx+2]  then
            H1 = arr[idx] ;
end;

if H1 < M1*1.01 then return; {第一次起跌跌不到 1% 則不考慮}

{找到第2次起跌的最高點}
for idx = Mp to adx
begin
    if  arr[idx] > arr[idx-1]  and  arr[idx] > arr[idx-2]  and
                arr[idx] >arr[idx+1]  and  arr[idx] > arr[idx+2]  then
            H2 = arr[idx] ;
end;

if H2 > Close *1.01 then ret=1; {第二次高點跌下1%以上破平盤則觸發}


end;




盤中漲停後打到盤下,砍不死又帶量攻


if barfreq <> "Tick" then RaiseRuntimeError("請設定頻率為TICK");
variable:BarNumberOfToday(0); if Date <> Date[1] then  BarNumberOfToday=1 else  BarNumberOfToday+=1;{記錄今天的Bar}

if q_DailyUplimit > q_DailyOpen and q_DailyHigh = q_DailyUplimit and{開盤後曾拉上漲停}
   (q_DailyHigh-q_DailyLow)/q_RefPrice > 0.07 and {振幅大於7%}
    Close > close[10]*1.015  and   {快速漲1.5%}
    Close > close[5]   and         {連續漲升}
        timediff(time,time[10],"M")< 3{分鐘} and    {3分鐘內快速拉升}
        summation(Volume,10) >100{}

then ret=1;



開盤處理融資追繳後的反彈


融資大減,股價自高點己跌超過三成,昨天大跌,今天下殺有量
if barfreq<> "D" then raiseruntimeerror("請設定頻率為日線");
融資斷頭開盤價必大跌,這點要處理
if  Close > Low *1.02 and Close > Open and  {現價從低點反彈2%且漲過開盤價}
    Volume > Volume[1]*0.6 and  {下影線有出量}
        Trueall( GetField("融資增減張數")[1]<0,10) and {融資連減10}
    Low = Lowest(Low,30) and Low < Highest(high,30)*0.7  {今日低價是近期低價,且離高點30%}
then ret=1;




   

急拉後不回檔,且當日漲幅尚不到2%


if barfreq <> "Tick" then RaiseRuntimeError("請設定頻率為TICK");
variable:BarNumberOfToday(0); if Date <> Date[1] then  BarNumberOfToday=1 else  BarNumberOfToday+=1;{記錄今天的Bar} 這一段用不到

IF   Close < q_RefPrice *1.02 and close > q_RefPrice and {股價上漲幅度在2%以內}//參考價代表的是昨天的收盤價乎?
     Close> Close[1] and Close * Volume>250 and {觸發筆上漲且買進幅度超過25}
     Close > close[10]*1.01  and   {快速漲1%}
     Close > close[5]   and        {連續漲升}//
         Date[10] =currentdate and
         timediff(time,time[10],"M")< 3{分鐘}     {3分鐘內快速拉升}

then ret=1;




整天價量背離,尾盤開殺

  
if barfreq <> "Min" then RaiseRuntimeError("請設定頻率為分鐘");
var:PV(0),NV(0);
{計算價量背離定義之正向量與負向量}
if Date <> Date[1] then
 if Close > Close[1] then PV=volume else if Close < Close[1] then NV=Volume
else
 if Close > Close[1] then PV+=volume else if Close < Close[1] then NV+=Volume;

if  currenttime > 123000 and  {12:30以後}
    q_last < q_DailyHigh *0.98 and Close < q_RefPrice and   Close[1] >= q_RefPrice  and
        {從高點往下跌2%破平盤}//這條件要不要改成開始急殺破開盤價
    NV > PV *3  {價量背離}

then ret=1;



盤下出現帶量的火箭噴出


if barfreq <> "Tick" then RaiseRuntimeError("請設定頻率為TICK");
variable:BarNumberOfToday(0); if Date <> Date[1] then  BarNumberOfToday=1 else  BarNumberOfToday+=1;{記錄今天的Bar}

IF   Close < q_RefPrice and {還在盤下}
     Close> Close[1] and Close * Volume>250 and {觸發當筆上漲且買進幅度超過25}
     close > close[10]* 1.015  and  {快速漲1.5%}
     date[10] =currentdate and       
         close > close[5]   and         {連續漲升}
         timediff(time,time[10],"M")< 3  and   {3分鐘內急拉升}
         summation(volume,10)> 100{}   {上漲段總量要大於100}

then  ret=1;




下殺後反彈過今高

if barfreq <> "Tick" then RaiseRuntimeError("請設定頻率為TICK");
variable:BarNumberOfToday(0); if Date <> Date[1] then  BarNumberOfToday=1 else  BarNumberOfToday+=1;{記錄今天的Bar}

if (q_Last > q_RefPrice and)//這邊有必要嗎? 一定要比昨天收盤高嗎? q_Last > q_DailyOpen and
   q_Last = q_DailyHigh and  {現價要上漲,漲過開盤價,且是今天高點}
   q_Last >= q_DailyLow*1.02 {要有2%下影線,表示開盤後曾下跌}//這邊用參數讓user決定要下殺幾%會不會好一點?

then ret=1;




中多排列開盤殺到近跌停而沒關門

if barfreq <> "Tick" then RaiseRuntimeError("請設定頻率為TICK");
variable:BarNumberOfToday(0); if Date <> Date[1] then  BarNumberOfToday=1 else  BarNumberOfToday+=1;{記錄今天的Bar}

if  q_Last  = q_DailyHigh and {如果現價走到今日最高}
    q_DailyOpen < q_RefPrice *0.97 and {今日開低3%以上}
    q_DailyLow < q_DailyDownlimit*1.01 and  q_DailyLow > q_DailyDownlimit then {最低價逼近跌停但沒有跌停}到底距跌停?%可以讓USER自己設
begin  {一次性定點抽樣評分法:上升走勢}

  variable: Point(0),idx(0),tTime(0);tTime=0;
  Point = intportion( BarNumberOfToday/10);
   for idx = 0 to 9
   begin
      if  Close[idx*Point] > Close[(idx+1)*Point] then  tTime+=1; {推升時記1}
   end;

   if tTime > Point*0.7 and time<100000 then  ret=1; {10點前一路走升}
end;

紅字這段看不懂