蔡工的程序原樣拷入TB,編譯時提示錯誤C0012,小括號不匹配是什么意思? [開拓者 TB]
- 咨詢內(nèi)容: 大家好,我編譯時遇到這個提示:
If(Low <= HigherAfterEntry * (1 – TrailingStop/1000))
這個行提示錯誤C0012,小括號不匹配,不知道是什么意思?
是按照蔡工的程序在TB中間寫的,不知道是什么原因。 - TB技術(shù)人員: 這個公式是蔡云華工程師的一個講義流傳出來的,我想用它作為自己的交易系統(tǒng),可是水平太差,編不出來。請大家?guī)兔ε幌隆Vx謝大家了。具體講義我看能不能附件貼上來。。
Params
Numeric Length1(5); //線一標(biāo)準(zhǔn)
Numeric Length2(21); //線二標(biāo)準(zhǔn)
Numeric TrailingStop(100);
Numeric Lots(1);
Numeric InitialStop(20); // 初始止損(千分之N)
Numeric BreakEvenStop(30); // 保本止損(千分之N)
Numeric TrailingStop(50); // 追蹤止損(千分之N)
Numeric MinPoint;
Numeric MyPrice;
Vars
NumericSeries MA1;
NumericSeries MA2;
BoolSeries condBuy(false);
BoolSeries condSell(false);
NumericSeries HigherAfterEntry;
NumericSeries LowerAfterEntry;
NumericSeries HigherAfterEntry; // 多頭盈利峰值價
NumericSeries LowerAfterEntry; // 空頭盈利峰值價
Begin
If(BarsSinceEntry >= 1)
{
HigherAfterEntry = Max(HigherAfterEntry[1],High[1]);
LowerAfterEntry = Min(LowerAfterEntry[1],Low[1]);
}
MinPoint = MinMove * PriceScale;
MA1 = AverageFC(Close,Length1);
MA2 = AverageFC(Close,Length2);
condBuy = CrossOver(MA1,MA2);
condSell = CrossUnder(MA1,MA2);
If (condBuy[1]==true)
{
Buy(Lots,Open);
HigherAfterEntry = Open;
LowerAfterEntry = HigherAfterEntry;
}
If (condSell[1]==true)
{
SellShort(lots,Open);
HigherAfterEntry = Open;
LowerAfterEntry = Open;
}
Commentary("HigherAfterEntry="+Text(HigherAfterEntry));
Commentary("LowerAfterEntry="+Text(LowerAfterEntry));
If(MarketPosition==1)
{
If(Low <= HigherAfterEntry * (1 – TrailingStop/1000))
{
MyPrice = HigherAfterEntry * (1 – TrailingStop/1000);
If(Open < MyPrice) MyPrice = Open;
Sell(Lots,MyPrice);
}
}Else If(MarketPosition == -1)
{
If(High >= (LowerAfterEntry * (1 + TrailingStop / 1000)))
{
MyPrice = LowerAfterEntry * (1 + TrailingStop / 1000);
If(Open > MyPrice) MyPrice = Open;
BuyToCover(Lots,MyPrice);
}
}
End
- TB客服: 沒問題啊
有思路,想編寫各種指標(biāo)公式,程序化交易模型,選股公式,預(yù)警公式的朋友
可聯(lián)系技術(shù)人員 QQ: 262069696 進(jìn)行 有償 編寫!(不貴!點擊查看價格!)
相關(guān)文章
-
沒有相關(guān)內(nèi)容