Afrikaans
Akan
Albanian
Amharic
Arabic
Armenian
Azerbaijani
Basque
Belarusian
Bemba
Bengali
Bihari
Bosnian
Breton
Bulgarian
Cambodian
Catalan
Cebuano
Cherokee
Chichewa
Chinese (Simplified)
Chinese (Traditional)
Corsican
Croatian
Czech
Danish
Dutch
English
Esperanto
Estonian
Ewe
Faroese
Filipino
Finnish
French
Frisian
Ga
Galician
Georgian
German
Greek
Guarani
Gujarati
Haitian Creole
Hausa
Hawaiian
Hebrew
Hindi
Hmong
Hungarian
Icelandic
Igbo
Indonesian
Interlingua
Irish
Italian
Japanese
Javanese
Kannada
Kazakh
Kinyarwanda
Kirundi
Kongo
Korean
Krio (Sierra Leone)
Kurdish
Kurdish (Soranî)
Kyrgyz
Laothian
Latin
Latvian
Lingala
Lithuanian
Lozi
Luganda
Luo
Luxembourgish
Macedonian
Malagasy
Malay
Malayalam
Maltese
Maori
Marathi
Mauritian Creole
Moldavian
Mongolian
Myanmar (Burmese)
Montenegrin
Nepali
Nigerian Pidgin
Northern Sotho
Norwegian
Norwegian (Nynorsk)
Occitan
Oriya
Oromo
Pashto
Persian
Polish
Portuguese (Brazil)
Portuguese (Portugal)
Punjabi
Quechua
Romanian
Romansh
Runyakitara
Russian
Samoan
Scots Gaelic
Serbian
Serbo-Croatian
Sesotho
Setswana
Seychellois Creole
Shona
Sindhi
Sinhalese
Slovak
Slovenian
Somali
Spanish
Spanish (Latin American)
Sundanese
Swahili
Swedish
Tajik
Tamil
Tatar
Telugu
Thai
Tigrinya
Tonga
Tshiluba
Tumbuka
Turkish
Turkmen
Twi
Uighur
Ukrainian
Urdu
Uzbek
Vietnamese
Welsh
Wolof
Xhosa
Yiddish
Yoruba
Zulu
This is a market simulator that we're going to build in this video.
And we are using it to see and understand trade -based manipulation in
Unlike fake news, this manipulation exploits specific trading patterns,
legal at first glance, as it involves no blatant lies.
And this isn't just a story about smaller, less regulated markets.
The foreign exchange market, the largest financial market in the world, was
traditionally believed to be too big to manipulate, which turned out to be a
costly mistake.
Discovered in 2013, a handful of traders orchestrated what became known as the
Forrest case, siphoning away hundreds of millions for years.
Thankfully, we are not completely helpless.
With some math and financial forensic tools, we can spot the manipulators.
And here's our protagonist who wants to take a chance in the market by trading
shares of a rocket company.
And just like many of us, they all have a hard time making good predictions, so
they buy and sell randomly.
And for now, our friend is lucky, winning most of the time.
Not every trader can be lucky though, but they still believe in the fairness
the market, trusting that everyone has an equal chance.
Then, out of nowhere, some new players show up. And they are not just winning
sometimes, they are consistently beating the odds.
How are they doing it?
At first it seems like these bad actors might just be better at predicting the
future. But here's the twist.
In a market driven by randomness, there shouldn't be a reliable way to predict
the future.
So how are they pulling it off?
And even more interestingly...
the market still looks mostly random.
The bad actors blend in almost perfectly.
So what I want to build with you today is a way to measure and expose this
manipulation.
Let's break this down and see how this fraud works.
Because market manipulation isn't just about numbers moving on a screen.
This video is sponsored by Brilliant.
More at the end of the show.
Quick disclaimer, I am not a financial advisor and this video is for
purposes only. Always do your own research.
The price movement we just saw comes from a real simulation I built and
how it works.
Everyday people come to the market to trade shares.
Not everyone is ready to trade though, some folks are just observing the
The others are placing orders.
Take this buyer for example.
This person wants to buy 70 shares at $53 each, but wouldn't mind a lower
That's the maximum price this person is willing to pay.
And as I mentioned earlier, they trade completely randomly.
So their order prices could be higher or lower yesterday's market price.
Think of these buy orders as coming from a probability distribution.
And this randomness in the simulation is a great proxy to mirror a fair market.
one where everyone has an equal chance.
Here, no one knows what's going to happen, and that's fair.
Now, the shares must come from someone, namely the sellers.
This person might want to sell 50 shares at $45 each, but wouldn't mind a higher
price, that's the minimum price at which this person is willing to sell.
And these sell orders also come from their own probability distribution.
Now let's set a single market price for the day.
Some people are very satisfied with this price, while others may skip trading
altogether.
So how is the price actually set?
One way is to maximize total satisfaction, the extent to which orders
-fulfilled. To calculate it, all the buy and sell orders are lined up, and the
ideal price, the one that brings the most satisfaction, lies somewhere in
overlap. Here, it's not a unique price.
Any price within this range achieves the same maximum satisfaction.
But picking the middle ground is a practical choice.
And this price range also determines the day's trading volume, the number of
shares that changed hands.
So if we set a different single price, one side would be more willing to trade
while the other would be less willing, reducing overall agreement.
As a result, fewer shares are traded since both sides must be satisfied for a
deal to happen.
This method is called auction pricing.
In real world markets, it's often used at the start of the trading day to match
all the overnight orders to a single opening price.
During a continuous trading day, orders are often instantly matched against each
other leading to multiple prices in a short time frame.
But that's a story for another time.
Here, I assume a single trading moment at each day using auction pricing.
And this is what the full market simulation looks like.
We start with setting up the order price distributions.
In reality, buyers and sellers might have different expectations leading to
different distributions, but for today's video, I don't really need this degree
of freedom, so I'll use the same bell curve for both, centered around
yesterday's market price.
This represents the idea that people expect their orders to be filled within
familiar price range.
After all, it worked yesterday, so they hope it will work again today.
From these order curves, the market determines the current day's price and
trading volume, which we track over time in a graph.
And with that, the simulation loop is complete.
Today's market price becomes the starting point for tomorrow's price
distribution and the cycle continues.
New order curves generate new prices and volumes, and the market evolves step by
step. As a result, the market moves randomly, making it impossible to
a useful way.
Since each day's price distribution is centered around the previous day's
price, there's no way to know if prices will rise or fall.
Now that we have the simulation running, let's see what it tells us.
One obvious fact is that markets don't operate in isolation.
External events like breaking news are constantly reshaping expectations.
So these distributions shift as people's expectations evolve.
For example, when good news arrives, a company's true value may be higher than
what's reflected in its current stock price.
And as more and more traders become aware of the news, they anticipate that
competition will eventually drive prices higher.
To simplify our simulation, these random traders skip the waiting game and
instantly adjust their expectations to the new price level.
And just like that, the market price adjusts almost immediately.
And as rational beings we tend to think ahead.
If we believe a company will continue delivering good news, we might
future price jumps.
And to benefit from these future price jumps, buyers must act quickly before
others bid the price up further or they risk missing out.
This again creates competition, driving prices even higher almost instantly.
In other words, it's not just today's news that drives stock prices, but
expectations about all future news also get baked into the price immediately.
But here comes the next twist.
To make this market really hard to manipulate, We feed no additional
to the traders.
They ignore all news and rumors about the future.
So really, no one can manipulate these traders with faulty information.
They are as unpredictable as it gets.
Okay, so far we have created a fair market where randomness rules.
Buyers and sellers act unpredictably and prices reflect their combined random
expectations.
But what if there are invisible forces subtly influencing the direction of
random movements?
And could this cause certain price levels to be avoided, creating soft
in the market?
Well, let's see what the simulation says.
Imagine running simulations for 500 days.
It's surprisingly easy to spot patterns that look like order. But of course, in
this scenario, it's all random.
Yet, not all patterns are meaningless.
And recognizing these patterns helps us understand how markets function and
where limits emerge naturally.
For example, running this simulation a million times shows which price levels
are rare.
This symmetry won't tell you exactly how to trade, but it does offer insights
into the overall shape of the market.
Let's do this for two hypothetical markets.
In the first market, traders place orders based on the price distribution
uniform volume distribution.
So the volumes could range anywhere from 0 to the maximum trade volume, each
with an equal probability.
Most importantly, they have unlimited wealth to back all their trades.
This means they can always afford whatever volume they want to order at
price, buying and selling completely randomly.
As a result, the orders the traders can offer are independent of the absolute
price level.
And this means that the typical daily price changes derived from the order
curves are also essentially independent of the absolute price level. Each day
acts like an independent experiment detached from the past and then stacked
top of previous days.
The prices in this market follow what is known as the Gaussian random walk with
an expected price change of zero.
And even if the real market price suddenly spikes, We have learned that
trading day operates independently from the previous ones, and so the forecast
shape remains unchanged.
There's no external force pulling the price back down.
You're essentially running the same prediction again, just at a new price
In such a random walk, it's likely for prices to eventually reach arbitrarily
high or low values over time, here on a logarithmic price scale.
Now contrast this with the second market, where traders are limited by
wealth. Here, the forecast shape differs significantly.
Why? It comes down to the trading rules.
In this market, traders can borrow money to buy shares, so thereby volumes are
limited by what they can afford.
When prices get too high, their ability to buy decreases sharply.
They simply get fewer shares for the money they are willing to spend.
Selling, however, is less restricted.
They can place sell orders for any portion of their holdings at virtually
price, regardless of whether anyone buys.
These sell orders could be wishful thinking.
This introduces an asymmetry.
As prices rise, the volume of buy orders shrinks due to the lack of money, while
sell orders remain here unaffected. If prices drift too far from the center,
this asymmetry creates a natural pull nudging them back.
We can see this more clearly when we examine the theoretical limit.
Here we assume an infinite number of traders placing buy and sell orders.
This blends individual actions seamlessly into the overall system,
smoother curves and reveals the market dynamics better.
Now comparing this to the Gaussian random walk of the first market, where
shape of the order curves remained independent of the absolute price level,
clearly see the additional price nudge in the second market.
Prices still fluctuate randomly, but now they orbit a sort of a gravitational
center. Over time, these fluctuations settle into a band.
In theory, prices could rise indefinitely, but it becomes
given the order asymmetry.
This is a fascinating observation.
The rules governing how our people can trade effectively create practical soft
limits on price movements.
At least when no one is talking about it.
In reality, any publicly known price limit is quickly exploited and
But assuming for a moment this limit holds, then this is what it means.
When our traders keep adding new money to their trades, they are injecting new
funds into the market and a statistically significant trend channel
And think about this.
At no point does the simulation instruct the market to form channels.
This pattern emerges naturally as a result of the market rules and the
order behavior.
And this trend is different from the trends in the Gaussian Random Walk.
Those trends were just coincidental and lacked real significance.
Even if we add a drift to a Gaussian Random Walk, it won't produce this kind
band channel.
That's worth investigating, but not today, because there are some more
price movement patterns I want to show you.
For example, increasing the number of traded shares at the volume makes prices
less volatile.
Why? Well, few orders make choppy order curves which generate on average bigger
price jumps.
More orders make smoother curves and average out to smaller jumps.
Here I've rescaled the volume in the diagram to better fit the order curves
within the screen.
So with a lot of orders, say a million, the price barely wobbles.
Sure, prices can still shift if expectations surge suddenly, but they
fluctuate wildly.
Here's what this means in real life.
When you see a massive price jump, it doesn't necessarily signify major news.
It could be fewer people trading.
Fewer trades make bigger jumps.
And if you want to put these jumps into context, you can draw a band showing
what's normal at various volume levels.
I share the code in my tutorials so you can see how these factors influence
market movements.
So these patterns highlight how trading behavior shapes randomness.
And in the toughest market imaginable, the Gaussian Random Walk, you cannot
predictions that can be exploited. Which ties back to our initial question.
How can you reliably win in a market where everyone else acts completely at
random? Imagine yourself in that situation.
To win every single time, you need to know something about the future.
But there's our problem.
You can't predict what everyone else will do. It's all random.
So if predicting others isn't an option, what's left?
The only variable that can shape the future to your advantage is you.
Winning isn't about predicting the market anymore. It's about taking
And control means more than just reacting faster.
It's about dictating prices and shaping how others perceive market trends.
And this hints at the level of influence required to make it happen.
It might seem like an obvious realization, but I wanted to point it
it's so important.
In the next section, we will explore the mechanics of this control and see how
deliberate actions can distort a random market.
So what would it take to nudge a market's price in your favor?
For instance, let's say you bought some shares and now you want to artificially
increase the market price.
The first step is simple. I enter the market and say, I am buying 600 shares
$55 each.
Remember, the buyer curve shows how much people are willing to pay at various
prices. So when we slot my order into the buyer curve, the market price takes
step up.
In other words, my order adds more demand at a higher price point,
higher market price.
By adjusting my order, tweaking the volume or the price, I can influence the
market price.
All it takes is placing enough volume at a higher price level.
But there is a catch.
This strategy comes at a cost. I can't just talk about buying these shares. I
actually have to buy them to cause a price shift. And that's incredibly
expensive.
My action moved the price, but at the full cost.
Still, I shouldn't expect anyone's sympathy.
This tactic is usually considered illegal, since my intention was to
other traders.
And if the goal is to exploit other traders anyway, there are ways to
more impact for the cost. And we don't even need to spread faulty news for
So how can we manipulate the market price without footing the bill?
At first glance, if he placed a big buy order, we'd end up paying the seller 600
shares times whatever the market price will be.
To break even, we need to get that money back somehow.
The trick is to sell the same number of shares right back to ourselves.
This practice is called self -trading. But here's the interesting part.
We're not just moving shares from one pocket to another in secret.
Instead, we're doing it publicly.
from the left pocket through the exchange into the right pocket, making
like legitimate market activity.
By itself, self -trading doesn't magically change the market price, it
shifts supply and demand.
The point is perception.
Faking higher volume creates the illusion of a liquid market, which is
because in real markets, traders often see high volume as a signal that
something big is happening, like breaking news.
But remember our catch.
In our simulation, this fake volume doesn't influence anyone.
Our traders act randomly, ignoring these signals entirely.
And that's what makes this problem so challenging.
If perception alone won't work, we need to directly influence the market price.
A strange concept when most traders take prices as given.
These are price takers.
To manipulate the market, we have to think like price setters. And here's how
works.
Imagine a small stock where daily volume is usually low.
Placing a buy order of 600 shares at $55 and a sell order of 600 shares at
$55 creates the illusion of high activity.
As we increase the volume, we pay more but still lack full control.
But when the buy and sell orders overlap, we reach a tipping point.
Every trade within that range is effectively self -ordering at a zero
difference. This enforces the intersection of the curves, which gives
of the market price.
And once we have control, we can set any price and volume we want, pushing it
high enough to overcompensate for any initial costs.
We have successfully hijacked the market's pricing mechanism.
This is called monopoly power in the stock market, where buying the whole
lets you dictate prices.
It's similar to how a company with a product monopoly can manipulate supply
raise costs.
In real markets, this tactic doesn't just distort the price, it can also
traders into believing its genuine activity.
It's particularly easy in smaller, less regulated markets, where the initial
cost is lower.
So, as you can see, With trade -based manipulation, one can distort signals
price and volume and trick traders into making poor decisions.
So our friend should watch for one unusually large buy and sell order at
the same price.
That could be an attempt at manipulation.
Alright, so our friend here is running low on funds just like the rest of the
good traders.
It's time to step in and help them out by cracking their opponent's moves.
We are going to walk through one complete manipulation cycle to really
understand it, and then we'll figure out how to blend these moves seamlessly
into the noise of the crowd.
Let's take a closer look at how the whole scheme works, here in a market
follows a Gaussian Random Walk.
And to better see what's happening, we track the manipulator's money, shares,
and the relative wealth compared to the rest of the market.
That's the total money you hold plus the market value of your shares compared to
what the other traders have.
So first this theme starts with buying as many shares as possible without
drawing too much attention.
The goal is to stay under the radar while gradually building up your
So in the graphs we can see money slowly being converted into shares.
Then comes the price manipulation.
This involves using self -trading, where you partly buy and sell shares to
yourself to gain control and nudge the price upward.
Here, I took a rather obvious approach to demonstrate the mechanics.
But you can make it less noticeable, nudging the price by a small percentage.
It won't work every day. Some days you might not have full control or the
could move unpredictably.
Well, that's part of the gamble.
As a manipulator, I wouldn't say you're in a position to complain.
During this phase, you're also buying more shares to maintain control.
Finally, once the price has been inflated enough, it's time to sell.
The goal here is to offload your shares quietly, cashing in on the inflated
price without causing too much disruption.
By the end of this cycle, you have gone from having no shares and a million
dollars to holding no shares again, but now with a larger amount of 1 .7 million
dollars.
You can see in the relative wealth graph that we have managed to take a
significant slice from the other random traders.
This is a form of the classical pump and dump scheme.
What makes the method here stand out is that it's entirely trade -based.
We don't issue fake news.
We just control the price with self -trading.
To show it works on average, let's imagine the same situation without
manipulation.
You buy shares for the same amount of money over the same period, but don't
artificially inflate the price.
Many simulations show that the non -manipulated version consistently
underperforms compared to the manipulated one proving the scheme's
effectiveness.
What's particularly troubling is that even when people aren't trading
like in the final phase when they start selling alongside you, it's still
possible to predict their behavior and factor it into your plan.
In fact, if the scheme works in a completely random market, it works even
when traders follow predictable patterns.
Now, where does the manipulator's profit actually come from?
There's one driving factor that makes this whole scheme possible.
The assumption that tomorrow's price is likely to be close to today's price.
If traders didn't rely so much on recent price trends, meaning they wouldn't
simply accept the inflated price level, This kind of manipulation wouldn't be
possible. You might think that basing trades more on fundamental factors like
company's performance sounds like the rational approach, and you'd be right,
it only works if everyone does it.
Markets are inherently driven by participants outbidding one another,
aware that they are trading at irrational prices.
This in itself is also a fundamental factor, the human factor.
That said, our self -trades here are still easy to spot, and exchanges could
simply ignore these orders or regulators might investigate them.
So let's figure out how manipulators manage to blend into the crowd, because
can't investigate what you don't know about.
By now you've probably spotted the trick.
It's not a crowd of people moving the market, it's one person pulling the
strings behind the scenes.
The idea is to scatter coordinated self -trading orders across the market,
making them look like harmless activity.
Except they are not.
These trades still carry enough weight to nudge the price where the manipulator
wants it.
If we spread these orders out more smoothly, the manipulation becomes much
harder to detect.
There are still some unusual dents in the order curves, but now they are more
subtle and could go undetected.
Now, how could manipulation be concealed even better?
First, we need to learn how to quantify it. There are several ways to go about
it. The idea is to identify irregularities in the order curve shape.
To achieve this, we can exemplarily standardize the curves to fit a 0 to 100
volume range and the expected unmanipulated price range.
Then we run multiple simulations without manipulation to establish a reference
for normal market behavior.
This creates a band of order curves helping quantify what counts as unusual
behavior. And as we have seen for price setting, manipulation has a tell.
You'd expect unusual behavior in both order curves.
There are several ways to assign numbers to this unusual behavior to estimate
how much manipulation is happening.
If you're interested, my coding tutorials dive into building the
running the tests.
Also, on a related note, We are looking into an intriguing connection between
wealth distribution in markets and the statistical mechanics of an ideal gas.
Both systems have conserved quantities like total money, shares, or energy, and
as traders or particles continuously interact, they naturally settle into
equilibrium distributions.
In that sense, you can loosely think of a market as having a money temperature,
which offers an interesting perspective on markets.
But for now, let's go back and see how the amount of manipulation varies across
different scenarios.
Here are three distinct price jumps, but not all of them are caused by
manipulation. For example, this jump right here, that's a genuine market
reaction to positive news about the company.
We can simulate this with our traders reacting to what is called a sentiment
curve.
Think of the sentiment curve as a signal reflecting the market's collective
belief about a company's future.
Positive news can shift the curve upward, representing increased
investors. With fresh money injected into the market, both the trading volume
and the price drive upward.
Compare that to a random price jump caused by low trading volume.
Here, the sentiment curve stays flat. Nothing external has changed.
However, if he had inflated the volume with self -trading without actually
setting, it would have looked more like news than noise.
At least on the surface.
A price jump accompanied by increased volume seems natural for good news.
But self -trading leaves a trace, making it detectable in the manipulation
graph.
One important note, this graph isn't proof of manipulation.
Patterns like these occur naturally.
Eventually, it's about identifying traders with repeated suspicious
And only when more instances stack up does it trigger further investigation.
Now, what happens when we go for price setting?
That's the pump and dump method.
The sentiment stays flat, there's no real news driving the price, so all the
activity is fake.
And here's the thing about fraud detection.
It's a constant cat and mouse game. Let me show you an example.
Instead of pushing the price with a simple obvious distribution that leaves
stents on the graph, we can disguise the manipulation further.
By crafting a carefully shaped manipulator price distribution, we can
final order curve look completely normal. It's just shifted.
What does it mean?
It means we've essentially faked an entire market at a different price and
volume level.
That's about as deceptive as it gets.
The complicated part...
It comes with the huge initial cost, and you have to guess what the original
price distribution will look like.
If you guess right, this kind of manipulation can be undetectable, at
the order curve shapes alone.
Things get even trickier when manipulation pairs up with real
fake news, but reliable information.
Take positive sentiment, for instance.
It's natural to expect the market to go up when good news breaks.
But how much of an increase is reasonable?
Only one of these markets here is free of manipulation.
The others amplify or downplay the news.
So how can you tell right off the bat which one is genuine? Each one aligns
the truth to some degree.
The main takeaway is this.
When someone gains monopoly power over the market, the market can't function as
it's supposed to. It becomes a losing game for everyone else.
And if that someone isn't you, then no matter how sharp your predictions are,
you're likely to fall prey to the manipulator.
You might be thinking, well, these frauds don't really happen no longer in
big regulated markets where my retirement funds are parked.
And you'd be mostly right.
Nowadays, these markets are monitored by oversight teams equipped with far more
advanced financial forensic tools to keep the game fair for the rest of us.
In a way, this video is a nod to their work.
But as more people dive into less regulated markets, maybe there is wisdom
not taking every price.
When a deal looks too good to be true, well, you know how that usually goes.
But every once in a while, you do get lucky and find a deal that works in your
favor. Take this one.
If someone offered to teach you math, data analysis, programming, and AI,
the volume, In just a few minutes of hands -on learning a day, that's the
that would be a solid trade.
Well, that's Brilliant.
And what I like about Brilliant is that they don't just throw information at
you, they help you figure things out for yourself.
Every one of these thousands of lessons is interactive, letting you solve
problems while playing with concepts.
It's an intuitive approach, and for me, that's what makes learning stick.
If today's video got you curious about market trends and data patterns, have a
look at the new data science courses.
With real -world datasets from Airbnb, Spotify and more, you'll learn how to
spot trends and make smarter decisions.
To try everything Brilliant has to offer for free for a full 30 days, visit
brilliant .org slash braintruffle or scan the QR code on screen.
Or you can click the link in the description.
You will also get 20 % off an annual premium subscription.
Thanks for watching and thank you for your support.
Can't find what you're looking for?
Get subtitles in any language from opensubtitles.com, and translate them here.