Hello,
I am a little bit clueless, hopefully someone will have already had that problem.
I'm using a Low Level CBT (taken from tradingmarkets advanced course "CBT-Limits.afl"), that I have very slightly altered to buy on limit breakouts (it was originally buying limit pullbacks).
Now upon checking if it all behalves as it should, I have found that some trades sent to bo.EnterTrade were not appearing in the backtester UI.
Tracing like that:
_TRACE(WriteVal(dn[bar],8.0,False)+": Entering trade for " +sig.Symbol+" nPos = "+nPos);
bo.EnterTrade(bar, sig.Symbol, sig.IsLong(), sig.Price, sig.PosSize, 0, sig.RoundLotSize);
I get 6 limit orders that reached their limit and should be opened in the Traces :
00003083 18.50150490 [16700] 1210413: Entering trade for IFF nPos = 3
00003084 18.50169373 [16700] 1210413: Entering trade for KREF nPos = 6
00003085 18.50201035 [16700] 1210413: Entering trade for RMBI nPos = 8
00003086 18.50215530 [16700] 1210413: Entering trade for MVBF nPos = 10
00003087 18.50274467 [16700] 1210413: Entering trade for SPWH nPos = 14
00003088 18.50318146 [16700] 1210413: Entering trade for BLD nPos = 17
But only 4 trades appear in the backtester for that day:
Symbol | Trade | Date | Price | Ex. date | Ex. Price | % chg | Profit | % Profit | Shares | Position value |
---|---|---|---|---|---|---|---|---|---|---|
KREF | Open Long | 4/13/2021 | 19.56391 | 4/13/2021 | 19.81 | 1.26% | 6.58 | 1.12% | 30 | 586.92 |
RMBI | Open Long | 4/13/2021 | 14.13283 | 4/13/2021 | 14.01 | -0.87% | -5.71 | -1.01% | 40 | 565.31 |
MVBF | Open Long | 4/13/2021 | 36.17723 | 4/13/2021 | 36.25 | 0.20% | -0.07 | -0.02% | 10 | 361.77 |
SPWH | Open Long | 4/13/2021 | 17.62353 | 4/13/2021 | 17.54 | -0.47% | -3.31 | -0.63% | 30 | 528.71 |
Since this is the first day backtested and all the logic involving checking of available slots is already done before in the code (and there is lots of slots available), I don't see why some trades would be ignored, especially at such low level.
As anyone had this behavior in the past ?
Thanks a lot for any pointer.