Skipping Trades to Improve Your Trading Strategies? Exploring the Z-Score Metric & Ghost Systems

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.

BOOK YOUR FREE STRATEGY SESSION NOW >>

Can we take advantage of alternating profit and loss trades to improve the performance of our strategies?
In this video, we’ll show you a possible method to check the existence of a correlation between profit and loss trades in our systems.

Not only that, but we’ll also explain how you can use this information to skip the next trade based on the outcome of the previous one.

By watching the video, you’ll discover:
-How to use the Z-Score metric to find out if there is a correlation between profit and loss trades
-How to use the Z-Score to decide whether or not to skip the next trade
-How to translate it into PowerLanguage code using the Ghost System "trick"

Enjoy the video!

Transcription

Introduction

Hey everyone and welcome to this brand-new video!

After a successful trade, is it better to skip the next trade? Is it better to wait for a losing trade before entering a position?

One of the coaches at Unger Academy here, and today we'll see in which cases this technique can be profitable to find out if and how we can pause our strategies.

Alternation between winning and losing trades

Okay, so how often have we experienced a loss, maybe even a big loss, right after a nice, profitable trade?

And that makes us want to figure out if skipping the next trade might give us an advantage.

That’s a controversial question that sometimes leads us to believe that after a winning trade, we’re more likely to get a losing trade, which then we’d rather skip.

Similarly, one may be led to believe that it could be profitable to enter a position after a losing trade.

In a nutshell, what we want to understand is how to skip trades based on the outcome of the last trade that we made.

To do this, we’ll use a metric called “Z Score”. Let's just take a look at what “Z-Score” is.

The Z-Score

So Z-Score has been used in business in the past to estimate the insolvency risk of companies.

In data analysis, Z-Score measures how far a portion of data can deviate from the mean of a larger sample.

But now what does the Z-Score mean in trading? It measures how much our trades depend on each other.

It generally ranges from a value of -3 to a value of +3.

A value close to +3 indicates a tendency to alternate trades of an opposite sign. So, a loss is more likely to be followed by a winning trade.

On the other hand, a value close to -3 indicates a tendency to make a series of trades with the same sign. In this case, we see losing trades following one after the other.

For the more curious, here’s the Z Score formula.

This should not scare us because MultiCharts comes to our rescue by showing us the value of this metric directly in the Trade Analysis tabs.

But now that we know this metric, how can we take advantage of it?

Using Z-Score in Trading

First of all, it doesn't happen often that a strategy has a Z-Score greater than 2 or less than -2.

If we applied this logic to strategies with a Z-Score between -2 and +2, we wouldn’t get satisfactory results.

However, if we were to find strategies with a Z-Score value greater than +2, for example, we would have a good chance of seeing trades that alternate between winning and losing trades

In this case, we could improve our system by skipping the next trade after a winning trade has taken place and then opting for trading after a losing trade has occurred.

The results of a sample strategy

So let me show you the result I got by applying this logic to a strategy that I had developed for Platinum some time ago and I noticed has a Z-Score of 2.16.

Here you’ll find the list of all the trades of the original strategy, while in this other column, only the trades that were filtered according to the logic we now see together are highlighted in yellow.

In this case, we had a losing trade. So, we decided to take the next trade.

In this other case, after a successful trade, the filtered strategy decided to skip the trade.

Please note that if there were several losing trades in a row, the strategy would continue to work while in the case of several winning trades in a row, only the first trade would have been skipped.

Here we see a summary table of the results.

Let's see: the original strategy would have made about 1,200 trades with a net profit of $76,000 and an Average trade of $62. Definitely bad for this instrument.

As we saw earlier, the filtered strategy would have missed 356 trades, thus leaving 880 trades. The Net profit would have increased to $96,000, with an Average trade of $110.

This would have been an almost tradable level for the instrument.

We also note that the Net profit would have increased by 26%, and the Average trade would have increased by over 75%.

Indeed, in cases like this, it appears that skipping the next trade after a profitable trade provides a real monetary advantage.

Programming issues

So now we only have to figure out how we can code our idea.

This shouldn't be difficult. We just need to write an additional condition that allows the trade only if the last trade was a losing one.

We could add an instruction like "if PositionProfit(1) < 0" to send our orders.

This should allow us to trade only if the last trade resulted in a loss.

However, let's just pause for a moment and look closer.

If we skip a trade, we can’t know if that trade was a winning or losing one.

Indeed, with MultiCharts, this trade never existed.

And yeah, that means that we can't use that condition.

But the problem is that we need that information to decide whether to trade, we can't do without it.

So how can we keep track of losing and winning trades?

Let's say this is one of those cases where performing a backtest is not trivial.

We should resort to a so-called “Ghost system” or “Mirror system”, which moves like a shadow in parallel with our strategy and keeps track of all theoretical winning or losing trades even if our real system won’t execute some of those trades.

Based on the theoretical trades that our Ghost system will show us, we can decide whether or not to trade the market.

Basically, we could say that the Ghost system acts as a green light or a red light. When it turns green we can go live with the following trade if there has been a losing trade.

On the other hand, if the last theoretical trade was a winning trade, the light turns red, and we have to wait for a theoretical losing trade before we can go live again.

The solution: a ghost system

As expected, Ghost systems are far from easy to implement, but to at least understand how such a system can work, and to give you a starting point for your developments, let me show you a very simple case.

Let's imagine that we’re only trading long on the SP 500, and we want to enter a position at 5:30 p.m. and then close all trades at the end of the session.

Here we see the simple code.

Then, we go and introduce the filter condition in the code. We only want to trade if the last trade was a losing trade.

Remember that we can’t introduce the condition related to the Net profit of the trade because of the problem we've seen earlier.

So, we have to use additional variables - "EntryPrice", "ExitPrice" - to calculate the "myProfit" of the last trade.

Then at 5:30 p.m., we’ll save in the variable "EntryPrice" the last close.

At 4:00 p.m., at the session close of the SP 500, we’ll store in the variable "ExitPrice" the Close and calculate the "myProfit" as the difference between the exit and the entry.

In this case, if the "myProfit" is less than zero, we’ll buy at 5:30. p.m. Otherwise, we won’t.

We’ll close as before at the end of the session.

Below, I’d just like to show you the indicator we’ll now see on the chart, which I used to show you graphically where it’s possible to trade and where not.

We’ve moved to MultiCharts to see what we’ve coded.

Here, we find the unfiltered system, which we recall, works at all sessions, buying at the beginning of the day and closing at the end of the session.

Below I’ve shown the indicator, colored green or red, depending on whether the trade closed in the previous session was a winning or a losing trade.

Here we see a losing trade, and the indicator turns red in the next session.

Here we see a winning trade, and the indicator turns green.

Let's assume the indicator is working.

Below you can see our system with the applied filter.

As we can see, the system works only when the indicator is red, so it makes this trade, makes this trade, skips this trade, makes that trade, and so on.

So, let's assume that our system' s now working, and it works.

What we’ve seen is a simple example. Those who want to go into more detail can try more complicated systems to pause their strategies.

Also, other factors could be considered, such as introducing a minimum threshold for the value of trades before they’re considered winning or losing trades, like “N” ticks.

Or we could try and wait for several losing trades in a row instead of just one, you know, or something else.

Let's just say that the limit here is just your imagination, although, to be honest, we have to find a way to balance our curiosity with being able to code our ideas.

Final thoughts

Well, guys, we can now say that we know what the Z-Score is and how it can be used to improve our systems in certain cases.

We’ve also seen a technique that we can adapt to our strategies to pause them after a winning trade and resume trading them after a losing trade.

To answer the questions that we started with: This technique could give us an advantage because some systems alternate winning and losing trades.

If there is anyone among you who's interested in the world of systematic trading, I recommend that you go and click the link in the description. From there, you'll be able to watch a free presentation by Andrea Unger, in which he introduces his trading method, which allowed him to become the only 4-time world trading champion, or go and get our best-selling book by just covering the shipping costs, and book a free consultation call with a member of our team too.

If you enjoyed the video, please leave us a Like, subscribe to our channel and click on the notification bell to stay updated on the release of all our new videos.

We really thank you so much for your attention, and will see you soon in our next video, bye bye!

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.

BOOK YOUR FREE STRATEGY SESSION NOW >>
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.