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

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

RSI的第一個(gè)值是怎么來(lái)的 [開(kāi)拓者 TB]

  • 咨詢(xún)內(nèi)容: 剛開(kāi)始學(xué)TB,請(qǐng)教一下RSI的計(jì)算。
    If(CurrentBar <= Length - 1)的時(shí)候Close[Length] 的值都是空的,那么NetChgAvg = ( Close - Close[Length] ) / Length 應(yīng)該也是空值,那么第一個(gè)NetChgAvg的值是怎么計(jì)算來(lái)的,謝謝。
    1. //------------------------------------------------------------------------
    2. // 簡(jiǎn)稱(chēng): RSI
    3. // 名稱(chēng): 相對(duì)強(qiáng)弱指數(shù)
    4. // 類(lèi)別: 公式應(yīng)用
    5. // 類(lèi)型: 內(nèi)建應(yīng)用
    6. //------------------------------------------------------------------------

    7. Params
    8.         Numeric Length(14) ;
    9.         Numeric OverSold(30) ;
    10.         Numeric OverBought(70) ;
    11. Vars
    12.         NumericSeries NetChgAvg( 0 );
    13.         NumericSeries TotChgAvg( 0 );
    14.         Numeric SF( 0 );
    15.         Numeric Change( 0 );       
    16.         Numeric ChgRatio( 0 ) ;
    17.         Numeric RSIValue;
    18. Begin       
    19.         If(CurrentBar <= Length - 1)
    20.         {
    21.                 NetChgAvg = ( Close - Close[Length] ) / Length ;
    22.                 TotChgAvg = Average( Abs( Close - Close[1] ), Length ) ;
    23.         }Else
    24.         {
    25.                 SF = 1/Length;
    26.                 Change = Close - Close[1] ;
    27.                 NetChgAvg = NetChgAvg[1] + SF * ( Change - NetChgAvg[1] ) ;
    28.                 TotChgAvg = TotChgAvg[1] + SF * ( Abs( Change ) - TotChgAvg[1] ) ;       
    29.         }
    30.        
    31.         If( TotChgAvg <> 0 )
    32.         {
    33.                 ChgRatio = NetChgAvg / TotChgAvg;
    34.         }else
    35.         {
    36.                 ChgRatio = 0 ;
    37.         }       
    38.         RSIValue = 50 * ( ChgRatio + 1 );       
    39.         PlotNumeric("RSI",RSIValue);
    40.         PlotNumeric("超買(mǎi)",OverBought);
    41.         PlotNumeric("超賣(mài)",OverSold);
    42. End

    43. //------------------------------------------------------------------------
    44. // 編譯版本        GS2010.12.08
    45. // 版權(quán)所有        TradeBlazer Software 2003-2010
    46. // 更改聲明        TradeBlazer Software保留對(duì)TradeBlazer平
    47. //                        臺(tái)每一版本的TradeBlazer公式修改和重寫(xiě)的權(quán)利
    48. //------------------------------------------------------------------------

     

  • TB技術(shù)人員: 自己搞明白了,原來(lái)Bar數(shù)據(jù)、序列變量在回溯越界時(shí)用該數(shù)據(jù)源的第1個(gè)值代替,而不是返回空值。

     

  • TB客服:
    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;
                    }
            }
    這一段可能會(huì)出現(xiàn)同一根BAR既滿(mǎn)足high值高于ssetup,又滿(mǎn)足Low<=(senter+(hitoday[1]-ssetup)/div)的情況,但實(shí)際無(wú)法判斷先后。

    改成
            if(hitoday[1]>=ssetup and marketposition>-1 and GetGlobalVar(1)<1 &&date==date[1])
            {
                  If(Low<=(senter+(hitoday[1]-ssetup)/div))
                    {
                            SellShort(1,senter+(hitoday[1]-ssetup)/div);
                            SetGlobalVar(1,Time);
                            Return;
                    }
            }
            if(ltoday[1]<=bsetup and marketposition<1  and GetGlobalVar(1)<1 &&date==date[1])
            {
                    If(High>=(benter-(bsetup-ltoday[1])/div))
                    {
                            Buy(1,benter-(bsetup-ltoday[1])/div);
                            SetGlobalVar(1,Time);
                    Return;
                    }
            }
    這樣子會(huì)不會(huì)好一點(diǎn)?還有后面的if(marketposition==0)那一段貌似也得加上跳空判斷~    本人在實(shí)盤(pán)觀察過(guò)的確有實(shí)盤(pán)閃爍過(guò)。還要自己仔細(xì)看一看啦!

     

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

    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;
                    }
            }
    這一段可能會(huì)出現(xiàn)同一根BAR既滿(mǎn)足high值高于ssetup,又滿(mǎn)足Low<=(senter+(hitoday[1]-ssetup)/div)的情況,但實(shí)際無(wú)法判斷先后。

    改成
            if(hitoday[1]>=ssetup and marketposition>-1 and GetGlobalVar(1)<1 &&date==date[1])
            {
                  If(Low<=(senter+(hitoday[1]-ssetup)/div))
                    {
                            SellShort(1,senter+(hitoday[1]-ssetup)/div);
                            SetGlobalVar(1,Time);
                            Return;
                    }
            }
            if(ltoday[1]<=bsetup and marketposition<1  and GetGlobalVar(1)<1 &&date==date[1])
            {
                    If(High>=(benter-(bsetup-ltoday[1])/div))
                    {
                            Buy(1,benter-(bsetup-ltoday[1])/div);
                            SetGlobalVar(1,Time);
                    Return;
                    }
            }
    這樣子會(huì)不會(huì)好一點(diǎn)?還有后面的if(marketposition==0)那一段貌似也得加上跳空判斷~    本人在實(shí)盤(pán)觀察過(guò)的確有實(shí)盤(pán)閃爍過(guò)。還要自己仔細(xì)看一看啦!

 

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

可聯(lián)系技術(shù)人員 QQ: 1145508240  有需要幫忙請(qǐng)點(diǎn)擊這里留言!!!進(jìn)行 有償 編寫(xiě)!不貴!點(diǎn)擊查看價(jià)格!


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

相關(guān)文章

    沒(méi)有相關(guān)內(nèi)容
主站蜘蛛池模板: 干欧美女人 | a毛片在线播放 | 欧美夜夜撸 | 久久久久欧美精品 | 天天干天天色综合 | 久久久久久夜精品精品免费啦 | 深夜久久 | 九九九热在线精品免费全部 | 国产在线看片护士免费视频 | 牛牛影院免费永久地址 | 黄色在线免费 | 欧美视频二区 | 毛片大全网站 | 免费一级毛片在线播放 | 青青青免费高清视频在线 | 日韩人成免费网站大片 | 色拍999| 成人免费午间影院在线观看 | 一区二区三区欧美日韩 | 中文字幕在线亚洲精品 | 欧美日韩亚洲国产一区二区三区 | 91在线小视频 | 四虎免费看片 | 久久久久久夜精品精品免费 | 思思91精品国产综合在线 | 99热这里只有精品8 99热这里只有精品88 | 女人的毛片 | 久久国产精品亚洲va麻豆 | xxxxxx国产精品视频 | 青青青青久久精品国产一百度 | 九九影视理伦片 | 中文字幕一区在线观看 | 七七七久久久久人综合 | 在线观看日韩欧美 | 级毛片久久久毛片精品毛片 | 91成人影院未满十八勿入 | 四虎新网址 | 国产亚洲男人的天堂在线观看 | 久久亚洲国产精品 | 午夜国产精品理论片久久影院 | 精品久久久久不卡无毒 |