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

您現(xiàn)在的位置:程序化交易>> 期貨公式>> 金字塔等>> 金字塔知識>>正文內(nèi)容

幫我看下我編寫的東西好嗎為什么出現(xiàn)句末木有分號 [金字塔]

  • 咨詢內(nèi)容: 剛剛用金字塔格式的傳上去不能正常顯示,這個(gè)是TXT文檔的類型 下載信息  [文件大?。?nbsp;  下載次數(shù): ]點(diǎn)擊瀏覽該文件:123.txt

     

  • 金字塔客服: 以前說程序不能直接復(fù)制到回復(fù)區(qū),現(xiàn)在就放在TXT文檔中

     

  • 用戶回復(fù): 已經(jīng)出現(xiàn)了好幾次這種情況了。有點(diǎn)郁悶

     

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


    //開始編寫屬于您自己的交易指標(biāo)吧!GO!

    //該模型為簡單示范模型,用戶需根據(jù)自己交易經(jīng)驗(yàn),修改完善后再實(shí)際應(yīng)用!!!

    //author: fjasmine


    input: t20(20,15,60,1);//參數(shù)名,缺省值,最小值,最大值,步長
    input: t10(10,10,30,1);

    input: atrlen(20,15,30,1);

    input: posnum(1,1,20,1);

    variable:daycount=1,positioncount=1,sellsign=0;//定義了三個(gè)常數(shù)變量,分別賦值

    variable:entandexitsign=1,entpoint=0,exitpoint=0;//定義了三個(gè)常數(shù)變量,分別賦值

    variable:n=0;//定義常數(shù)變量N,初始化值為0

     
    ma1:ma(c,5);//輸出五日均價(jià)

    ma2:ma(c,10);//輸出十日均價(jià)

    m:=ma(tr,20);//輸出20日均價(jià)

    buyhhv:=hhv(h,20);//20日最高價(jià)

    sellllv:=llv(l,10);//20日最低價(jià)

     

    ss:n,linethick0;


    nt:=1;//調(diào)試信息帶有時(shí)間戳

    buyorderthisbar:=0;//當(dāng)前BAR有過交易

     
    variable: _debug = 1; //是否輸出前臺的交易指令

    variable: _tdebug = 1;    //是否輸出后臺的交易指令

    variable: _debugout = 0;  //是否輸出后臺交易的調(diào)試信息

     

    variable: myentryprice = 0;//開倉價(jià)格

    variable: myxitprice = 0;//平倉價(jià)格

     

    variable: turtleunits = 0;//交易單位

    variable: position = 0;//倉位狀態(tài)

     

    //0表示沒有倉位,1表示持有多頭,-1表示持有空頭

     

    variable: t20hi=close;

    variable: t20lo=close;

     

    variable: t10hi=close;

    variable: t10lo=close;

     

    //需要準(zhǔn)備計(jì)算的變量

    t20hi=:ref(hhv(h,t20),1);//

    t20lp=:ref(llv(h,t20),1);//

     

    t10hi=:ref(hhv(h,t10),1);

    t10lo=:ref(llv(h,t10),1);

     

    avgtr:=ref(ma(tr,atrlen),1);

     

    //開始執(zhí)行時(shí),初始化數(shù)據(jù)

     

    if barpos = 1 then begin

     //position : = 0;

     

     end//if

     

     //如果是當(dāng)時(shí)沒有持倉的狀態(tài)

    if position=0 and barpos > t20 andh>l then begin

     

           //建立多頭進(jìn)場條件

         

           long:=h>t20hi;

         

           //多頭進(jìn)場

           iflong then begin

                  myentryprice:=if(open>t20hi+mindiff,open,t20hi+mindiff);

                  buy(_debug,posnum,limitr,myentryprice);

                  position:=1;

                  turtleunits:=1;

                  n:=avgtr;

                  buyorderthisbar:=1;

                

                  end//IF

         

           //建立空頭進(jìn)場條件

           short:=l<t20lo;

         

           //空頭進(jìn)場

           ifshort and position=0 then begin

                         myentryprice:=if(open<t20lo-mindiff,open,t20lo-mindiff);

                         buyshort(_debug,posnum,limitr,myentryprice);

                         position:=-1;

                         turtleunits:=1;

                         n:=avgtr;

                         buyorderthisbar:=1;

                  end

                 //不要轉(zhuǎn)跳,讓程序檢查同一根K線是否可以加倉

                  //gotocontinueline;

                

           end//if

         

           //如果當(dāng)前持有多頭倉位的狀態(tài)

           ifposition=1 and barpos>t20 and h>l then begin

                  //多頭加倉條件

                  while(high>myentryprice+0.5*n) and turtleunits < 4 do begin

                  myentryprice:=if(open>myentryprice+0.5*n,open,myentryprice+0.5*n);

                  myentryprice:=ceiling(myentryprice/mindiff)*mindiff;

                  buy(_debug,posnum,limitr,myentryprice);

                  turtleunits:=turtleunits+1;

                  buyorderthisbar:=1;

                

           end//while循環(huán)結(jié)束

         

         

           //建立多頭離場條件

           longx1:=(low<t10lo);

         

           iflongx1 and buyorderthisbar=0 then begin

                  myexitprice:=if(open<t10lo-mindiff,open,t10lo-mindiff);

                  sell(_debug,0,limitr,myexitprice);

                  position:=0;

                  turtleunits:=0;

           end

         

         

           //建立多頭止損條件

           longx2:= (low<myentryprice-2*n);

         

           iflongx2 and position = 1 and buyorderthisbar=0 then begin

                  myexitprice:=if(open<myentryprice-2*n,open,myentryprice-2*n);

                  myexitprice:=floor(myexitprice/mindiff)*mindiff;

                  sell(_debug,0,limitr,myexitprice);

                  position:=0;

                  turtleunits:=0;

           end

         

           goto  continueline;

     

    end //if

    if barpos >= 21  or barpos=21 then begin//如果從上市到交易日大于21天那么

    if barpos =21 then//如果從上市到現(xiàn)在加以日等于21,那么

    n:=m;//n=m

    if daycount =6 or barpos = 21 then begin//五天調(diào)整N值

    n:=(19*n+tr)/20;//計(jì)算N的值

    daycount:=2;

    end

    daycount:=daycount+1;

    entpoint:=enterbars+1;

    if entpoint=entandexitsign then begin//說明stop指令買進(jìn)頭寸成功

    positioncount:=positioncount+1;//頭寸計(jì)數(shù)

    sellsign:=true;//開始以stop賣出,如果達(dá)到指定的價(jià)格

    end

    if positioncount=1 then begin//第一頭寸

    how:=cash(0)*0.01/n;//波動(dòng)性百分比決定頭寸規(guī)模

    open1:buy(h>=enterprice+0.5*n,how,market);//在20日新高stop指令買進(jìn)

    end

    if positioncount = 2 then begin//第二頭寸

    how:=cash(0)*0.01/n;//波動(dòng)性百分比決定頭寸規(guī)模

    open2:buy(h>enterprice+0.5*n,how,market);//在上頭寸(即第一頭寸)+0.5個(gè)N新高stop指令買進(jìn)

    end

    if positioncount=3 then begin//第三頭寸

    how:=cash(0)*0.01/n;//波動(dòng)性百分比決定頭寸規(guī)模

    open3:buy(h>=enterprice+0.5*n,how,market);//在上頭寸(即第二頭寸)+0.5個(gè)N新高stop指令買進(jìn)

    end

    if positioncount = 4 then begin //第四頭寸

    how:=cash(0)*0.01/n;//波動(dòng)性百分比決定頭寸規(guī)模

    open4:buy(h>=enterprice+0.5*n,how,market);     //在上頭寸(即第三頭寸)+0.5個(gè)N新高stop指令買進(jìn)

    end

     

    if sellsign = true then begin

           exitpoint:=exitbars+1;

           ifexitpoint = entandexitsign then begin //說明賣出成功

                  positioncount:=1;{頭寸計(jì)算復(fù)原}

                  sellsign:=false;

           end

           ifenterprice-2*n then sell(l<sellllv,100%,market);{退出虧損頭寸}

                  else

                  sell(l<enterprice-2*n,100%,market);

           end

    end

     
     
    //顯示賬號信息:

     

    continueline@ mycount:asset,linethick0;//顯示我的資產(chǎn)

    available_cash:cash(0),linethick0;//可用現(xiàn)金

    pos:holding,linethick0;

    toaldaytrade1:totaldaytrade,linethick0;//總交易次數(shù)

     

    if _debugout>0 then begin

           debugfile2('c:debugfile.txt','barpos=%.of',barpos,nt);

           debugfile2('c:debugfile.txt','t20hi=%.2f',t20hi,nt);

           debugfile2('c:debugfile.txt','n=%.2f',n,nt);

           debugfile2('c:debugfile.txt','close=%.2f',c,nt);

           debugfile2('c:debugfile.txt','position=%.2f',position,nt);

           debugfile2('c:debugfile.txt','turtleunits=%.of',turtleunits,nt);

           debugfile2('c:debugfile.txt','myentryprice=%.of',myentryprice,nt);

           debugfile2('c:debugfile.txt','myexitprice=%.of',myexitprice,nt);

    end


    the currentposition:holding,colorgray,linethick0;//當(dāng)前持倉

    the currentcaptal:asset,noaxis,colorgray;//當(dāng)前資產(chǎn)

     

     

     

    改好了,但是你這個(gè)很多變量后面少了空格是什么情況?

    [此貼子已經(jīng)被作者于2013/7/30 9:31:14編輯過]

     

  • 網(wǎng)友回復(fù): 以下是引用jinzhe在2013/7/30 9:30:41的發(fā)言:


    //開始編寫屬于您自己的交易指標(biāo)吧!GO!

    //該模型為簡單示范模型,用戶需根據(jù)自己交易經(jīng)驗(yàn),修改完善后再實(shí)際應(yīng)用!!!

    //author: fjasmine


    input: t20(20,15,60,1);//參數(shù)名,缺省值,最小值,最大值,步長
    input: t10(10,10,30,1);

    input: atrlen(20,15,30,1);

    input: posnum(1,1,20,1);

    variable:daycount=1,positioncount=1,sellsign=0;//定義了三個(gè)常數(shù)變量,分別賦值

    variable:entandexitsign=1,entpoint=0,exitpoint=0;//定義了三個(gè)常數(shù)變量,分別賦值

    variable:n=0;//定義常數(shù)變量N,初始化值為0

     
    ma1:ma(c,5);//輸出五日均價(jià)

    ma2:ma(c,10);//輸出十日均價(jià)

    m:=ma(tr,20);//輸出20日均價(jià)

    buyhhv:=hhv(h,20);//20日最高價(jià)

    sellllv:=llv(l,10);//20日最低價(jià)

     

    ss:n,linethick0;


    nt:=1;//調(diào)試信息帶有時(shí)間戳

    buyorderthisbar:=0;//當(dāng)前BAR有過交易

     
    variable: _debug = 1; //是否輸出前臺的交易指令

    variable: _tdebug = 1;    //是否輸出后臺的交易指令

    variable: _debugout = 0;  //是否輸出后臺交易的調(diào)試信息

     

    variable: myentryprice = 0;//開倉價(jià)格

    variable: myxitprice = 0;//平倉價(jià)格

     

    variable: turtleunits = 0;//交易單位

    variable: position = 0;//倉位狀態(tài)

     

    //0表示沒有倉位,1表示持有多頭,-1表示持有空頭

     

    variable: t20hi=close;

    variable: t20lo=close;

     

    variable: t10hi=close;

    variable: t10lo=close;

     

    //需要準(zhǔn)備計(jì)算的變量

    t20hi=:ref(hhv(h,t20),1);//

    t20lp=:ref(llv(h,t20),1);//

     

    t10hi=:ref(hhv(h,t10),1);

    t10lo=:ref(llv(h,t10),1);

     

    avgtr:=ref(ma(tr,atrlen),1);

     

    //開始執(zhí)行時(shí),初始化數(shù)據(jù)

     

    if barpos = 1 then begin

     //position : = 0;

     

     end//if

     

     //如果是當(dāng)時(shí)沒有持倉的狀態(tài)

    if position=0 and barpos > t20 andh>l then begin

     

           //建立多頭進(jìn)場條件

         

           long:=h>t20hi;

         

           //多頭進(jìn)場

           iflong then begin

                  myentryprice:=if(open>t20hi+mindiff,open,t20hi+mindiff);

                  buy(_debug,posnum,limitr,myentryprice);

                  position:=1;

                  turtleunits:=1;

                  n:=avgtr;

                  buyorderthisbar:=1;

                

                  end//IF

         

           //建立空頭進(jìn)場條件

           short:=l<t20lo;

         

           //空頭進(jìn)場

           ifshort and position=0 then begin

                         myentryprice:=if(open<t20lo-mindiff,open,t20lo-mindiff);

                         buyshort(_debug,posnum,limitr,myentryprice);

                         position:=-1;

                         turtleunits:=1;

                         n:=avgtr;

                         buyorderthisbar:=1;

                  end

                 //不要轉(zhuǎn)跳,讓程序檢查同一根K線是否可以加倉

                  //gotocontinueline;

                

           end//if

         

           //如果當(dāng)前持有多頭倉位的狀態(tài)

           ifposition=1 and barpos>t20 and h>l then begin

                  //多頭加倉條件

                  while(high>myentryprice+0.5*n) and turtleunits < 4 do begin

                  myentryprice:=if(open>myentryprice+0.5*n,open,myentryprice+0.5*n);

                  myentryprice:=ceiling(myentryprice/mindiff)*mindiff;

                  buy(_debug,posnum,limitr,myentryprice);

                  turtleunits:=turtleunits+1;

                  buyorderthisbar:=1;

                

           end//while循環(huán)結(jié)束

         

         

           //建立多頭離場條件

           longx1:=(low<t10lo);

         

           iflongx1 and buyorderthisbar=0 then begin

                  myexitprice:=if(open<t10lo-mindiff,open,t10lo-mindiff);

                  sell(_debug,0,limitr,myexitprice);

                  position:=0;

                  turtleunits:=0;

           end

         

         

           //建立多頭止損條件

           longx2:= (low<myentryprice-2*n);

         

           iflongx2 and position = 1 and buyorderthisbar=0 then begin

                  myexitprice:=if(open<myentryprice-2*n,open,myentryprice-2*n);

                  myexitprice:=floor(myexitprice/mindiff)*mindiff;

                  sell(_debug,0,limitr,myexitprice);

                  position:=0;

                  turtleunits:=0;

           end

         

           goto  continueline;

     

    end //if

    if barpos >= 21  or barpos=21 then begin//如果從上市到交易日大于21天那么

    if barpos =21 then//如果從上市到現(xiàn)在加以日等于21,那么

    n:=m;//n=m

    if daycount =6 or barpos = 21 then begin//五天調(diào)整N值

    n:=(19*n+tr)/20;//計(jì)算N的值

    daycount:=2;

    end

    daycount:=daycount+1;

    entpoint:=enterbars+1;

    if entpoint=entandexitsign then begin//說明stop指令買進(jìn)頭寸成功

    positioncount:=positioncount+1;//頭寸計(jì)數(shù)

    sellsign:=true;//開始以stop賣出,如果達(dá)到指定的價(jià)格

    end

    if positioncount=1 then begin//第一頭寸

    how:=cash(0)*0.01/n;//波動(dòng)性百分比決定頭寸規(guī)模

    open1:buy(h>=enterprice+0.5*n,how,market);//在20日新高stop指令買進(jìn)

    end

    if positioncount = 2 then begin//第二頭寸

    how:=cash(0)*0.01/n;//波動(dòng)性百分比決定頭寸規(guī)模

    open2:buy(h>enterprice+0.5*n,how,market);//在上頭寸(即第一頭寸)+0.5個(gè)N新高stop指令買進(jìn)

    end

    if positioncount=3 then begin//第三頭寸

    how:=cash(0)*0.01/n;//波動(dòng)性百分比決定頭寸規(guī)模

    open3:buy(h>=enterprice+0.5*n,how,market);//在上頭寸(即第二頭寸)+0.5個(gè)N新高stop指令買進(jìn)

    end

    if positioncount = 4 then begin //第四頭寸

    how:=cash(0)*0.01/n;//波動(dòng)性百分比決定頭寸規(guī)模

    open4:buy(h>=enterprice+0.5*n,how,market);     //在上頭寸(即第三頭寸)+0.5個(gè)N新高stop指令買進(jìn)

    end

     

    if sellsign = true then begin

           exitpoint:=exitbars+1;

           ifexitpoint = entandexitsign then begin //說明賣出成功

                  positioncount:=1;{頭寸計(jì)算復(fù)原}

                  sellsign:=false;

           end

           ifenterprice-2*n then sell(l<sellllv,100%,market);{退出虧損頭寸}

                  else

                  sell(l<enterprice-2*n,100%,market);

           end

    end

     
     
    //顯示賬號信息:

     

    continueline@ mycount:asset,linethick0;//顯示我的資產(chǎn)

    available_cash:cash(0),linethick0;//可用現(xiàn)金

    pos:holding,linethick0;

    toaldaytrade1:totaldaytrade,linethick0;//總交易次數(shù)

     

    if _debugout>0 then begin

           debugfile2('c:debugfile.txt','barpos=%.of',barpos,nt);

           debugfile2('c:debugfile.txt','t20hi=%.2f',t20hi,nt);

           debugfile2('c:debugfile.txt','n=%.2f',n,nt);

           debugfile2('c:debugfile.txt','close=%.2f',c,nt);

           debugfile2('c:debugfile.txt','position=%.2f',position,nt);

           debugfile2('c:debugfile.txt','turtleunits=%.of',turtleunits,nt);

           debugfile2('c:debugfile.txt','myentryprice=%.of',myentryprice,nt);

           debugfile2('c:debugfile.txt','myexitprice=%.of',myexitprice,nt);

    end


    the currentposition:holding,colorgray,linethick0;//當(dāng)前持倉

    the currentcaptal:asset,noaxis,colorgray;//當(dāng)前資產(chǎn)

     
    此主題相關(guān)圖片如下:8$n0{ih0v12k2gdd557psg.jpg

     

     

    改好了,但是你這個(gè)很多變量后面少了空格是什么情況?



    剛剛用你改好的:


    [此貼子已經(jīng)被作者于2013/7/30 9:31:14編輯過]

 

有思路,想編寫各種指標(biāo)公式,程序化交易模型,選股公式,預(yù)警公式的朋友

可聯(lián)系技術(shù)人員 QQ: 511411198  點(diǎn)擊這里給我發(fā)消息進(jìn)行 有償 編寫!不貴!點(diǎn)擊查看價(jià)格!


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

相關(guān)文章

    沒有相關(guān)內(nèi)容
主站蜘蛛池模板: 一级特黄a大片免费 | 天堂成人在线观看 | 国产高清视频在线观看不卡v | 成人欧美在线 | 中文字幕在线视频观看 | 国产aaa女人十八毛片 | 亚洲成人网在线播放 | 制服丝袜第一页在线观看 | 亚洲香蕉 | 欧美综合区 | 午夜影院操一 | 欧美一级视频在线 | 天天干天天综合 | 性欧美高清精品video | 日韩在线网址 | 男人趴在女人身上曰皮免费 | 一级做a爰片久久毛片武则天 | 男女视频免费观看 | 国产精品麻豆一区二区三区 | 久久99热成人精品国产 | 午夜精品在线 | 欧美成人 一区二区三区 | 欧美日产国产亚洲综合图区一 | 美女免费视频一区二区三区 | 国产在线不卡视频 | 国产人成精品午夜在线观看 | 欧美人禽猛交狂配免费看 | 中文字幕在线观看一区二区三区 | 天堂亚洲欧美日韩一区二区 | 国产日韩综合 | 免费视频网站一级人爱视频 | 日本高清在线播放一区二区三区 | 成人精品 | 一级美国片免费看 | 曰皮视频在线播放免费的 | 亚洲成人国产 | 最近中文字幕2019国语7 | 国产日产亚洲系列首页 | 最近中文字幕2019免费6 | 天堂色视频 | 欧美成人精品 |