不明不白 [開拓者 TB]
- 咨詢內容:
本帖最后由 chairmin 于 2013-8-24 07:20 編輯
//------------------------------------------------------------------------
// 簡稱: A_FFFFF
// 名稱: FFFF
// 類別: 公式應用
// 類型: 用戶應用
//------------------------------------------------------------------------
Vars
NumericSeries preE;
Numeric mar;
Begin
mar= MarketPosition;
if (AItime(750)==True) preE = 999;
if (AItime(750)==False) preE = 111;
Commentary("preE="+Text(preE));
Commentary("myenter="+Text(mar));
if (AItime(700)==true)
{
Buy(1,Close+2);
}
if (AItime(700)==False)
{
SellShort(1,Close-2);
}
End
//------------------------------------------------------------------------
// 簡稱: AItime
// 名稱: 信號許可交易時間
// 類別: 用戶函數
// 類型: 用戶函數
// 輸出: 布爾型
//------------------------------------------------------------------------
Params
Numeric Num(5);
Vars
Bool Con1(False);
Numeric sj;
Numeric bartime;
Begin
sj = Mod( CurrentTime * 1000000 , 10000 );// 取當前系統時間分鐘和秒
bartime = Mod ( Time * 1000000 , 10000);
If( (bartime == 1500 or bartime == 3000 or bartime == 4500 Or bartime ==0000 )and (CurrentTime<0.085899 or CurrentTime> 0.150200) ) con1 = True ;
If(BarInterval==15) //當 當前K線周期值 = 15時
{
If(( sj>=(1460-Num) and sj<1500 ) or ( sj>=(4460-Num) and sj<4500 ) or ( sj>=(2960-Num) and sj<3000 ) or ( sj>=(5960-Num) and sj<6000 ) )
{
con1 = True;
}
}
If(BarInterval==30)
{
If ( (sj>=(2960-Num) and sj<3000) or ( sj>=(5960-Num) and sj<6000) ) con1 = True;
}
If(BarInterval==60)
{
If(sj >= (5960-Num) and sj < 6000) con1 = True;
}
Return Con1;
End - TB技術人員:
看來我注定只能用文華
- TB客服:
樓主的代碼里用到了currenttime,這個時間是不斷變化,所以,你計算出來的AItime的值是變化的,會造成信號的消失
- 網友回復:
本帖最后由 chairmin 于 2013-8-22 14:20 編輯
ample 發表于 2013-8-21 14:58
樓主的代碼里用到了currenttime,這個時間是不斷變化,所以,你計算出來的AItime的值是變化的,會造成信號 ...
但是空單都不能建出來,每次都是只開多單。這是為什么? 難道是因為遞一個BAR 是空的信號? 學藝不精,還得努力 - 網友回復:
主要還是跟AItime函數的編寫有關,因為,計算出來的值全是true
有思路,想編寫各種指標公式,程序化交易模型,選股公式,預警公式的朋友
可聯系技術人員 QQ: 1145508240 進行 有償 編寫!(不貴!點擊查看價格!)
相關文章
-
沒有相關內容