信號(hào)閃現(xiàn),是什么原因老師回測(cè)非常好 [開(kāi)拓者 TB]
-
咨詢內(nèi)容:
Params
Numeric ceilingAmt(30);
? ???Numeric floorAmt(60);
? ???Numeric bolBandTrig(2);
? ?
Vars
? ???Numeric lookBackDays(20);? ?? ?? ?
? ???Numeric todayVolatility(0);
? ???Numeric yesterDayVolatility(0);
? ???Numeric deltaVolatility(0);
? ???NumericSeries buyPoint(0);
? ???NumericSeries sellPoint(0);
? ???NumericSeries longLiqPoint(0);
? ???NumericSeries shortLiqPoint(0);
? ???Numeric upBand(0);
? ???Numeric dnBand(0);
? ???Numeric MidLine(0);
? ???Numeric Band(0);
Begin
? ???todayVolatility = StandardDev(Close[1],30,1);
? ???yesterDayVolatility = StandardDev(Close[1],30,1);
? ???deltaVolatility = (todayVolatility - yesterDayVolatility)/todayVolatility;
? ???lookBackDays = lookBackDays * (1 + deltaVolatility);
? ???lookBackDays = Round(lookBackDays,0);
? ???lookBackDays = Min(lookBackDays,ceilingAmt);
? ???lookBackDays = Max(lookBackDays,floorAmt);
? ???MidLine = AverageFC(Close[1],lookBackDays);
? ???Band = StandardDev(Close[1],lookBackDays,bolBandTrig);
? ???upBand = MidLine + bolBandTrig * Band;
? ???dnBand = MidLine - bolBandTrig * Band;
? ???buyPoint = Highest(High[1],lookBackDays);
? ???sellPoint = Lowest(Low[1],lookBackDays);
? ???longLiqPoint = Average(Close[1],lookBackDays);
? ???shortLiqPoint = Average(Close[1],lookBackDays);
if(Close > upBand)??
{
? ? If(CrossOver(high,buyPoint))? ?
? ?{
? ?? ?Buy(1,max( buyPoint, Low ));
? ?}
Commentary("多頭觸發(fā)價(jià):"+Text(buyPoint));
}
if(Close < dnBand)
{
? ? If(CrossUnder(Low,sellPoint ))
? ? {
? ?? ? SellShort(1,min( sellPoint , High ));
? ? }
Commentary("空頭觸發(fā)價(jià):"+Text(sellPoint));
}
if(MarketPosition == 1)
{??
? ? If(CrossUnder(Low,longLiqPoint ))
? ? {
? ?? ? Sell(1,min( longLiqPoint , High ));
? ? }
Commentary("多頭退出:"+Text(longLiqPoint));
}
if(MarketPosition == -1)
{
? ? If(CrossOver(high,shortLiqPoint))? ?
? ?{
? ?? ?BuyToCover(1,max( shortLiqPoint, Low ));
? ?}
Commentary("多頭退出:"+Text(shortLiqPoint));
}
End
有思路,想編寫各種指標(biāo)公式,交易模型,選股公式,還原公式的朋友
可聯(lián)系技術(shù)人員 QQ: 262069696 或微信號(hào):cxh99cxh99 進(jìn)行 有償收費(fèi) 編寫!
(怎么收費(fèi),代編流程等詳情請(qǐng)點(diǎn)擊閱讀!)
(注:由于人數(shù)限制,QQ或微信請(qǐng)選擇方便的一個(gè)聯(lián)系我們就行,加好友時(shí)請(qǐng)簡(jiǎn)單備注下您的需求,否則無(wú)法通過(guò)。謝謝您!)
相關(guān)文章
-
沒(méi)有相關(guān)內(nèi)容