Portfolio Boss Documentation

Combining All the Features



Thus far, you have learned the three scenarios for using the Divine Engine. These are the most common scenarios you'll encounter. But you may combine the various techniques you learned here to suit your purpose.

For example, you can “fine-tune” a strategy with the Evolutionary search, instead of the Random search. Although it may not be as thorough in searching all the values and combinations, an Evolutionary search may benefit from the Evolutionary progression, building up from a lower performing strategy to create higher performing strategy. So possibly it's more efficient.

And not only can you fine-tune the filters/rules, but you can add new filters/rules as well.


Let's see how it goes:



1.  We'll start with a barebone strategy that we like. It contains some rules and filters, whose values we want to fine tune.



As shown in the video above, those filters you deem essential are set to “Not Replaceable”. These filters will stay no matter what, and you can parameterize their fields. As for a certain filter you have doubts on, you can set it to “Replaceable”. Note, a filter that's set to “Replaceable” can't be parameterized manually by you. It's up to the Divine Engine to define its values, and whether or not it will stay on the strategy.



2.  If you take a look at the rules “Buy Order Type” and “Sell Order Type” (on the System Settings Panel), they don't have the “parameterization” buttons  . Instead, we're presented with the “Replaceable/Not Replaceable” dropdown:



Still you can parameterize these rules, so the Divine Engine will find whether a Market Order or a Limit Order is best for them. To do so, set them to “Replaceable”. If the Divine Engine finds that a Limit Order (N ATR Limit Order) is best, then it will also define how the Limit Order is calculated, by automatically enabling and parameterizing the corresponding “Buy/Sell Order Limit” rule below them:



If you set them as “Not Replaceable”, any value that you manually set (either a Market or N ATR Limit Order) will stay no matter what.

The same thing also applies to the property “System”; you can set it to “Replaceable” so the Divine Engine finds the best of the two values for it (Continuously Switching or a Periodic system). If it decides on a Periodic system, the two properties below it “Monthly Switch on Open Of” and “Don't Switch if Position is Still in Top” will be automatically parameterized by the Divine Engine to find the best values for them.




3.  Because we want to benefit from the evolutionary progression rather than brute-force random search, let's set the “Search Algorithm” to “Evolutionary”:



Also make sure the property “Rule Set Parameterization” is set to “Random Selection”, with the checkbox “Use Current Rule Set as Baseline” ticked. If you don't tick the checkbox, any “Replaceable” filters are more likely to be replaced. The rest of the properties are set as usual; and as for the Fitness Functions, we use “Score” and “R2”.

Since we have multiple Fitness Functions, it's best to enable Rotational Fitness.



If you remember in a previous scenario, we simply set this property to “Enabled”. But this time, we set it to “Enabled: Use Permutations”. With permutations, the Divine Engine may yield a more consistent strategy, at the expense of a slightly lower performance. But it's up to you which one to use. You can even set this to “Disabled” if you have but one Fitness Function.



4.  Start the Boss as usual. And when it's finished, load a top result and see its contents:



As you can see, the filters we supplied (“Not Replaceable”) are still there. They're applied with new better values specified within our parameterization settings. For example if we set parameterization to “10 to 50 days with a step of 10 days”, then the new value will fall within such a range. A parameter that we did not parameterize will retain its original value. As for the “Replaceable” filter, you see that the Divine Engine has applied its own values into it. Ditto the new filters added by the Divine Engine are applied with random values whose parameterization range is defined by the Divine Engine itself.

Keep in mind though, the Evolutionary search merely “picks” a random value within such a range that you specified. It does not test all those values and decide the best one. Random search on the other hand, given enough iterations, will calculate all values and combinations and pick the best one.





5.  So far we've done numerous Divine Engine backtests, and their results can be browsed by clicking each Backtest Item one by one (on the Divine Engine Results Tab).



It would be difficult to see which one is the best-performing strategy from all these results. So, what if they are pooled together, and you can pick the top 20 strategies?

Take a look at the Overall Top Results Tab:



This Tab picks the top 20 from the hundreds of strategies produced by the Divine Engine, based on the highest “Fitness (IS)” score as shown on the Divine Engine Results Tab:



Therefore, no matter what Fitness Functions you used for each Backtest Item (each Divine Engine run), for example one Backtest Item uses “CAGR” and “R²”, while another uses “Score” and “Avg. Drawdown”, they are all normalized into a factor of 1 as the final Fitness Score, and the top 20 Fitness Score get selected to be displayed on the “Overall Top Results” Tab.

That's why it is highly recommended that a fresh strategy you created (from the “Strategy Management” page), shall only contain generally similar Fitness Functions for all the Divine Engine runs. If you decide to use wholly different Fitness Functions criteria, it's best to start fresh with a new strategy:



Otherwise, the top 20 strategies may not reflect fair comparisons between the different Backtest Items. For example, a Backtest Item that uses “Average Position Gain” may yield Fitness Score upward of 1000, whereas another Backtest Item that simply uses CAGR only yields Fitness Score not far from 1. Thus the top 20 is highly skewed to favor the first Backtest Item.



You can prevent this by using a sensible threshold value for your Fitness Function(s), but it could be difficult to decide. Either way, don't care too much about the top 20; just experiment and play!

Anyway, this Overall Top Results Tab also shows the actual metrics' values for the top 20 strategies (values on CAGR, R², Score, etc):



If you wish to see a metric column that's not shown here, you can use the “Manage Columns” dialog:



It also lets you load a top strategy by clicking the “Load Parameters” button similar to what you did on the Divine Engine Results Tab.

For more in-depth information on this “Overall Top Results” Tab, refer to the help page here.





The Overall Top Results Tab actually lists the top 20 strategies from all backtests you did on this strategy, be they manual backtests, or Divine Engine (The Boss or local).




Back to Top