Post 語句 和 From Entry 語句的Bug,請MC的同事進來看看 [MC]
-
MC用戶求助:
[IntrabarOrderGeneration = true]
print(q_time_s,"####",PosTradeCount(0),"**",
??? ??? ??? PosTradeExitName(1,0),"-",PosTradeExitName(1,1),"-",PosTradeExitName(1,2),"|||||",
??? ??? ??? PosTradeEntryName(0,0),"-",PosTradeEntryName(0,1),"-",PosTradeEntryName(0,2));
if PosTradeEntryName(0,0)<>"L1" then Buy ( "L1" ) 1 contract Next Bar At open-MinMove*(1 point) Limit;
if PosTradeEntryName(0,1)<>"L2" then Buy ( "L2" ) 1 contract Next Bar At open-MinMove*(2 point) Limit;
if PosTradeEntryName(0,2)<>"L3" then Buy ( "L3" ) 1 contract Next Bar At open-MinMove*(3 point) Limit;
???
if marketposition>0 then begin
??? if PosTradeEntryName(0,0)="L1" then Sell From Entry("L1") 1 contract Next Bar At open Limit;
??? if PosTradeEntryName(0,1)="L2" then Sell From Entry("L2") 1 contract Next Bar At open-MinMove*(1 point) Limit;
??? if PosTradeEntryName(0,1)="L3" then Sell From Entry("L3") 1 contract Next Bar At open-MinMove*(2 point) Limit;
end;?
這段測試代碼當只有L1被執(zhí)行和被平倉的時候,Print 語句中的信息與真實持倉沒有出入,很準確;
但是,當L2被執(zhí)行或者L3被執(zhí)行后,再平倉L3或者L2后,Print語句中的信息與真實持倉完全不同;
63441.00####?? 3.00**Sell-Sell#1-Sell|||||L1-L2-L3 ,這是在平倉L2和L3之后打印出來的,也就是說,系統(tǒng)還認為L2和L3存單子存在。
?
設(shè)置是SA+真回報+模擬環(huán)境;如果不是我哪里設(shè)置問題,那應(yīng)該是個MC的BUG了。
?
-
MC回復(fù)討論一:
https://forum.multicharts.cn/forum/cat/0/thread/490
這個帖子已經(jīng)回復(fù)您了
有思路,想編寫各種指標公式,程序化交易模型,選股公式,預(yù)警公式的朋友
可聯(lián)系技術(shù)人員 QQ: 511411198 進行 有償 編寫!(不貴!點擊查看價格!)
相關(guān)文章
-
沒有相關(guān)內(nèi)容