Hello,
When I run my strategy in portfolio mode (5% equity) it always returns the same trades and the same number of trades. Is there a way to have the software randomize different positions and trades so I can get a better understanding of how the system fares over the long run with different trade possibilities? I want to hold the 20/5 relationship.
Thank you,
Eric
Size:
Color:
Users are asking for the exact opposite (usually) because Wealth-Lab will randomize the trades as per the User Guide chapter on Strategy Window > Backtesting Strategies > 100% of Equity Sizing.
You can reach what you just expressed with either a Position.Priority assigned in your Strategy code or by having activated "Use worst trades in portfolio simulation" in WL's Preferences > Backtest settings. With the 20/5 relationship, randomization is hardly possible to avoid unless using AtClose(bar) orders.
There are ways to randomize but first let's develop a better understanding of your strategy. Are you saying that there are NO trades excluded due to insufficient capital (you can look the number up on the Trades tab > status bar)?
Size:
Color:
Eugene,
My strategy returns 3000 trades when running in raw profit mode (from 1994 to today). When running in portfolio mode (5% equity) it returns 200 trades broken down by winners and losers and overall APR. If I run the same strategy (in portfolio mode) over and over I get the same exact trades with my strategy from 1994. What I want to do is have the software give me a different mix of those 200 trades out of the 3000 possible from raw profit so I can get an idea of high/low/avg returns.
It only returns missed trades when running in portfolio mode using the 5% equity parameter.
Thanks
Eric
Size:
Color:
@Eric,
Install the
Extra Performance Visualizers Extension.
1. Before you open your strategy, add Monte Carlo to the Visualizers in Preferences (F12)
2. Open your strategy and run a simulation
3. On the Monte Carlo tab, go to Settings and select the Same Date Scramble.
4. Click Go!
See User Guide > Monte Carlo-Lab chapter for more information
Size:
Color:
Eric, please note that Monte Carlo Lab is a premium feature for Wealth-Lab customers. It's not available during free trial.
Size:
Color:
Understood. Is there anything I can do to mimic that simulation without the Monte Carlo premium feature?
Size:
Color:
As I gather it, you get 200 trades from the list of 3000 candidates in RP mode. This is WL's randomization in action. On free trial, you can affect WL's choice for the trades it picks programmatically via the Position.
Priority property. Also programmatically you could delay the entry/exit dates N bars to the future as shown here:
Setups, Triggers, Delays, and Timeouts.
Size:
Color:
Thanks Eugene. Is there a specific location that dives into detail on the position.priority code?
Size:
Color:
It's called the QuickRef tool. Hit F12 key in WL to invoke.
The Priority can be randomized but the most close approximation could probably be accomplished with a random trade delay in the code. Let me come up with a quick sample code...
Size:
Color:
Here's something for you. The entry on a crossover of Close/SMA is delayed randomly by 1-5 bars:
CODE:
Please log in to see this code.
Size:
Color:
Thank you Eugene.
Size:
Color:
You're welcome.
Size:
Color:
A few follow up questions. I have the pro version now so I am going to test the Monte Carlo sim as Cone mentioned above.
Is the same date scramble the best option for what I want? My assumption is that just uses the same date range and randomizes the trade selections.
Is the 5% equity actually limiting my trades to 20 total trades when selected in portfolio mode? Or do I need to put a limit of number of open positions somewhere in my code?
Thank you,
Eric
Size:
Color:
Eric, congrats on becoming a customer. Thanks.
QUOTE:
Is the 5% equity actually limiting my trades to 20 total trades when selected in portfolio mode? Or do I need to put a limit of number of open positions somewhere in my code?
Yes it does. Usually there may be even less than 20 open positions with 5% equity as suggested in post #2.
Size:
Color: