GetTBProfileString的問題 - TradeBlazer公式
作者:開拓者 TB 來源:cxh99.com 發布時間:2012年09月03日
- 咨詢內容:
本帖最后由 yufei6789 于 2012-3-14 08:05 編輯
借助TradeBlazer 公式開發指南中的例子請指教一下
MyDayMA程序中下面寫入的strValue是當前最新的日MA吧?
MA = AverageFC(Close,length);
strKey = DateToString(Date);
strValue = Text(MA);
SetTBProfileString("DayMA",strKey,strValue);
第一,該指南五分鐘周期中用下式讀取的是當前最新的日MA吧?為什么指南中說這個用到了未來函數呢?能指教一下嗎???
strKey = DateToString(Date);
strValue = GetTBProfileString("DayMA",strKey);
第二,該指南五分鐘周期中用下式讀取的應當是昨日的日MA吧?我想用當日最新的MA,是不是應當用上邊而不是下邊的程序???請指教一下吧
If(Date!=Date[1])
{
strKey = DateToString(Date[1]);
}Else
{
strKey = strKey[1];
}
strValue = GetTBProfileString("DayMA",strKey);
- TB技術人員:
回復 1# yufei6789
1.在歷史行情上,當日的數據是已知,GetTBProfileString只能取到已經走完的日k線數據,并不是實時的數據,所以使用到了未來函數。
2.對的,如果你要當日最新,應該用上面部分的代碼。