無法實(shí)現(xiàn)數(shù)值型序列數(shù)據(jù)傳遞? [開拓者 TB]
- 咨詢內(nèi)容:
你好,我想實(shí)現(xiàn)的原理是:昨天收盤價和30天前收盤價的差值InterPrice,最新InterPrice 的低于60天最低值時開多倉。我的寫法有什么地方不對,實(shí)現(xiàn)不了,謝謝
Params
Numeric Lots(1);
Numeric DLength(31); //取值時間間隔
Numeric LLength(60); //新低比較間隔
Numeric X(10); //持倉時間
Vars
NumericSeries InterPrice;
NumericSeries Lprice;
Numeric i;
Numeric LowPrice;
Begin
InterPrice = Close - Close[DLength]; //當(dāng)日收盤時隔DayLength的差值
LowPrice=InterPrice;
For i=1 To LLength
{
if (InterPrice[i] < LowPrice)
{
LowPrice = InterPrice[i];
}
}
Lprice = LowPrice;
If(MarketPosition<>1 && InterPrice == Lprice);
{
Buy(Lots,Close);
}
if(MarketPosition==1 && BarsSinceEntry==x)
{
Sell(Lots,Close);
}
Commentary(Text(InterPrice));
Commentary(Text(Lprice));
End - TB技術(shù)人員: 60天最低值不直接調(diào)用函數(shù)Lowest(InterPrice,60)就行了
有思路,想編寫各種指標(biāo)公式,程序化交易模型,選股公式,預(yù)警公式的朋友
可聯(lián)系技術(shù)人員 QQ: 1145508240 進(jìn)行 有償 編寫!(不貴!點(diǎn)擊查看價格!)
相關(guān)文章
-
沒有相關(guān)內(nèi)容