纏中說禪TB版
作者:開拓者 TB 來源:cxh99.com 發布時間:2023年09月28日
-
咨詢內容:
本帖最后由 binzhiyao 于 2015-8-9 15:28 編輯
本人最近在學習 纏論 ,在學習的過程中嘗試量化.
以下是源碼, 希望熟悉纏論的朋友可以指教.
本人QQ:110951948 請多多指教
網絡狀況好的時候再補上圖
-------------------------K線(顯示的時候需要設置成柱狀)-------------------------
Params
? ? ? ? NumericSeries s_czsc_high;
? ? ? ? NumericSeries s_czsc_low;
? ? ? ? NumericSeries s_direction;
? ? ? ? NumericSeries s_status;
? ? ? ? //包含
? ? ? ? NumericRef czsc_high;? ? ? ? ? ? ? ? //當前K線高點
? ? ? ? NumericRef czsc_low;? ? ? ? ? ? ? ? //當前K線低點
? ? ? ? //分型
? ? ? ? NumericRef direction;? ? ? ? ? ? ? ? //當前K線方向
? ? ? ? NumericRef status;? ? ? ? ? ? ? ? ? ? ? ? //當前K線狀態(0.表示延續方向 1.表示K線轉變方向)
? ? ? ?
Begin
? ? ? ? If(s_czsc_high>0 or s_czsc_low>0){? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? //存在纏中說禪K線的
? ? ? ? ? ? ? ? If((s_czsc_high>High and s_czsc_low<Low) or (High>s_czsc_high and Low<s_czsc_low)){? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? //是否存在包含關系
? ? ? ? ? ? ? ? ? ? ? ? If(s_direction>0){? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? //依據上一根K線方向確定當前K線方向
? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? direction=1; status=0;
? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? czsc_high=Max(s_czsc_high,High); czsc_low=Max(s_czsc_low,Low);? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? //更新最高點和最低點
? ? ? ? ? ? ? ? ? ? ? ? }
? ? ? ? ? ? ? ? ? ? ? ? Else If(s_direction<0){
? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? direction=-1; status=0;
? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? czsc_high=Min(s_czsc_high,High); czsc_low=Min(s_czsc_low,Low);
? ? ? ? ? ? ? ? ? ? ? ? }
? ? ? ? ? ? ? ? }
? ? ? ? ? ? ? ? Else{? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? //不存在包含關系
? ? ? ? ? ? ? ? ? ? ? ? If(s_direction>0){ ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? //依據上一根K線方向確定當前K線方向
? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? If(High<s_czsc_high){? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? //是否發生轉向
? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? direction=-1; status=1;
? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? czsc_high=High; czsc_low=Low;
? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? }Else{
? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? direction=1; status=0;
? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? czsc_high=Max(s_czsc_high,High); czsc_low=Max(s_czsc_low,Low);
? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? }
? ? ? ? ? ? ? ? ? ? ? ? }
? ? ? ? ? ? ? ? ? ? ? ? Else If(s_direction<0){
? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? If(Low>s_czsc_low){
? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? direction=1;status=1;
? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? czsc_high=High; czsc_low=Low;
? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? }Else{
? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? direction=-1; status=0;
? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? czsc_high=Min(s_czsc_high,High); czsc_low=Min(s_czsc_low,Low);
? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? }
? ? ? ? ? ? ? ? ? ? ? ? }
? ? ? ? ? ? ? ? }? ? ? ?
? ? ? ? }
? ? ? ? Else{
? ? ? ? ? ? ? ? If((High>High[1] and Low<Low[1]) or (High[1]>High and Low[1]<Low)){? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? //當不存在纏中說禪K線時用K線高低點作為依據判斷存在包含關系
? ? ? ? ? ? ? ? ? ? ? ? If(High[1]>High[2]){? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? //判斷方向
? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? direction=1; status=0;
? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? czsc_high=Max(High[1],High); czsc_low=Max(Low[1],Low);
? ? ? ? ? ? ? ? ? ? ? ? }
? ? ? ? ? ? ? ? ? ? ? ? Else If(Low[1]<Low[2]){
? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? direction=-1; status=0;
? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? czsc_high=Min(High[1],High); czsc_low=Min(Low[1],Low);
? ? ? ? ? ? ? ? ? ? ? ? }
? ? ? ? ? ? ? ? }Else{
? ? ? ? ? ? ? ? ? ? ? ? If(High[2]<High[1]){
? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? If(High[1]>High){
? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? direction=-1; status=1;
? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? czsc_high=High; czsc_low=Low;
? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? }Else{
? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? direction=1; status=0;
? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? czsc_high=Max(High[1],High); czsc_low=Max(Low[1],Low);
? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? }
? ? ? ? ? ? ? ? ? ? ? ? }
? ? ? ? ? ? ? ? ? ? ? ? Else If(Low[2]>Low[1]){
? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? If(Low[1]<Low){
? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? direction=1; status=1;
? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? czsc_high=High; czsc_low=Low;
? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? }Else{
? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? direction=-1; status=0;
? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? czsc_high=Min(High[1],High); czsc_low=Min(Low[1],Low);
? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? }
? ? ? ? ? ? ? ? ? ? ? ? }
? ? ? ? ? ? ? ? }
? ? ? ? }
? ? ? ? If(czsc_low>0 or czsc_high>0){
? ? ? ? ? ? ? ? PlotNumeric("czsc",czsc_low,czsc_high);? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? //輸出纏中說禪K線
? ? ? ? ? ? ? ? Commentary("("+Text(direction)+","+Text(status)+")");
? ? ? ? }? ? ? ?
? ? ? ? Return True;
End
-------------------------筆-------------------------
Params
? ? ? ? NumericSeries s_czsc_high;
? ? ? ? NumericSeries s_czsc_low;
? ? ? ? NumericSeries s_direction;
? ? ? ? NumericSeries s_status;
? ? ? ? NumericSeries s_pen;? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? //11 表示底? ? ? ? 10 表示上行? ? ? ? -11表示頂? ? ? ? -10表示下行
? ? ? ?
? ? ? ? NumericRef pen;
Vars
? ? ? ? Numeric i(0);
Begin
? ? ? ? If(s_status==0){? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? //如果還沒開始則延續狀態
? ? ? ? ? ? ? ? pen = s_direction*10;
? ? ? ? }
? ? ? ? Else{
? ? ? ? ? ? ? ? While(i<50){If(s_pen==11 or s_pen==-11){break;}i=i+1;}? ? ? ? //回溯50個纏中說禪筆,直至符合條件中斷(50可根據周期自定義)
? ? ? ? ? ? ? ? If(s_pen==10 or s_pen==-10){? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? //如果回溯50個仍沒符合條件的則延續狀態
? ? ? ? ? ? ? ? ? ? ? ? If(s_direction>0){
? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? pen = s_direction*10+s_status;
? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? PlotString("l","|",s_czsc_low);
? ? ? ? ? ? ? ? ? ? ? ? }
? ? ? ? ? ? ? ? ? ? ? ? else{
? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? pen = s_direction*10-s_status;
? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? PlotString("u","|",s_czsc_high);
? ? ? ? ? ? ? ? ? ? ? ? }
? ? ? ? ? ? ? ? }
? ? ? ? ? ? ? ? Else{
? ? ? ? ? ? ? ? ? ? ? ? If(i<3){? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? //i為相隔的bar數,相隔的Kbar數不符合筆的要求則維持原來狀態
? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? pen = s_direction[1]*10;? ? ? ?
? ? ? ? ? ? ? ? ? ? ? ? }
? ? ? ? ? ? ? ? ? ? ? ? Else{
? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? If(s_direction==1 and s_pen==11){? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? //同方向轉變狀態的,則比較哪個更低或更高,留下更低的或更高的或保持狀態
? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? If(s_czsc_low[1]<s_czsc_low[i+2]){
? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? pen = s_direction*10+s_status;
? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? PlotString("l","|",s_czsc_low);
? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? Unplot("p",i+1);
? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? PlotNumeric("p",s_czsc_low);
? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? }
? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? Else{
? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? pen = s_direction[1]*10;
? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? }
? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? }
? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? Else If(s_direction==-1 and s_pen==-11){
? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? If(s_czsc_high[1]>s_czsc_high[i+2]){
? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? pen = s_direction*10-s_status;
? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? PlotString("u","|",s_czsc_high);
? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? Unplot("p",i+1);
? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? PlotNumeric("p",s_czsc_high);
? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? }
? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? Else{
? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? pen = s_direction[1]*10;
? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? }
? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? }
? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? Else{? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? //不同方向的則需要依據當前方向判斷前后兩個分型之間有沒有重疊,有重疊則無效,無重疊則確認為筆
? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? If(s_direction>0){
? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? If(s_czsc_high[1]<s_czsc_low[i+2]){
? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? pen = s_direction*10+s_status;
? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? PlotString("l","|",s_czsc_low);
? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? PlotNumeric("p",s_czsc_low);
? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? }else{
? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? pen = s_direction[1]*10;
? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? }? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?
? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? }
? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? else{
? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? If(s_czsc_low[1]>s_czsc_high[i+2]){
? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? pen = s_direction*10-s_status;
? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? PlotString("u","|",s_czsc_high);
? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? PlotNumeric("p",s_czsc_high);
? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? }else{
? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? pen = s_direction[1]*10;
? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? }? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?
? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? }
? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? }
? ? ? ? ? ? ? ? ? ? ? ? }
? ? ? ? ? ? ? ? }
? ? ? ? }
? ? ? ? Return True;
End
-------------------------段-------------------------
Params
? ? ? ? NumericSeries s_czsc_high;
? ? ? ? NumericSeries s_czsc_low;
? ? ? ? NumericSeries s_pen;
? ? ? ? NumericSeries s_duan;? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? //1表示段點? ? ? ? 0表示非段點
? ? ? ? NumericRef duan;
Vars
? ? ? ? Numeric i(0);? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? //當前回溯的bar數
? ? ? ? Numeric pre_i(0);? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? //上次回溯的bar數
? ? ? ? Numeric last_pen(0);? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? //最后一筆的最后一個分型的最高點或最低點
Begin
? ? ? ? duan=0;? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? //初始化段
? ? ? ? If(s_pen==11 or s_pen==-11){? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? //當筆的時候則開始往前回溯是否形成段
? ? ? ? ? ? ? ? While(i<60){? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? //第一次回溯(60可依據周期調整)
? ? ? ? ? ? ? ? ? ? ? ? If(s_pen==s_pen){? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? //如果同向則清除上一次的段
? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? Unplot("d",i);
? ? ? ? ? ? ? ? ? ? ? ? }
? ? ? ? ? ? ? ? ? ? ? ? Else If(s_pen==-1*s_pen){? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? //如果不同向則進入第二輪回溯
? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? pre_i=i;break;
? ? ? ? ? ? ? ? ? ? ? ? }
? ? ? ? ? ? ? ? ? ? ? ? i=i+1;
? ? ? ? ? ? ? ? }
? ? ? ? ? ? ? ? If(s_pen==-1*s_pen and s_duan[i-1]==0){? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? //方向相反且不是段點,則進入第二輪回溯
? ? ? ? ? ? ? ? ? ? ? ? While(i<60+pre_i){
? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? If(s_pen==s_pen){pre_i=i;break;}i=i+1;
? ? ? ? ? ? ? ? ? ? ? ? }
? ? ? ? ? ? ? ? ? ? ? ? If(s_pen==s_pen and s_duan[i-1]==0){? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? //方向相同且不是段點,則進入第三輪回溯
? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? While(i<60+pre_i){
? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? If(s_pen==-1*s_pen){pre_i=i;break;}i=i+1;
? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? }
? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? If(s_pen==-1*s_pen){? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? //段的頭尾分型的方向是相反的
? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? If(s_pen==11){? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? //如果尾部是底,則頭部是頂,那么頂部最低點大于等于底部最低點則為有效段
? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? If(s_czsc_low>=s_czsc_low){duan=1;}
? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? }
? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? Else If(s_pen==-11){? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? //如果尾部是頂,則頭部是底,那么頂部最高點小于等于底部最高點則為有效段
? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? If(s_czsc_high<=s_czsc_high){duan=1;}
? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? }
? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? }
? ? ? ? ? ? ? ? ? ? ? ? }
? ? ? ? ? ? ? ? }
? ? ? ? }
? ? ? ? If(duan>0){? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? //輸出段點
? ? ? ? ? ? ? ? If(s_pen==11){PlotNumeric("d",s_czsc_low);}Else{PlotNumeric("d",s_czsc_high);}
? ? ? ? }
? ? ? ? Return True;
End
-------------------------測試-------------------------
Vars
? ? ? ? NumericSeries s_czsc_high;
? ? ? ? NumericSeries s_czsc_low;
? ? ? ? NumericSeries s_direction;
? ? ? ? NumericSeries s_status;
? ? ? ?
? ? ? ? NumericSeries s_pen_value;
? ? ? ? //包含
? ? ? ? Numeric czsc_high;
? ? ? ? Numeric czsc_low;
? ? ? ? Numeric direction;
? ? ? ? Numeric status;
? ? ? ?
? ? ? ? //分型和筆
? ? ? ? NumericSeries s_pen;
? ? ? ? Numeric pen;
? ? ? ? //段
? ? ? ? NumericSeries s_duan;
? ? ? ? Numeric duan;
Begin
? ? ? ? czsc_k(s_czsc_high,s_czsc_low,s_direction,s_status,czsc_high,czsc_low,direction,status);
? ? ? ? s_czsc_high=czsc_high; s_czsc_low=czsc_low; s_direction=direction; s_status=status;
? ? ? ?
? ? ? ? czsc_pen(s_czsc_high,s_czsc_low,s_direction,s_status,s_pen,pen);
? ? ? ? s_pen=pen;
? ? ? ? czsc_duan(s_czsc_high,s_czsc_low,s_pen,s_duan,duan);
? ? ? ? s_duan=duan;
? ? ? ?
? ? ? ? Commentary("czsc_high2:"+Text(czsc_high));
? ? ? ? Commentary("czsc_low2:"+Text(czsc_low));
End
?
?來源:CXH99.COM
-
TB技術人員:
真心不錯
但說好的“補上圖”呢?
?
-
TB客服:
繼續你的后期啊大神
?
-
網友回復:
大神,好樣的。
?
-
網友回復:
這就是圖片 |
附件: 你需要登錄才可以下載或查看附件。沒有帳號?注冊