碗型底

By | 2018-11-05

在型態學上,碗型底是一個可遇不可求的型態,這種碗如果夠大,後面多頭行情就可能走的愈長久,但可惜碗型底要用程式寫出來有點難度,我們試著寫出一個儘量接近的腳本,幫大家挑出可能的碗型底,但由於目標是寧可多挑也不要放過,所以挑中的標的,還需要大家用肉眼再作一次確認。

我們寫的腳本如下

input:t2(60,"敏感度(T)"),S1(true,"T=早訊號,F=晚訊號");
variable:t1(1);
value1=(H+L+O+C)/4;
value2=square(H)+square(L)+square(O)+square(C);

value14+=value2;
if value2[t2]<>0 then value14-=value2[t2];
value15+=value1;
if value1[t2]<>0 then value15-=value1[t2];
value16=(value14-t2*4*square(value15/t2))/(t2*4);

value17=mtm(t2/2);
value18=wma(value17,round(t2*0.2,0));
value19=wma(value16,round(t2*0.2,0));

condition1=s1 and value19<value19[1] and value18>value18[1];
condition3=not s1 and value18 crosses over 0;
if value18 crosses under 0 then condition2=true;
if trueall(value19>value19[1] and value18<value18[1],t2*0.1) then condition4=true;
if (condition1 or condition3) and condition2 and condition4
then begin
 condition2=false;
 condition4=false;
 ret=1;
end;

符合這個腳本的例子如下

c61

這個腳本在多頭市場下的回測報告如下

 

c60

碗型底原本就可遇不可求,這個腳本把條件設的比較寬,挑中的要麻煩大家再檢視一下。