<address id="zhfln"></address>

    <form id="zhfln"></form>
    <address id="zhfln"><address id="zhfln"><listing id="zhfln"></listing></address></address>

        <form id="zhfln"><nobr id="zhfln"><progress id="zhfln"></progress></nobr></form>
        <sub id="zhfln"></sub>

        <sub id="zhfln"></sub>

          <form id="zhfln"><nobr id="zhfln"><meter id="zhfln"></meter></nobr></form>

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

          開拓者逐風破浪交易系統源碼 部份品種實盤不錯 日內交易[開拓者公式]

          • 源碼內容:

            Params
                Bool    bInitStatus(false);//初始化標志,修改初始倉位時需設置為True
                Numeric InitMyRealMp(0);//初始當前倉位,正數表示多單,負數表示空單
                Numeric FirstGrid(10);//第一筆交易的間距,最小跳動
                Numeric AddGrid(30);//加倉間距,最小跳動
                Numeric TotalGrids(10);//最大交易次數
                Numeric TrailingGrid(10);//移動止損間距,最小跳動
                Numeric EveryLots(1);//每次開倉手數
                Numeric OffSet(1);//委托價偏差,默認買賣價偏差1個滑點
                Numeric ExitOnCloseMins(15.00);//收盤平倉時間
            Vars
                Numeric HighAfterlongEntry;
                Numeric  LowAfterShortEntry;
                Numeric    MyRealMp(0);
                Numeric   MinPoint;
                Numeric  TmpPrice;
                Numeric   TmpLots;
            Begin
                MinPoint=MinMove*PriceScale;//當前商品最小變動量*當前商品的計數單位
                MyRealMp=GetGlobalVar(0); //獲取MyRealMp全局變量值
                HighAfterlongEntry=GetGlobalVar(1);
                LowAfterShortEntry=GetGlobalVar(2);
                If(BarStatus==0 And (MyRealMp==InvalidNumeric||bInitStatus))  
                {MyRealMp=InitMyRealMp;}
                If(Date<>Date[1])
                {HighAfterlongEntry=High;
                LowAfterShortEntry=Low;
                MyRealMp=0;
                }Else
                {HighAfterlongEntry=Max(HighAfterlongEntry,High);
                LowAfterShortEntry=Min(LowAfterShortEntry,Low);}
                if (Time<ExitOnCloseMins/100)
                {If(MyRealMp>0 And HighAfterlongEntry-Low>=TrailingGrid*MinPoint And(High-Low<TrailingGrid*MinPoint Or (High-Low>=TrailingGrid*MinPoint And Close<Open)))
                  {TmpPrice=Max(HighAfterLongEntry-(TrailingGrid-OffSet)*MinPoint,Low);
                  TmpLots=Abs(MyRealMp*EveryLots);
                  Sell(TmpLots,TmpPrice);
                  MyRealMp=0;
                  LowAfterShortEntry=Low;
                }else
                  If(MyRealMp<0 And High-LowAfterShortEntry>=TrailingGrid*MinPoint And (High-Low<TrailingGrid*MinPoint Or (High-Low>=TrailingGrid*MinPoint And Close>Open)))
                  {TmpPrice=Min(LowAfterShortEntry+(TrailingGrid+OffSet)*MinPoint,High);
                   TmpLots=Abs(MyRealMp*EveryLots);
                   BuyToCover(TmpLots,TmpPrice);
                   MyRealMp=0;
                   HighAfterLongEntry=0;}
                   If(MyRealMp==0 And High-LowAfterShortEntry>=FirstGrid*MinPoint)//第一筆多單開倉
                   {TmpPrice=Min(LowAfterShortEntry+(FirstGrid+OffSet)*MinPoint,High);
                   TmpLots=EveryLots;
                   Buy(TmpLots,TmpPrice);
                   MyRealMp=1;
                   HighAfterLongEntry=High;
                   }Else
                   If(MyRealMp>0 And MyRealMp<TotalGrids And High-LowAfterShortEntry>=(FirstGrid+MyRealMp*AddGrid)*MinPoint)//多單加倉
                   {TmpPrice=Min(LowAfterShortEntry+(FirstGrid+MyRealMp*AddGrid+OffSet)*MinPoint,High);
                   TmpLots=EveryLots;
                   Buy(TmpLots,TmpPrice);
                   MyRealMp=MyRealMp+1;
                   }else
                   If(MyRealMp==0 And HighAfterLongEntry-Low>=FirstGrid*MinPoint)//第一筆空單開倉
                   {TmpPrice=Max(HighAfterLongEntry-(FirstGrid-OffSet)*MinPoint,Low);
                   TmpLots=EveryLots;
                   SellShort(TmpLots,TmpPrice);
                   MyRealMp=-1;
                   LowAfterShortEntry=Low;
                   }else
                   If(MyRealMp<0 And -1*MyRealMp<TotalGrids And HighAfterLongEntry-Low>=(FirstGrid+Abs(MyRealMp*AddGrid))*MinPoint)//空單加倉
                   {TmpPrice=Max(HighAfterLongEntry-(FirstGrid-Abs(MyRealMp*AddGrid)-OffSet)*MinPoint,Low);
                   TmpLots=EveryLots;
                   SellShort(TmpLots,TmpPrice);
                   MyRealMp=MyRealMp-1;}
                   }else
                   If(Time>=ExitOnCloseMins/100)
                   {If(MyRealMp>0)
                   {TmpLots=Abs(MyRealMp*EveryLots);
                   TmpPrice=Close;
                   Sell(0,TmpPrice);
                   MyRealMp=0;}
                   If(MyRealMp<0)
                   {TmpLots=Abs(MyRealMp*EveryLots);
                   TmpPrice=Close;
                   BuyToCover(0,TmpPrice);
                   MyRealMp=0;}}
                   SetGlobalVar(0,MyRealMp);
                   SetGlobalVar(1,HighAfterLongEntry);
                   SetGlobalVar(2,LowAfterShortEntry);
                   Commentary("MyRealMp="+Text(MyRealMp));
                   Commentary("HighAfterLLowAfterShortEntry="+Text(LowAfterShortEntry));
                   End

             

           

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

          可聯系技術人員 QQ: 262069696  點擊在線交流進行 有償 編寫!不貴!點擊查看價格!

           


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

          相關文章

            沒有相關內容
            人妻专区免费视频,俄罗斯啪啪到高潮喷水,国色天香社区直播在线观看
            <address id="zhfln"></address>

            <form id="zhfln"></form>
            <address id="zhfln"><address id="zhfln"><listing id="zhfln"></listing></address></address>

                <form id="zhfln"><nobr id="zhfln"><progress id="zhfln"></progress></nobr></form>
                <sub id="zhfln"></sub>

                <sub id="zhfln"></sub>

                  <form id="zhfln"><nobr id="zhfln"><meter id="zhfln"></meter></nobr></form>