大伊人青草狠狠久久-大伊香蕉精品视频在线-大伊香蕉精品一区视频在线-大伊香蕉在线精品不卡视频-大伊香蕉在线精品视频75-大伊香蕉在线精品视频人碰人

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

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

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

     

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

     

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

     

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


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

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

    //author: fjasmine


    input: t20(20,15,60,1);//參數(shù)名,缺省值,最小值,最大值,步長(zhǎng)
    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; //是否輸出前臺(tái)的交易指令

    variable: _tdebug = 1;    //是否輸出后臺(tái)的交易指令

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

     

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

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

     

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

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

     

    //0表示沒有倉(cāng)位,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í)沒有持倉(cāng)的狀態(tài)

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

     

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

         

           long:=h>t20hi;

         

           //多頭進(jìn)場(chǎng)

           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)場(chǎng)條件

           short:=l<t20lo;

         

           //空頭進(jìn)場(chǎng)

           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線是否可以加倉(cāng)

                  //gotocontinueline;

                

           end//if

         

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

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

                  //多頭加倉(cāng)條件

                  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é)束

         

         

           //建立多頭離場(chǎng)條件

           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//說(shuō)明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 //說(shuō)明賣出成功

                  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

     
     
    //顯示賬號(hào)信息:

     

    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)前持倉(cā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!

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

    //author: fjasmine


    input: t20(20,15,60,1);//參數(shù)名,缺省值,最小值,最大值,步長(zhǎng)
    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; //是否輸出前臺(tái)的交易指令

    variable: _tdebug = 1;    //是否輸出后臺(tái)的交易指令

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

     

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

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

     

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

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

     

    //0表示沒有倉(cāng)位,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í)沒有持倉(cāng)的狀態(tài)

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

     

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

         

           long:=h>t20hi;

         

           //多頭進(jìn)場(chǎng)

           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)場(chǎng)條件

           short:=l<t20lo;

         

           //空頭進(jìn)場(chǎng)

           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線是否可以加倉(cāng)

                  //gotocontinueline;

                

           end//if

         

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

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

                  //多頭加倉(cāng)條件

                  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é)束

         

         

           //建立多頭離場(chǎng)條件

           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//說(shuō)明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 //說(shuō)明賣出成功

                  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

     
     
    //顯示賬號(hào)信息:

     

    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)前持倉(cā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à)格!


【字體: 】【打印文章】【查看評(píng)論

相關(guān)文章

    沒有相關(guān)內(nèi)容
主站蜘蛛池模板: 色综合中文字幕在线亚洲 | 精品煌色视频网站在线观看 | 精品无人乱码区1区2区3区 | 狠狠的日视频 | 亚洲欧美动漫 | 久久久免费| 五月天激情在线 | 激性欧美激情在线播放16页 | 久久久欧美综合久久久久 | 欧美日本高清视频在线观看 | 亚洲欧美日韩国产精品网 | 亚洲综合伦理 | 欧美性色xo影院在线观看 | 久久频精品99香蕉国产 | 日韩精品一区二区三区中文3d | 一区二区三区中文国产亚洲 | 好色亚洲 | 国产婷婷一区二区三区 | 欧美亚洲国产一区二区三区 | 日日操夜夜爱 | 亚洲在线播放视频 | 亚洲欧美网站 | 一级黄色录像免费观看 | 天天做夜夜做 | 国产日韩精品一区在线观看播放 | 欧美成人性视频播放 | 午夜精品亚洲 | 2046影院视频大全在线观看 | 日产精品久久久一区二区 | 美女福利在线观看 | 国产在线综合网 | 欧美成人亚洲高清在线观看 | 日日摸日日添夜夜爽97 | 欧美日本在线视频 | 一级特黄aaa大片大全 | 黄色成人免费网站 | 日日夜夜骑 | 免费亚洲一区 | 九九视频国产免 | 久久综合色播 | 国产福利视精品永久免费 |