根據(jù)海龜修改的簡(jiǎn)單均線系統(tǒng),請(qǐng)大家?guī)兔o看看 [開(kāi)拓者 TB]
- 咨詢內(nèi)容:
本帖最后由 yxq01234 于 2014-10-24 21:36 編輯
根據(jù)海龜修改的簡(jiǎn)單均線系統(tǒng),請(qǐng)大家?guī)兔o看看,信號(hào)不對(duì):大于18日均線+ATR開(kāi)倉(cāng),收盤(pán)價(jià)再大于上次開(kāi)倉(cāng)價(jià)+ATR加倉(cāng),最多加3次倉(cāng)。
Params
Numeric Length(14) ;
Numeric Length2(20);
Vars
NumericSeries TurtleUnits; // 交易單位
Numeric A;
NumericSeries AvgValue1;
Numeric myEntryPrice;
Numeric myExitPrice;
Begin
AvgValue1 = AverageFC(Close[1],Length2);
A=AvgTrueRange(Length) ;
If(MarketPosition == 0)
{
If(c[1]>AvgValue1+2*A and Close[1]-Open[1]>0.25*A )
{
myEntryPrice = o;
Buy(0,myEntryPrice) ;
}
If(c[1]<AvgValue1-2*A and Open[1]-Close[1]>0.25*A )
{
myEntryPrice = o;
SellShort(0,myEntryPrice);
}
}
If(MarketPosition == 1)
{
If(c[1] < AvgValue1)
{
myEntryPrice = o;
Sell(0,myEntryPrice);
}
Else
{
If(c[1]>= lastEntryPrice + 2*A and TurtleUnits>=1)
{
myEntryPrice = o;
Buy(1,myEntryPrice);
}
If(c[1] <= lastEntryPrice - 4*A )
{
myExitPrice = o;
Sell(0,myExitPrice);
}
}
}
If(MarketPosition == -1)
{
If(Close[1]>AvgValue1)
{
myEntryPrice = o;
BuyToCover(0,myEntryPrice);
}
Else
{
If(c[1]< lastEntryPrice - 2*A and TurtleUnits>=1)
{
myEntryPrice = o;
SellShort(1,myEntryPrice);
}
If(c[1] >= lastEntryPrice + 4*A )
{
myExitPrice = o;
BuyToCover(0,myExitPrice);
}
}
}
End
- TB技術(shù)人員: 實(shí)測(cè)圖貼一個(gè)?
有思路,想編寫(xiě)各種指標(biāo)公式,程序化交易模型,選股公式,預(yù)警公式的朋友
可聯(lián)系技術(shù)人員 QQ: 1145508240 進(jìn)行 有償 編寫(xiě)!(不貴!點(diǎn)擊查看價(jià)格!)
相關(guān)文章
-
沒(méi)有相關(guān)內(nèi)容