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