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

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

  • 咨詢內(nèi)容: 本帖最后由 binzhiyao 于 2015-8-9 15:28 編輯

    本人最近在學(xué)習(xí) 纏論 ,在學(xué)習(xí)的過程中嘗試量化.
    以下是源碼, 希望熟悉纏論的朋友可以指教.
    本人QQ:110951948 請多多指教

    網(wǎng)絡(luò)狀況好的時候再補上圖

    -------------------------K線(顯示的時候需要設(shè)置成柱狀)-------------------------
    Params
    ? ? ? ? NumericSeries s_czsc_high;
    ? ? ? ? NumericSeries s_czsc_low;
    ? ? ? ? NumericSeries s_direction;
    ? ? ? ? NumericSeries s_status;

    ? ? ? ? //包含
    ? ? ? ? NumericRef czsc_high;? ? ? ? ? ? ? ? //當(dāng)前K線高點
    ? ? ? ? NumericRef czsc_low;? ? ? ? ? ? ? ? //當(dāng)前K線低點
    ? ? ? ? //分型
    ? ? ? ? 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);? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? //更新最高點和最低點
    ? ? ? ? ? ? ? ? ? ? ? ? }
    ? ? ? ? ? ? ? ? ? ? ? ? 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線時用K線高低點作為依據(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個纏中說禪筆,直至符合條件中斷(50可根據(jù)周期自定義)
    ? ? ? ? ? ? ? ? If(s_pen==10 or s_pen==-10){? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? //如果回溯50個仍沒符合條件的則延續(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)的,則比較哪個更低或更高,留下更低的或更高的或保持狀態(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)前方向判斷前后兩個分型之間有沒有重疊,有重疊則無效,無重疊則確認為筆
    ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? 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);? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? //當(dāng)前回溯的bar數(shù)
    ? ? ? ? Numeric pre_i(0);? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? //上次回溯的bar數(shù)
    ? ? ? ? Numeric last_pen(0);? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? //最后一筆的最后一個分型的最高點或最低點
    Begin
    ? ? ? ? duan=0;? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? //初始化段
    ? ? ? ? If(s_pen==11 or s_pen==-11){? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? //當(dāng)筆的時候則開始往前回溯是否形成段
    ? ? ? ? ? ? ? ? While(i<60){? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? //第一次回溯(60可依據(jù)周期調(diào)整)
    ? ? ? ? ? ? ? ? ? ? ? ? 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技術(shù)人員: 真心不錯
    但說好的“補上圖”呢?

    ?

  • TB客服: 繼續(xù)你的后期啊大神

    ?

  • 網(wǎng)友回復(fù): 大神,好樣的。

    ?

  • 網(wǎng)友回復(fù):



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

 

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

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

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

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


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

相關(guān)文章

    沒有相關(guān)內(nèi)容
主站蜘蛛池模板: 好男人官网资源在线观看| 91影院在线观看| 日韩午夜在线视频| 全彩口工彩漫画无遮漫画| 麻豆久久婷婷综合五月国产| 国产精品户外野外| 97久人人做人人妻人人玩精品| 成人18网址在线观看| 久久久亚洲欧洲日产国码aⅴ| 男人扒开女人下面狂躁动漫版| 国产va免费精品高清在线| 91丨九色丨蝌蚪3p| 女人战争之肮脏的交易| 两性色午夜视频免费网| 日本24小时www| 久久国产综合精品swag蓝导航 | 又粗又硬又爽的三级视频| 6080午夜一级毛片免费看6080夜福利| 天天躁夜夜躁天干天干2020| 五月天婷婷丁香| 欧美日韩国产一区二区| 变态Sm天堂无码专区| 色偷偷亚洲女人天堂观看欧| 国产自无码视频在线观看| 99久久精品午夜一区二区| 无人视频免费观看免费视频 | 亚洲一区二区三区不卡在线播放| 精品一区二区三区无码免费直播 | 欧美另类视频videosbest18| 再深点灬舒服灬太大了免费视频| 色综合天天综合高清网国产| 国产精品免费观看| 91免费播放人人爽人人快乐| 国自产拍91大神精品| 中文字幕在线电影观看| 日本VA欧美VA精品发布| 久久亚洲精品人成综合网| 欧美性a欧美在线| 亚洲日韩欧洲无码av夜夜摸| 欧美金发大战黑人video| 亚洲狠狠婷婷综合久久蜜芽|