人人爽天天爽夜夜爽qc-人人爽天天爽夜夜爽曰-人人天天爱天天做天天摸-人人天天夜夜-色网站在线-色网站在线看

您現在的位置:程序化交易>> 期貨公式>> 交易開拓者(TB)>> 開拓者知識>>正文內容

纏中說禪TB版 [開拓者 TB]

  • 咨詢內容: 本帖最后由 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客服: 繼續你的后期啊大神

    ?

  • 網友回復: 大神,好樣的。

    ?

  • 網友回復:



  • 這就是圖片 附件: 你需要登錄才可以下載或查看附件。沒有帳號?注冊

 

有思路,想編寫各種指標公式,交易模型,選股公式,還原公式的朋友

可聯系技術人員 QQ: 262069696  點擊在線交流或微信號:cxh99cxh99  進行 有償收費 編寫!

怎么收費,代編流程等詳情請點擊閱讀!

(注:由于人數限制,QQ或微信請選擇方便的一個聯系我們就行,加好友時請簡單備注下您的需求,否則無法通過。謝謝您!)


【字體: 】【打印文章】【查看評論

相關文章

    沒有相關內容
主站蜘蛛池模板: 九九99久麻豆精品视传媒 | 国产在线一卡 | 亚洲w码| 国产又爽又黄又不遮挡视频99 | 国产一区曰韩二区欧美三区 | 色噜噜狠狠色综合中国 | 男女羞羞的视频网站在线观看 | 色黄啪啪18周岁以下禁止观看 | 日日摸夜夜添夜夜添一区二区 | 国产精品精品国产一区二区 | 免费乱理伦片在线观看影院 | 麻豆传煤一区免费入 | 看一级黄色毛片 | 亚洲欧美日韩国产综合 | 插射视频 | 伊人网站视频 | 在线观看片成人免费视频 | 78m成人免费视频 | 日本一区二区视频在线观看 | 日韩欧美高清在线 | 亚洲狼人香蕉香蕉在线28 | 国产综合一区二区 | 六月激情丁香 | 可以免费观看的一级毛片 | 色偷偷综合| 射综合网 | 亚洲成人中文 | 亚洲欧美久久婷婷爱综合一区天堂 | 亚洲一区二区三 | 欧美日韩在线观看区一二 | 99ri在线精品视频在线播放 | 日韩午夜小视频 | 欧美黄色片在线播放 | 青青草国拍 | 三级欧美日韩 | 欧美午夜视频在线观看 | 真人一级毛片免费完整视 | 成人免费看片视频色多多 | 重口变态xxxx | 重口变态xxxx | 在线观看色视频网站 |