-
咨詢內容:
本帖最后由 a379955579 于 2019-10-25 21:52 編輯
我用TBQUANT,回測報告組合利潤不對,如圖(上傳不了圖片和附件)
單個商品利潤加起來不等于下面那個總利潤
這是我設置問題嗎?
?
?來源:CXH99.COM
-
TB技術人員:
? ? ? ? ? ? ? ? 回測組合利潤不對的問題已經解決了。重置系統的所有數據就好。
? ? ? ? ? ? ? ? 這是另一個問題,幫看看這樣子的判斷條件會出問題不?
? ? ? ? ? ? ? ? 我想在當天快要收盤的時候以當前最新價成交,這樣會信號閃爍不?求大神? ? ? ?
? ? ? ? ? ? ? ? if(Currenttime>=0.145958 and Currenttime<0.150001 and MarketPosition<=0 and close>=buyline)
? ? ? ? ? ? ? ? {
? ? ? ? ? ? ? ? BuyToCover(0,close);
? ? ? ? ? ? ? ? Buy(lots,close);
? ? ? ? ? ? ? ? }
? ? ? ? ? ? ? ? if(Currenttime>=0.145958 and Currenttime<0.150001 and MarketPosition>=0 and close<=sellline)
? ? ? ? ? ? ? ? {
? ? ? ? ? ? ? ? Sell(0,close);
? ? ? ? ? ? ? ? SellShort(lots,close);
?
-
TB客服:
? ?? ?? ?? ?? ? 上面那種寫法不知道會不會信號閃爍,重復發單?
? ?? ?? ?? ?? ? 如果改成這樣子,會不會可以避免信號閃爍?
? ?? ?? ?? ?? ? Series<Numeric> a(0);
? ?? ?? ?? ?? ? if(close>=buyline and Currenttime>=0.145958 and Currenttime<0.150001)
? ?? ?? ?? ?? ? {a=1;}
? ?? ?? ?? ?? ? if(Currenttime>=0.145958 and Currenttime<0.150001 and MarketPosition<=0 and a==1)
? ?? ?? ?? ?? ? {
? ?? ?? ?? ?? ? BuyToCover(0,close);
? ?? ?? ?? ?? ? Buy(lots,close);
? ?? ?? ?? ?? ? }
?
-
網友回復:
a379955579 發表于 2019-10-27 00:12
上面那種寫法不知道會不會信號閃爍,重復發單?
? ?? ?? ?? ?? ? 如果改成這樣子,會不會 ...
無論改前改后,都會信號閃爍,都會重復發單 。
建議系統地學習TB公式基礎語法,以及多看看軟件自帶的經典策略公式,然后再試著自己編寫公式。
?
-
網友回復:
Currenttime>=0.145958? ?
Currenttime<0.150001? ?
MarketPosition<=0
a==1? ?? ?? ?? ?? ?? ?? ?
請教下,在這快要收盤的幾秒里面,這四個條件都不會隨著TICK推送而變化,為什么還會重復發單?
開盤賦值a=0,,然后a=0一直不變直到這幾秒,a一旦賦值=1后,這幾秒里面沒有其他賦值給a的內容,難道上面那里當close>=buyline這個條件變得=false的時候,會撤銷a=1這行的賦值嗎?
|