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

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

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

  • 咨詢內(nèi)容: 剛剛用金字塔格式的傳上去不能正常顯示,這個是TXT文檔的類型 下載信息  [文件大小:   下載次數(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;//定義了三個常數(shù)變量,分別賦值

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

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

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

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

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

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

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

     

    ss:n,linethick0;


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

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

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

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

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

     

    variable: myentryprice = 0;//開倉價格

    variable: myxitprice = 0;//平倉價格

     

    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ù)據(jù)

     

    if barpos = 1 then begin

     //position : = 0;

     

     end//if

     

     //如果是當(dāng)時沒有持倉的狀態(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á)到指定的價格

    end

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

    how:=cash(0)*0.01/n;//波動性百分比決定頭寸規(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;//波動性百分比決定頭寸規(guī)模

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

    end

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

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

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

    end

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

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

    open4:buy(h>=enterprice+0.5*n,how,market);     //在上頭寸(即第三頭寸)+0.5個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)

     

     

     

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

    [此貼子已經(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;//定義了三個常數(shù)變量,分別賦值

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

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

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

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

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

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

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

     

    ss:n,linethick0;


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

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

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

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

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

     

    variable: myentryprice = 0;//開倉價格

    variable: myxitprice = 0;//平倉價格

     

    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ù)據(jù)

     

    if barpos = 1 then begin

     //position : = 0;

     

     end//if

     

     //如果是當(dāng)時沒有持倉的狀態(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á)到指定的價格

    end

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

    how:=cash(0)*0.01/n;//波動性百分比決定頭寸規(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;//波動性百分比決定頭寸規(guī)模

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

    end

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

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

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

    end

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

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

    open4:buy(h>=enterprice+0.5*n,how,market);     //在上頭寸(即第三頭寸)+0.5個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

     

     

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



    剛剛用你改好的:


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

 

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

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


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

相關(guān)文章

    沒有相關(guān)內(nèi)容
主站蜘蛛池模板: 男人影院在线 | 真实国语对白视频播放 | 亚洲欧美色综合精品 | 狠狠久久 | 91久久爱| 毛片毛片免费看 | 97视频免费人人观看人人 | 日韩高清一区二区三区不卡 | 香蕉网站男人网站 | 国产亚洲精品国产 | 97久久精品人人做人人爽 | 六月丁香深爱六月综合激情 | 九九精品视频在线播放 | 国产在线一区二区 | 成人国产在线视频在线观看 | 国产精品久久久久久搜索 | 日韩毛片免费观看 | 在线视频www| 久久久免费观看视频 | 欧美成人免费毛片 | 在线亚洲黄色 | 伊人情人综合成人久久网小说 | 亚洲性在线| 精品国产免费福利片 | 亚洲国产精品欧美综合 | 欧美精品1区 | 香蕉在线精品一区二区 | 成人aaaa| 哪个网站能看毛片 | a亚洲欧美中文日韩在线v日本 | 久久网站在线观看 | 久久久91 | 国产乱子伦一区二区三区 | 真实国产乱人伦在线视频播放 | 四虎精品影院 | 国产一级毛片在线 | 国产成人综合网 | 在线免费h | 99久久精品免费看国产四区 | 久久综合图区亚洲综合图区 | 国产毛片久久国产 |