I am testing futures data which I have imported into Amibroker and I am having a weird problem where SetPositionSize does not work correctly but only for certain tickers.
I am using SetPositionSize(200000, spsValue); for all trades. I have set Account Margin to 10 so that 10x leverage is allowed and initial equity to 100000.
The weird thing is that the position size is set correctly for NQ but when I run the same backtest on CL with all the same settings, it uses all kinds of random position sizing as can be seen from the screenshots below. I have no idea why this is happening and would appreciate if anyone can help!
Hello I figured out the solution, the problem was that my Settings > Portfolio > Limit trade size as a % of entry bar volume was set incorrectly. Once I changed that, it works as expected.