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

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

關于論壇中R-Break策略中全局變量的幾點疑問 [開拓者 TB]

  • 咨詢內容: Params
    Numeric notbef(9.00);
    Numeric notaft(14.55);
    Numeric f1(0.35);
    Numeric f2(0.07);
    Numeric f3(0.25);
    Numeric reverse(1.00);
    Numeric rangemin(0.2);
    Numeric xdiv(3);

    Vars
    NumericSeries ssetup(0);
    NumericSeries bsetup(0);
    NumericSeries senter(0);
    NumericSeries benter(0);
    NumericSeries bbreak(0);
    NumericSeries sbreak(0);
    NumericSeries ltoday(0);
    NumericSeries hitoday(9999);
    NumericSeries startnow(0);
    NumericSeries div(0);
    BoolSeries rfilter(false);
    Numeric i_reverse;
    Numeric i_rangemin;
    Numeric i_vB;
    Numeric i_vS;

    Begin
    i_reverse = reverse*(OpenD(0)/100);
    i_rangemin = rangemin*(OpenD(0)/100);
    if(BarStatus==0)
    {
             startnow=0;
             div=max(xdiv,1);
    }

    if(Date != Date[1])
    {
             SetGlobalVar(0,0);
             SetGlobalVar(1,0);
             startnow=startnow+1;
             ssetup=hitoday[1]+f1*(Close[1]-ltoday[1]);
             senter=((1+f2)/2)*(hitoday[1]+Close[1])-(f2)*ltoday[1];
             benter=((1+f2)/2)*(ltoday[1]+Close[1])-(f2)*hitoday[1];
             bsetup=ltoday[1]-f1*(hitoday[1]-Close[1]);
             bbreak=ssetup+f3*(ssetup-bsetup);
             sbreak=bsetup-f3*(ssetup-bsetup);

            hitoday=High;
             ltoday=Low;

            rfilter=(hitoday[1]-ltoday[1])>=i_rangemin;
    }

    if(High>hitoday)
    {
             hitoday=High;
    }
    if(Low<ltoday)
    {
             ltoday=Low;
    }
    if(Time*100>=notbef and Time*100<notaft and startnow>=2 and rfilter)
    {

           if(Time != GetGlobalVar(1) and GetGlobalVar(1) != 0)
             {
                     SetGlobalVar(1,10000);
             }
             if(hitoday>=ssetup and marketposition>-1 and GetGlobalVar(1)<1)
             {
                     If(Low<=(senter+(hitoday-ssetup)/div))
                     {
                             SellShort(1,senter+(hitoday-ssetup)/div);
                             SetGlobalVar(1,Time);
                             Return;
                     }
             }
             if(ltoday<=bsetup and marketposition<1  and GetGlobalVar(1)<1)
             {
                     If(High>=(benter-(bsetup-ltoday)/div))
                     {
                             Buy(1,benter-(bsetup-ltoday)/div);
                             SetGlobalVar(1,Time);
                             Return;
                     }
             }

            if(marketposition==-1)
             {
                     SetGlobalVar(0,1);
                     if(High-EntryPrice>=i_reverse)
                     {
                             BuyToCover(1,entryprice+i_reverse);
                             Return;
                     }
             }
             if(marketposition==1)
             {
                     SetGlobalVar(0,1);
                     if(EntryPrice-Low>=i_reverse)
                     {
                             Sell(1,entryprice-i_reverse);
                             Return;
                     }
             }

            if(marketposition==0)
             {
                     if(High>=bbreak and GetGlobalVar(0) == 0)
                     {
                             Buy(1,bbreak);
                             Return;
                     }
             }
             if(marketposition==0)
             {
                     if(low<=sbreak  and GetGlobalVar(0) == 0)
                     {
                             SellShort(1,sbreak);
                             Return;
                     }
             }

    }

    if(Time*100>=notaft and Time<0.1600)
    {

            if(marketposition==-1)
             {
                     BuyToCover(1,Open);
             }
             if(marketposition==1)
             {
                     Sell(1,Open);
             }

    }
    End
    我想問下
    ssetup=hitoday[1]+f1*(Close[1]-ltoday[1]);
              senter=((1+f2)/2)*(hitoday[1]+Close[1])-(f2)*ltoday[1];
              benter=((1+f2)/2)*(ltoday[1]+Close[1])-(f2)*hitoday[1];
              bsetup=ltoday[1]-f1*(hitoday[1]-Close[1]);
              bbreak=ssetup+f3*(ssetup-bsetup);
              sbreak=bsetup-f3*(ssetup-bsetup);
    hitoday=High;
              ltoday=Low;
    if(High>hitoday)
    {
              hitoday=High;
    }
    if(Low<ltoday)
    {
              ltoday=Low;
    }
    其中的hitoday和ltoday代表著什么 是High和Low嗎?那為什么不直接替換掉,我替換掉了 而六個變量的值也因此發生改變?
    還有一個問題就是后面的兩個if循環,為什么hitoday和ltoday賦值后,還與low和high比較。兩者不是一樣的了嗎?我也試過,如果不加上這句,答案還是不一樣。
    本人是菜鳥,不懂TB的一些關鍵的思想,請求大神解答。

 

有思路,想編寫各種指標公式,程序化交易模型,選股公式,預警公式的朋友

可聯系技術人員 QQ: 511411198  點擊這里給我發消息進行 有償 編寫!不貴!點擊查看價格!


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

相關文章

    沒有相關內容
主站蜘蛛池模板: 99re6在线视频免费精品 | 一级特黄国产高清毛片97看片 | 国产免费爱在线观看视频 | 欧美大片国产在线永久播放 | 97视频免费上传播放 | 天啪天干在线视频 | 五月久久亚洲七七综合中文网 | 亚洲视频在线免费观看 | 国产精品视频福利一区二区 | 日韩经典欧美一区二区三区 | 亚洲天堂久久精品成人 | 久久这里只有精品免费视频 | 2021国产精品自产拍在线 | 免费av一区二区三区 | 香蕉依依精品视频在线播放 | 91在线中文字幕 | 九九久久九九 | 一区一区三区产品乱码 | 大陆国产精品视频 | 黄色一级片免费网站 | 国产激情久久久久影院小草 | 一区二区视频在线观看免费的 | 毛片在线看网站 | 中文字幕免费视频精品一 | 真人毛片免费拍拍拍aa视频 | 视频免费1区二区三区 | 色在线国产 | 欧美日韩大尺码免费专区 | 免费观看日本特色做爰视频在线 | 欧美激情在线免费观看 | 天天射天天射天天干 | 性做久久久久久久久25的美女 | 四虎sihu新版影院亚洲精品 | 久久新视频 | 欧美一级久久 | 亚洲欧美国产另类视频 | 日本老熟妇激情毛片 | 久久影院视频 | 亚洲欧洲日韩国产一区二区三区 | 亚洲中字幕 | 这里只有精品首页 |