- ago
Hi Wealth Lab Community and Support Team,

I'm reaching out to tap into the collective expertise of this forum to tackle an automation challenge I've been facing. I'm aware that this topic was briefly touched upon last month in this post : https://www.wealth-lab.com/Discussion/Apply-Live-Positions-feature-selectively-by-strategy-10316, but I'd like to dive deeper into the subject and actively seek a viable solution.

Over the past few weeks, I've been working towards automating my trading process. Currently, I'm executing six strategies on the US stock market, utilizing the Strategy Monitor, Order Manager, and Quote Monitor within WL8. Four strategies are based on limit orders, while two on market open orders, each with a cap of five active orders.

Despite reading discussions on similar topics within the forum, I haven't found a satisfying solution. Below is an outline of the problems, my attempts at resolving them, and the gaps I'm still trying to bridge:

Here is my actual daily process :

1. Managing Exit Signals: Post-market close, I activate "Use Live Positions" to manage exits signals using the strategy monitor. However, since the broker doesn't retain strategy associations, WL8 mixes up signals across strategies. As a manuel workaround, I've been tracking trades in my own database with the strategy name to ensure I'm sending the appropriate signals for each strategy to the Order Manager.

2. Generating Entry Signals: Re-Running each strategy without "Use Live Positions" is necessary for accurate entry signals, as WL8 otherwise assumes I've reached the max positions of 5 due to active trades of all my strategies.
For market open orders, I dispatch these directly to the Order Manager Window.
For limit orders, I dispatch these through the Quotes and Price Triggers Windows, using DrKoch's FillProbability function to avoid sending to many signals into the Quote Monitor.

3. API and WL8 Sync: Restart the Interactive Brokers API and reconnect WL8 to the broker, including activating broker streams and AutoTrade for each Quote Monitor

This process is taking me around 20 minutes a day with error-prone.

Last week, inspired by this article on strategy anatomy : https://www.wealth-lab.com/blog/anatomy-of-a-wl7-strategy, I redefined the BacktestBegin function to preload active positions by strategy from my database. Allowing the Execute function to validate if the current strategy has the symbol as an active position before generating exit signals. This has streamlined exit signal handling.

However there is still some missing part that I don't know how to solve with the current WL8 framework.

1. Automatically update my database with filled order: Is there any callback/class to overwrite from the Order Manager when orders get filled, which would enable auto-updating my database and eliminating manual updates. The broker API already notify WL8 Order Manager when a position is filled. So if WL8 could keep track of the signals strategy name into the order manager window it would be possible to synchronize a database with active position by strategy.

2. Enhance the synchronization process with the broker (utilizing the 'Use Live Positions' feature) to include additional data, such as the strategy name and the entry date. Ideally, WL8 would retrieve positions from the broker and offer the capability to enrich this data by interfacing with our databases.
It seems that certain adjustments might also be needed within the WL8 Strategy Monitor to take the strategy name into account when counting the active positions for each strategy. Given that the WL8 Position class already accommodates a MetaStrategyName, allowing MetaStrategies to manage positions by strategy,
integrating this functionality with the Strategy Monitor should be a feasible enhancement.

I've attached a high-level design schematic to provide clarity on my thought process.

I wonder if there are features in WL8 that I may have missed which could enhance the automation of my process, especially in the management of multiple strategies at once.
I'm hopeful for a collaborative approach in finding a solution. Could any fellow traders suggest enhancements or provide insights on overcoming these hurdles?

Thank you for your time!
4 Replies



- ago

To date, I have not received feedback, and I understand everyone is busy and discussions move quickly here. However, this topic is quite important to my trading operations, and I would greatly appreciate any insights or guidance the community can offer.

In brief, I am seeking a solution to automate the tracking of strategy names as metadata linked to live broker positions. This feature would significantly streamline the process managing multiple strategies simultaneously.

I've looked into the possibility of using the UpdateSignalStatus callback within WL8's Extension API and wonder if there's a way to utilize this alongside the Interactive Brokers extension, or if any community members have insights into handling similar requirements.

If there is a built-in feature, an extension, or a custom development approach that I've overlooked, I'd be keen to learn more about it. I'm also open to collaborating on a solution or hearing if there's a need for a feature request that could benefit others in the community.

Additionally, @Glitch and @Cone, I'm considering reaching out to the concierge service for a more tailored solution if you feel that my query is too specific for a built-in feature. However, I believe that improving this functionality could greatly benefit WL8 overall, especially in enhancing multi-strategy trading capabilities.


 ( 11.64% )
- ago
I bookmarked this to read a bit later on. I'm currently wrapping up the ability to access manually drawn chart objects from Strategy code which was near the top of the Wish List :)
 ( 28.45% )
- ago
Re: 1. Automatically update my database with filled order:
Your can retrieve the broker positions in the strategy. Start at about Post #18 here -

Re: 2. Enhance the synchronization process with the broker
Brokers don't supply meta data about how shares were traded. There is no reasonable solution for this without making wild assumptions that would be false with the first discretionary trade you enter.
- ago
Thank you, Cone, for the reference link. I appreciate the direction to further information. However, the core issue I'm addressing isn't about retrieving data from the broker, but rather the challenge of integrating and managing additional metadata within our trading strategies.

You're absolutely right that brokers don't have insights into specifics like which strategy prompted a particular trade or the number of shares allocated per strategy, especially in the case of discretionary trades. This gap in information is precisely why I maintain a separate database to manage my WL8 active positions, where essential metadata such as strategy names and share quantities are stored.

I understand and don't wish to reiterate my initial post, but my primary point is the potential for WL8 to enhance its features in this area. It would be beneficial if WL8 could provide access to certain callbacks, allowing users like me to implement a custom solutions. Alternatively, a more integrated approach within WL8, possibly through a new window for managing these metadata, would be a significant improvement.

I look forward to hearing Glitch's insights on this matter when he has the opportunity to review it. Thanks again for your time and input.