TraderBlazer開發指南的例子,最終文件編譯錯誤
作者:開拓者 TB 來源:cxh99.com 發布時間:2014年01月16日
- 咨詢內容:
錯誤代碼很多:error C2143 error 2146 error 2001 error 2017.......
書上原碼如下:
//------------------------------------------------------------------------
// 簡稱: Tick
// 名稱: Tick
// 類別: 公式應用
// 類型: 用戶應用
// 輸出:
//------------------------------------------------------------------------
Vars
NumericSeries TickCnt;
Numeric bartime;
Begin
bartime = GetGlobalVar(0);
If(bartime == InvalidNumeric)//bar時間初始化
{
bartime = 0;
SetGlobalVar(0,bartime);
TickCnt = 1;
SetGlobalVar(1,TickCnt);
FileAppend("d:\\Sample_13.txt","Bartime = " + DateTimeToString(date + time) + "
Global(0) = " + Text(bartime) + "\t Global(1) = " + Text(TickCnt));
}
If(Date + Time > bartime)//新的日期時間,計數器重新置1
{
bartime = Date + Time;
SetGlobalVar(0,bartime);
TickCnt = 1;
SetGlobalVar(1,TickCnt);
FileAppend("d:\\Sample_13.txt","Bartime = " + DateTimeToString(date + time) + "\t 新K線產
生, Global(0) = " + DateTimeToString(bartime) + "\t Global(1) = " + Text(TickCnt));
}Else If(Date + Time == bartime)//相同日期時間,計數器+1,并保存回全局變量
{
TickCnt = GetGlobalVar(1) + 1;
SetGlobalVar(1,TickCnt);
FileAppend("d:\\Sample_13.txt","Bartime = " + DateTimeToString(date + time) + "\t 原K線增
加計數,Global(0) = " + DateTimeToString(bartime) + "\t Global(1) = " + Text(TickCnt));
}
Commentary("TickCnt = " + Text(TickCnt));
End
//------------------------------------------------------------------------
// 編譯版本 GS2010.12.08
// 用戶版本 2013/11/18 02:01
// 版權所有 lam888888908
// 更改聲明 TradeBlazer Software保留對TradeBlazer平臺
// 每一版本的TrabeBlazer公式修改和重寫的權利
//------------------------------------------------------------------------
- TB技術人員:
現在知道了嗎?哈喇