QUOTE:
Can anyone please tell me what the prescribed way of doing this is?
There is no prescribed way of doing this, because it is completely undocumented, so it's unsupported.
QUOTE:
It's using the wrong positions size
This is a slightly incorrect way of saying. It's using the right position size, but it's different from what's there in the data pane because you haven't properly initialized a TradingSystemExecutor instance. There's many dirty work to do before you can match the Position Sizing dialog. Luckily, it's been already done:
1. Download the Community.Components extension that contains all required helper functions to correctly initialize TradingSystemExecutor.
2. Explore its source code:
WL5 Wiki.
a)What you're looking for is here -
public SystemPerformance runDonor(WealthScript obj, WealthScript yourStrategy)b) Notice there's an overload method for executing a Strategy in Multi-Symbol Mode, and there's another one for Single-Symbol Backtest.
3. Read this KB article -
WealthScript Techniques | Interacting Dynamically with Portfolio Level Equity - to know what sort of problem you will face next because of the
internal tick adjustment Wealth-Lab applies to stop/limit orders.