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

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

如此雙均線系統(tǒng),咋還出現(xiàn)信號消失呢? - TradeBlazer公式 [開拓者 TB]

  • 咨詢內(nèi)容: 我在模擬交易中,測試陳總講課的例子,但還是出現(xiàn)信號消失問題,很是不解。請各位高手能給予幫助。先謝了

    程序代碼如下:
    1. Params                                                
    2.         Numeric Length1(8);                // 短均線周期
    3.         Numeric Length2(22);                 // 長均線周期
    4.         Numeric InitialStop(6);                                // 初始止損比例*1000
    5.         Numeric BreakEvenStop(10);                // 保本止損比例*1000
    6.         Numeric TrailingStop(14);                // 追蹤止損比例*1000
    7.         Numeric Lots(1);                            // 頭寸大小   
    8.        
    9. Vars                                                   
    10.         NumericSeries MA1;                           
    11.         NumericSeries MA2;
    12.         BoolSeries condBuy(false);                // 做多條件
    13.         BoolSeries condSell(false);                // 做空條件
    14.            Numeric MyPrice;
    15.         NumericSeries HigherAfterEntry;        // 多頭盈利峰值價
    16.         NumericSeries LowerAfterEntry;        // 空頭盈利峰值價
    17.         BoolSeries bLongStoped(false);        // 當(dāng)前均線多頭趨勢下是否有過一次進(jìn)場
    18.         BoolSeries bShortStoped(false);        // 當(dāng)前均線空頭趨勢下是否有過一次進(jìn)場
    19.         Numeric StopLine(0);

    20. Begin

    21.         // 把上一根bar的出場狀況傳遞過來
    22.         if (BarStatus > 0)
    23.         {
    24.                 bLongStoped = bLongStoped[1];
    25.                 bShortStoped = bShortStoped[1];
    26.         }

    27.         // 傳遞或比較盈利峰值價
    28.         If(BarsSinceEntry >= 1)
    29.         {
    30.                 HigherAfterEntry = Max(HigherAfterEntry[1],High[1]);
    31.                 LowerAfterEntry = Min(LowerAfterEntry[1],Low[1]);
    32.         }
    33.         Else
    34.         {
    35.                 HigherAfterEntry = HigherAfterEntry[1];
    36.                 LowerAfterEntry = LowerAfterEntry[1];
    37.         }

    38.         MA1 = AverageFC(Close,Length1);              
    39.         MA2 = AverageFC(Close,Length2);
    40.         PlotNumeric("MA1",MA1);
    41.         PlotNumeric("MA2",MA2);

    42.         // 計算是否出現(xiàn)了金叉死叉
    43.         condBuy = CrossOver(MA1,MA2);
    44.         condSell = CrossUnder(MA1,MA2);

    45.         // 如果當(dāng)前bar沒有發(fā)生交叉,則將前一個Bar的交叉狀態(tài)傳遞下去
    46.         if ( condBuy == false and condSell == false )
    47.         {
    48.                 condBuy = condBuy[1];
    49.                 condSell = condSell[1];
    50.         }

    51.         // 過濾集合競價
    52.         If((BarType==1 or BarType==2) && BarStatus == 2 && date!=date[1] && high==low)         return;
    53.         If(BarType==0 && BarStatus == 2 && CurrentTime<=0.09 && high==low)                                 return;

    54.         // 多頭初次入場
    55.         If (MarketPosition!=1 and condBuy[1]==true and bLongStoped==false)
    56.         {
    57.                 Buy(Lots,Open);
    58.                
    59.                 HigherAfterEntry = Open;
    60.                 LowerAfterEntry = Open;
    61.                 bLongStoped = false;
    62.                 bShortStoped = false;                       
    63.         }

    64.         // 空頭初次入場
    65.         If (MarketPosition!=-1 and condSell[1]==true and bShortStoped==false)
    66.         {
    67.                 HigherAfterEntry = Open;
    68.                 LowerAfterEntry = Open;
    69.                 bLongStoped = false;
    70.                 bShortStoped = false;
    71.         }

    72.         // 多頭再次入場,必須突破前次出場前的高點
    73.         If(bLongStoped and MarketPosition==0 and High > HigherAfterEntry)
    74.         {
    75.                 MyPrice = HigherAfterEntry;
    76.                 If(Open > MyPrice) MyPrice = Open;
    77.                 Buy(Lots,MyPrice);
    78.                
    79.                 bLongStoped = False;
    80.                 HigherAfterEntry = MyPrice;
    81.                 LowerAfterEntry = MyPrice;

    82.                 Return;                // 再次入場,開倉bar不平倉
    83.         }

    84.         // 空頭再次入場,必須跌破前次出場前的低點
    85.         If(bShortStoped and MarketPosition==0 and Low < LowerAfterEntry)
    86.         {
    87.                 MyPrice = LowerAfterEntry;
    88.                 If(Open < MyPrice) MyPrice = Open;
    89.                 SellShort(Lots,MyPrice);
    90.                        
    91.                 bShortStoped = False;
    92.                 HigherAfterEntry = MyPrice;
    93.                 LowerAfterEntry = MyPrice;
    94.                        
    95.                 Return;                // 再次入場,開倉bar不平倉
    96.         }

    97.         // 止損部分
    98.         If(MarketPosition==1)        // 持多頭
    99.         {
    100.                 StopLine = EntryPrice * (1-InitialStop/1000);                        // 初始止損
    101.                 If (HigherAfterEntry >= EntryPrice * (1+BreakEvenStop/1000))        StopLine = EntryPrice;                //保本止損
    102.                 If (StopLine < HigherAfterEntry*(1-TrailingStop/1000))                StopLine = HigherAfterEntry*(1-TrailingStop/1000);                // 追蹤止損
    103.                
    104.                 // 止損觸發(fā)
    105.                 If(Low <= StopLine)
    106.                 {
    107.                         MyPrice = StopLine;
    108.                         If(Open < MyPrice) MyPrice = Open;
    109.                         Sell(Lots,MyPrice);
    110.                         bLongStoped = True;                // 止損后設(shè)置標(biāo)志
    111.                 }
    112.         }
    113.         Else If(MarketPosition==-1)        // 持空
    114.         {
    115.                                 StopLine = EntryPrice * (1+InitialStop/1000);                                  // 初始止損
    116.                 If (LowerAfterEntry <= EntryPrice *(1-BreakEvenStop/1000))                            StopLine = EntryPrice;                //保本止損
    117.                 If (StopLine > LowerAfterEntry*(1+TrailingStop/1000))                            StopLine = LowerAfterEntry*(1+TrailingStop/1000);        // 追蹤止損
    118.                
    119.                 // 止損觸發(fā)
    120.                 If(High >= StopLine)
    121.                 {
    122.                         MyPrice = StopLine;
    123.                         If(Open > MyPrice) MyPrice = Open;
    124.                         BuyToCover(Lots,MyPrice);
    125.                         bShortStoped = True;        // 止損后設(shè)置標(biāo)志
    126.                 }
    127.         }
    128. End

     

  • TB技術(shù)人員: 自己頂一個

     

  • TB客服: 回復(fù) 1# kongwei1107


    是哪個信號出現(xiàn)信號消失?
    看了一下條件,是用歷史條件判斷的,應(yīng)該不會出現(xiàn)信號消失的。

     

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

    是啊,我也覺得奇怪。

    我是用30MIN周期的CF1201做測試的,昨天下午在平多和開空時都出現(xiàn)信號消失提示。

    還有一個很奇怪的事情:在昨天實時過程中,在消息中心中顯示的信號消失提示,在今天的消息中心里又沒有了呢?我設(shè)的是保留20天的消息,也記錄有昨天的信息,但惟獨缺了信號消失的內(nèi)容,我想拷屏也不行了。

     

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


    將條件fileappend到文件里,如果出現(xiàn)信號消失,就到文件中找相應(yīng)時間的日志內(nèi)容看看是哪些條件不滿足。

 

如果以上指標(biāo)公式不適用于您常用的行情軟件

或者您想改編成選股公式,以便快速選出某種形態(tài)個股的話,

可以聯(lián)系我們相關(guān)技術(shù)人員 QQ: 262069696  點擊在線交流進(jìn)行 有償 改編!

 


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

相關(guān)文章

    指定的模型還沒有相關(guān)內(nèi)容!
主站蜘蛛池模板: 中国一级特黄高清免费的大片 | 久久99精品九九九久久婷婷 | 美国十次狠狠色综合 | 免费一级欧美片在线观免看 | 伊人中文字幕在线观看 | 日本久久精品视频 | 国产一级特黄a大片免费 | 青草青草视频2免费观看 | 成人禁18视频在线观看 | 日韩插插插 | 成人国产网站v片免费观看 成人国产一区二区三区 | 免费观看性欧美大片无片纯爱 | 日本中文字幕免费 | 亚洲第一页在线视频 | 色播99| 香蕉黄色片 | 欧美日韩亚洲区久久综合 | 最近中文字幕免费版在线3 最近中文字幕免费版在线 最近中文字幕免费mv在线视频 | 天天久久| 天天干天天射天天 | 欧美日韩另类在线 | 你懂的国产高清在线播放视频 | 亚洲三级免费观看 | 一本高清 | 成人在激情在线视频 | 国产三级a三级三级天天 | 日本一本在线观看 | a级片观看 | 全免费午夜真人毛片视频 | 91九色偷拍| 欧美日韩在线视频 | 国产综合成人亚洲区 | 国产综合在线观看视频 | 激情久久久久久久久久久 | 小明永久免费看aⅴ片 | 天天拍拍天天爽免费视频 | 欧美福利小视频 | 一级片aaaa| 国产黄大片在线观看视频 | a级精品九九九大片免费看 a级精品国产片在线观看 | 日本老年人精品久久中文字幕 |