無法實現數值型序列數據傳遞? [開拓者 TB]
- 咨詢內容:
你好,我想實現的原理是:昨天收盤價和30天前收盤價的差值InterPrice,最新InterPrice 的低于60天最低值時開多倉。我的寫法有什么地方不對,實現不了,謝謝
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]; //當日收盤時隔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技術人員: 60天最低值不直接調用函數Lowest(InterPrice,60)就行了
有思路,想編寫各種指標公式,程序化交易模型,選股公式,預警公式的朋友
可聯系技術人員 QQ: 1145508240 進行 有償 編寫!(不貴!點擊查看價格!)
相關文章
-
沒有相關內容