Trading Systems Tips: How to Evaluate Multiple Triggers and Find the Best One

Need More Help? Book Your FREE Strategy Session With Our Team Today!

We'll help you map out a plan to fix the problems in your trading and get you to the next level. Answer a few questions on our application and then choose a time that works for you.


What is the best way to start developing a strategy?

As you know, the key to developing robust and profitable strategies is to be guided by the characteristics of the market you are trading and choosing the correct entry trigger.

However, testing and comparing different triggers can be very time-consuming. But don’t worry.

As we show in this video, there is a solution to test multiple triggers simultaneously and save time and effort!

We’ll explain how to use a single code to test multiple triggers and choose the right one for your strategy.

By watching the video, you’ll discover:
-How to create a code to test multiple triggers at the same time
-How to optimize the code to find the most effective trigger
-Some examples of trend-following triggers

Enjoy! 😉



Hey everyone, and welcome back to this brand new video!

When trading a financial instrument, it’s definitely worthwhile to familiarize yourself with its underlying characteristics.

There are markets that, when confronted with a trend, tend to go along with it and continue their course in that direction.

Others, instead, tend to pull back in the opposite direction.

So today we want to focus on a question that we are often asked, which is: “What is the best way to start developing a strategy?

How do you find the best starting point?”

One of the coaches at Unger Academy here, and today we’re going to be answering these questions using a handy instrument.

I want to show you this because starting off on the right foot always gives us an advantage and it allows us to develop more profitable strategies.

Instruments and approaches

Alright, anyone who has ever tried to develop a trading strategy has been confronted with initial decisions, first and foremost the financial instrument for which to develop a strategy.

There are many available. We have precious metals, energy goods, stock and bond indexes or commodities such as grains, coffee and many others.

Based on the instrument chosen, the question is what type of operation is best.

If we imagine a rising price trend, we could bet on its continuation. Then we would talk about a trend-following strategy.

Or we might decide to target a downtrend in prices, and in that case, we would talk about a reversal strategy.

In a recent video, we’ve already shown you how to quickly and effectively identify the best operation for a given instrument.

Today, instead, we want to go into a little more detail and talk about the trigger that underlies each of our strategies.

First, however, we need to understand what a trigger is. Let's take a look at an example.

Trend-following triggers

Let’s imagine we chose our instrument, for example, Gasoline futures, and also having already checked that it’s best to develop it using a trend-following strategy.

A trend-following type trigger could then look like this: I open a long position when prices exceed the highest high of the last session, and open a short position when prices fall below the lowest low of the last session.

So the trigger is nothing but the core of our strategies.

The part of the strategy that tells us the direction for our entry orders and how.

If we use EasyLanguage, then we can code this trigger by writing these two lines.

Possible combinations of entry triggers and exits

We can then imagine many different triggers.

Here I’ve listed the most commonly used triggers for trend-following strategies.

We will then go to launch orders at the break of the low and high of the current or previous week or the last two weeks, or even the current or previous session or the last N sessions.

Finally, we could place orders on the highs and lows of the last N bars.

We then have three possible exits from the market.

A first exit without a time exit, meaning that the trade can be closed by switching positions from long to short and vice versa.

A Friday exit at the end of the week at the end of the session.

And finally, an exit every day at the end of the daily session.

Any combination of one of these triggers and a possible exit could be a valuable starting point.

If we could then compare all the possible combinations, we could choose the best one here to start developing our instrument.

Ideally, we would like to create some kind of ranking list that would show us which triggers are the best.

How can we do that? The first idea would be to write the code for each trigger, and apply it to our chart, just like we do for our strategies.

We then need to tag the metrics somewhere so we can compare all the different cases.

It’s doable, of course, but certainly a bit time consuming and cumbersome.

You could then take all the various triggers and all the possible exits in one code, upload them onto the chart, and run an optimization, just like we do with strategies.

The result of our optimization will immediately tell us which triggers are the best.

Let's take a closer look at the code.

A tool to find the best trigger

Here is our code.

We have the input "trigger" which may vary between 1 and 7, which are all the triggers that we're going to test.

Here we see the "ExitMode" input: when it has a value of zero, the trades are free to change positions from long to short and vice versa. When it is equal to 1 the trades are closed at the end of the week. When it is equal to 2 they are closed at the end of each session.

We have got the inputs, "DaysAgo" and "DCLength", which we need to refine triggers six and seven.

And we also included the stop loss.

Take a look at some of them.

Trigger number 1, if you recall, sent orders on the high and low of the current week.

Trigger number 2 on the previous week and so on.

Trigger number 6 was going to calculate highs and lows of the last N sessions.

I then need another input, "DaysAgo", to check how many days back we need to look for our levels.

Finally, we have Trigger number 7, which places orders on the high and low of a Donchian channel consisting of a "DCLength" number of bars.

Here you can see the exit modes, the inputs for the exits, 1 and 2, and finally our stop loss.

Results on the S&P 500 Futures

Let's go to a chart.

We are on the SP 500 Futures with a 60-minute timeframe and data from 2010.

We immediately load our instrument and we start the optimization.

The "Trigger" input will vary between 1 and 7.

The "ExitMode" input will vary between 0 and 2.

Remember that "DaysAgo" can range between 1 and a maximum of 5 days ago.

"DCLength" for our Donchian channel can vary between 0 and 50 in steps of 10.

We are in an hourly time frame.

Finally, I’ve also included the stop loss of $1,200, I don’t optimize it at this stage, but is compatible with the instrument for both intraday and multiday modes.

This is what our results will look like.

In the first columns we can find the most important metrics, namely, Net profit, Average trade, Total number of trades, Maximum Drawdown.

Here on the right side are the input values that allowed us to get these results.

On the SP 500, we can see that the result with the best Net Profit is the one where the "Trigger" is set to 1 and the "ExitMode" is set to 0.

I’ve already uploaded these values to our chart, and I would say that without having to investigate the metrics further, we can say that this trigger didn’t produce great results on this instrument.

But then again, we know that U.S. stock indexes lend themselves quite poorly to being traded with a trend-following approach, so that’s not too surprising.

Results on the Gasoline Futures

Now let’s move on to another instrument.

Let's talk about the RBOB Gasoline future and work, again, with a 60-minute chart and data from 2010.

Let's start optimizing this instrument using our tool.

The ranges are the same as before, the only thing we changed is the stop loss, which we increased slightly to $1,500 because it fits better with this type of underlying asset.

Let's start with the optimization. Here are the results.

Well, here we can say that this time the situation is much better.

We have an interesting Net Profit of approximately $350,000.

An abundant average trade of $185, which is definitely good for the instrument.

A maximum drawdown that is less than 10% of net profit.

What is the combination of trigger and exit that leads to this result? We can see it here.

So, we have Trigger number 7, if we remember, it was the Donchian channel, and here we see the length of the channel, 30 bars at 60 minutes, with Exit number 1.

Exit number 1 closed our trades on Friday at the end of the session.

Now let’s plot these values on our chart and let's go and take a look at the metrics.

Numerically, we’ve already read them out loud.

We see an undoubtedly positive equity, and of course we are happy about that.

Even from the Annual report, we can see that apart from one year, the strategy would certainly have given good returns.

If you remember, we had started with a 60-minute time frame.

Now we’ve moved to a lower, 30-minute time frame, and we want to start an optimization on the length of the Donchian channel that we've just found.

Here is our screen. Of course, the other inputs won’t be touched. The only one that will be optimized is the Donchian channel, which we optimize from 0 to 100, in steps of 4.

This is the result of our optimization.

We’re seeing a decidedly good Net Profit of $370,000.

A generous Average trade of $175 and a Channel length of 48 bars.

Moreover, the values 52 and 44, that are in the neighborhood of 48, give us good metrics, and so we like this value and we’ll choose it.

Let's go and update the value that we’ve just found on our chart and let’s look at the metrics.

Here we see a decidedly positive Annual Period Analysis. We don’t have any loss-making years.

The curve is clearly pointing up, which we certainly like very much, and the Average trade of $175 is very good for developing a strategy for Gasoline futures.

Of course, such an instrument can be freely modeled by any of you to compare triggers that may be different from the ones I’ve shown you today.

For example, if we want to use it for a reversal approach, all we have to do is swap the "buy" and "sell short" commands with each other and then change the order type from stop to limit.


I want to reiterate that this is a starting point from which we can filter the strategy to achieve even better results.

Here is where the Unger Method comes in, which allows us to turn a simple trigger like the one shown here and turn it into a strategy with, let’s say, broad shoulders, ready to be taken to market.

With that guys, we’ve seen a possible solution to quickly find a good starting trigger by avoiding to spend hours and hours in the tedious search and already starting with something promising.

If there is anyone among you who's interested in the world of systematic trading, I recommend that you go and click on the link in the description of this video. From there, you can go and watch a free presentation by Andrea Unger, get our best-selling book "The Unger Method" by just covering the shipping costs, or even book a free call with a member of our team.

If you enjoyed the video, please leave us a Like, subscribe to our channel and please go and click on the notification bell as well so that you can stay updated.

Thank you so much for watching, we will see you soon in our next video! Bye bye for now!

Need More Help? Book Your FREE Strategy Session With Our Team Today!

We'll help you map out a plan to fix the problems in your trading and get you to the next level. Answer a few questions on our application and then choose a time that works for you.

Andrea Unger

Andrea Unger

Andrea Unger here and I help retail traders to improve their trading, scientifically. I went from being a cog in the machine in a multinational company to the only 4-Time World Trading Champion in a little more than 10 years.

I've been a professional trader since 2001 and in 2008 I became World Champion using just 4 automated trading systems. 

In 2015 I founded Unger Academy, where I teach my method of developing effecting trading strategies: a scientific, replicable and universal method, based on numbers and statistics, not hunches, which led me and my students to become Champions again and again.

Now I'm here to help you learn how to develop your own strategies, autonomously. This channel will help you improve your trading, know the markets better, and apply the scientific method to financial markets.

Becoming a trader is harder than you think, but if you have passion, will, and sufficient capital, you'll learn how to code and develop effective strategies, manage risk, and diversify a portfolio of trading systems to greatly improve your chances of becoming successful.