In my backtesting, I'm finding that often trades are rejected for no valid reason.
Using the code below, if I test this very simple strategy on SPY with a Monthly timeframe, with Position Size set to 100% equity, with 1 to 1 margin, it rejects the 2nd trade (entry date of 11/30/98), which is 3 months after the first trade was exited at a profit, and rejects 3 other trades after that. I don't see any valid reason why any of the trades should be rejected.
I'm NOT using a "round lots" setting, and NOT enabling "slippage".
I believe there is a bug in WealthLab itself, where it sometimes tries to set the number of shares for a trade to an amount that would result in a greater amount of capital than in the account.
I've seen situations happen before, where I would set my Position size to 50% of equity, and no trades would be rejected, but I would notice that WealthLab would set the number of shares for a trade to an amount that results in slightly greater than half the initial capital being taken on the 1st trade rather than slightly less than half the capital. In that case, even the 1st trade would be rejected by WealthLab when using 100% equity setting. (and "round lots" and "Slippage" were NOT enabled).
I'm not using PosSizer. I'm simply using 100% Equity with a 1 to 1 margin. Starting Capital is $200,000.
Please fix this bug in WealthLab. I'm running version 6.0.55.0
Thanks,
J.
CODE:
Please log in to see this code.