# Penetrating a granular medium by successive impacts

Antoine Seguin  Université Paris-Saclay, CNRS, Laboratoire FAST, 91405 Orsay,
France  Yann Bertho  Université Paris-Saclay, CNRS, Laboratoire FAST, 91405
Orsay, France  Baptiste Darbois Texier  Université Paris-Saclay, CNRS,
Laboratoire FAST, 91405 Orsay, France

###### Abstract

We consider the penetration dynamics of a vertical cylinder into a dry
granular medium subjected to successive impacts. The depth of the impactor
below the free surface $z_{N}$ first evolves linearly with the impact number
$N$ and then follows a power-law evolution $z_{N}\propto N^{1/3}$. The depth
reached by the cylinder after a given number of impacts is observed to
increase with the impact energy but to decrease with its diameter and the
density of the granular medium. We develop a model that accounts for the
quasi-static and inertial granular forces applying on the cylinder to
rationalize our observations. This approach reveals the existence of two
intrusion regimes for large and small impact numbers, allowing all data to be
rescaled on a master curve. Then, we extend the study to the effect of
sidewalls on the dynamics of the impactor. We show that lateral confinement
changes the dependence of the impactor depth on the impact number $z_{N}(N)$.
This effect is accounted for by considering the increase of the granular drag
with the lateral confinement.

##  I Introduction

Probing the ground to extract samples or to dig up buried objects is at the
heart of many civil engineering activities and exploration missions. Several
applications, such as tunneling or underground scanning, would benefit from
the development of subterranean robots capable of penetrating and moving below
the surface Aguilar  _et al._ (2016); Naclerio  _et al._ (2021). Among the
techniques used to penetrate a probe into the ground, several rely on the
transfer of kinetic energy to the digging impactor as in drilling Shi  _et
al._ (2019). This transfer can also be done using a succession of steps like
when someone drives a nail, i.e., hammering. In particular, the hammering
mechanism underpins the operation of space probes that are designed to dive
below the sandy surface of other planets and inspect their physical properties
Spohn  _et al._ (2018); Olaf  _et al._ (2019). Despite its common use, the
hammering technique as a means of penetrating a granular soil is little
explored from a physical point of view.

The study of granular media has followed an intensive effort these last
decades, with a particular focus on the stress state within these materials.
The pioneering work in this field is by Janssen who considered the stress
distribution in a confined granular medium Janssen (1895). He observed that
the pressure exerted on the base of the container saturates at a value much
smaller than the hydrostatic pressure that would be measured for a liquid
column. Instead, the pressure saturates at a constant value that scales as the
weight of grains over a vertical distance comparable to the width of the
container. His continuum phenomenological model relies on the hypothesis that
the frictional contact forces between the grains and the walls are at their
Coulomb threshold and that the vertical stresses are redistributed
proportionally to the horizontal ones. This effect, characteristic of granular
media, has led to numerous works in static Ovarlez  _et al._ (2003); Cambau
_et al._ (2013); Mahajan  _et al._ (2020) or dynamical configurations Bertho
_et al._ (2003, 2004).

Over the last few decades, many works were devoted to the dynamics of an
object impacting a granular medium. A large part of this effort concerns
spherical projectiles, well suited to the study of impact crater morphology de
Bruyn and Walsh (2004); Deboeuf  _et al._ (2009); Van Der Meer (2017); Huang
_et al._ (2020). This configuration has implications in geophysics for
meteorite impacts Melosh (1989); Katsuragi (2016), a problem in which the
effective gravity must be taken into account Altshuler  _et al._ (2014).
Different experiments and numerical simulations permitted to estimate the drag
force applying on the sphere during its intrusion Uehara  _et al._ (2003);
Ambroso  _et al._ (2005); Katsuragi and Durian (2007); Goldman and Umbanhowar
(2008); Seguin  _et al._ (2008, 2009); Umbanhowar and Goldman (2010); Pacheco-
Vázquez  _et al._ (2011); Nordstrom  _et al._ (2014); Joubaud  _et al._
(2014). In parallel, theoretical models were proposed to rationalize these
observations Tsimring and Volfson (2005); Hinch (2014); Guo (2018). A widely
used model to describe the drag force during the impact of a sphere is that
which considers the sum of two contributions: a collisional term and a Coulomb
friction term Katsuragi and Durian (2007). The collisional term evolves as
$\leavevmode\nobreak\ v^{2}$, where $v$ is the penetration velocity of the
sphere, and is associated to the energy dissipation by collisions with the
grains constituting the granular medium Takehara  _et al._ (2010); Takehara
and Okumura (2014). This expression for the inertial drag was shown to hold
for objects of different shapes with a prefactor that accounts for their
geometry Cheng  _et al._ (2018). The frictional term, by analogy with the
hydrostatic pressure in a classical fluid, is described with an evolution as
$\rho gz$, where $z$ is the penetration depth of the object Kang  _et al._
(2018). This prediction holds for small depths and different models were
proposed for the drag force at larger depths. In this limit, the quasi-static
drag force on a penetrating object was described by a generic term in
$z^{\alpha}$, with $\alpha>1$ and that depends on the object geometry Hill
_et al._ (2005); Peng  _et al._ (2009); Brzinski III  _et al._ (2013). More
recently, the quasi-static granular drag experienced by a slender object was
rationalized as the sum of a $z$ term and a $z^{2}$ term Seguin and Gondret
(2018). This model is the result of two contributions: the pressure of the
granular force at the tip of the slender object ($\propto z$) and the granular
frictional force on the lateral side of the submerged part, integrated over
the entire depth ($\propto z^{2}$). The previous expressions for the drag
force permitted to capture finely the dynamics of an object that realizes a
single impact in a granular medium. However, the predictions of these models
regarding a succession of impacts remain to be explored.

In this paper, we study experimentally the penetration of a slender object
(called impactor hereafter) into a dry granular material by successive
impacts. First, we measure the evolution of the penetration depth of the
impactor as a function of the number of impacts it receives, in a granular
medium that can be considered as infinite. We highlight the existence of two
regimes and we develop a continuous modeling of the penetration depth. Second,
we explore the influence of a lateral confinement during the penetration and
we show that friction to the walls introduces a modification of the scaling
law of the penetration depth.

##  II Experimental setup

The experimental setup consists of a cylindrical container of diameter $D$,
height 300 mm, containing rigid beads of diameter $d_{g}$ and density
$\rho_{g}$ [Fig. 1(a)]. The beads used are made of different materials,
plastic, glass, and metal of density $\rho_{g}=920$, 2500, and 7740 kg m-3,
and diameters $d_{g}=1$, 0.45 and 2 mm, respectively. A controlled preparation
of the granular medium is obtained by pouring the grains into the container
and then tapping it at least ten times on the floor, ensuring an initial
volume fraction $\phi=0.62\pm 0.01$. We define the bulk density of the
granular medium as $\rho=\phi\,\rho_{g}$. The impactor is a hollow cylinder of
external diameter $d$ (ranging from 16 to 50 mm) and mass $m_{0}$ (ranging
from 60 to 460 g) ending with a $60^{\circ}$ angle conical head, as sketched
in Fig. 1(a). Initially, the tip of the impactor is placed at a depth
$z_{0}=50$ mm below the surface of the granular medium to ensure its
stability. The impacts are generated by a cylindrical mass $m_{i}=209$ g
dropped inside the hollow cylinder from a height $h$, without any initial
velocity. When the mass reaches the bottom of the impactor, it transfers its
momentum and the impactor moves deeper in the granular medium. The impacts are
reproduced several times in a row, keeping constant the dropping height $h$
and thus the impact energy $\mathcal{E}=m_{i}gh$. A picture of the impactor is
taken after each impact and allows one to measure its final depth $z_{N}$
below the granular surface as a function of the impact number $N$. Particular
care has been taken to systematically center the impacting mass with the axis
of the impactor to ensure that the system remains vertical during successive
impacts (deviation less than $2^{\circ}$). In addition, we checked that the
time interval between impacts has no influence on the intrusion dynamics in a
range between 10 s and 100 s. This interval time is much larger than the
characteristic time required for a grain to fall from its own diameter
$\sqrt{d_{g}/g}\simeq 10$ ms. In all the experiments, the ratio of the
impactor diameter over the bead diameter $d/d_{g}$ is always larger than 10,
allowing to describe the medium in the limit of continuum mechanics Seguin and
Gondret (2018). Note that we do not measure significant variations of the mean
packing fraction during the successive impacts, as each impact reinforces the
initial tapping protocol. Also, to avoid any interaction with the bottom of
the container, the distance between the tip of the impactor and the bottom is
at least ten times larger than the diameter of the grains Stone  _et al._
(2004).

Figure 1: (a) Sketch of the experimental setup and notations used. (b) Depth
of the impactor $z_{N}$ as a function of the impact number $N$, for an
intrusion in glass beads ($d_{g}=0.45$ mm and $\rho=1550$ kg m-3). The
impactor has a diameter $d=50$ mm and a mass $m_{0}=460$ g. The impacting mass
is $m_{i}=209$ g and is released from $h=25.5$ cm corresponding to an energy
$\mathcal{E}=0.52$ J. Inset: Same data in a logarithmic plot. The black line
represents $z_{N}\propto N^{1/3}$. Figure 2: (a) Depth of the impactor $z_{N}$
as a function of the accumulated impacting energy $N\mathcal{E}\,m_{i}/m$ for
different impact energies $\mathcal{E}$. Inset: $z_{N}$ as a function of the
impact number $N$. For intrusions in glass beads ($d_{g}=0.45$ mm and
$\rho=1550$ kg m-3), the impactor has a diameter $d=33$ mm, a mass $m_{0}=210$
g and the impacting mass is $m_{i}=209$ g. (b) Depth $z_{N}$ as a function of
the impact number $N$ for different diameters $d$, with $d_{g}=0.45$ mm and
$\rho=1550$ kg m-3, by keeping constant the impact energy $\mathcal{E}$ and
the mass ratio $m_{i}/m$. (c) Depth $z_{N}$ as a function of the impact number
$N$ for different densities of the granular medium $\rho$, with $d=33$ mm and
a mass $m_{0}=210$ g, the impacting mass $m_{i}=209$ g is released from
$h=255$ mm.

##  III Penetration in unbounded granular medium

###  III.1 Experimental results

We first consider the case where the diameter of the container is large
compared to the impactor diameter ($D>8\,d$) and side walls have a negligible
effect on the impactor penetration Seguin  _et al._ (2008). A typical
penetration dynamics obtained under these conditions is shown in Fig. 1(b) for
an impactor entering into glass beads and experiencing $N=125$ successive
impacts. We observe that the dynamics is fast for the first impacts then slows
down with the number of impacts, but continues to progress without saturating
with depth. The inset in Fig. 1(b) displays the logarithmic plot of the data
and shows that the penetration dynamics is well approximated by the scaling
law $z_{N}\propto N^{1/3}$ when $N\gtrsim 10$.

The inset in Fig. 2(a) presents the penetration dynamics $z_{N}$ for an
impactor entering glass beads and submitted to different impact energies
$\mathcal{E}$. We observe that the intrusion dynamics keeps the same
increasing shape whatever the impact energy, but that the depth after a given
number of impacts increases with $\mathcal{E}$. The same data are presented in
Fig. 2(a) as a function of the total impact energy delivered to the impactor
$N\mathcal{E}\,m_{i}/m$, where $m=m_{0}+m_{i}$. It turns out that experiments
performed with different pairs of $h$ and $m_{i}$ but the same impact energy
$\mathcal{E}=m_{i}gh$ leads to the same results, highlighting that the impact
energy is the relevant parameter in this problem.

The effect of the impactor diameter $d$ on the penetration depth is displayed
in Fig. 2(b) as a function of the impact number $N$, by keeping constant the
impact energy $\mathcal{E}$. The intrusion dynamics is then observed to be
slower for larger impactor diameters.

Finally, we explore the influence of the density of the granular medium on the
penetration by successive impacts [Fig. 2(c)]. We realize experiments with
grains of different materials by keeping unchanged the impactor
characteristics ($m_{0}=210$ g, $m_{i}=209$ g, and $d=33$ mm) as well as the
impact energy ($\mathcal{E}=0.52$ J). We observe that increasing the bulk
density $\rho$ of the granular medium significantly slows down the intrusion
dynamics.

###  III.2 Model

To model the evolution of the penetration depth $z_{N}$ with the number $N$ of
successive impacts, we consider the forces that apply on the impactor during
the advancing phases. The impactor experiences its own weight, the force
resulting from the impact of the internal mass, and the resistance of the
granular medium. Here, the weight of the impactor $mg$ is small compared to
the granular drag and can be neglected in the force balance. The mechanical
action exerted by the impacting mass is accounted through momentum
conservation during the collision of the internal mass with the bottom of the
cylinder. The impacting mass $m_{i}$ dropped from a height $h$ without initial
velocity has a mechanical energy $m_{i}gh$ and a velocity before impact
$\sqrt{2gh}$. The collision of the internal mass $m_{i}$ with the penetrating
object of mass $m_{0}$ is assumed to be perfectly inelastic. In these
conditions, the conservation of the momentum of the system provides that the
initial velocity of the impactor just after the impact is
$v_{i}=\sqrt{2gh}\,m_{i}/m$. The resistive forces resulting from the
interaction of the impactor with the granular material have both a collisional
and a frictional origin. At each new impact, two temporal regimes can be
distinguished Seguin  _et al._ (2009): a first phase corresponding to the
earliest instants where the inertial resistance dominates and where the drag
force strongly depends on the velocity of the impactor; a second phase where
the quasi-static resistance dominates, independent of the impactor velocity.
In the following, we will focus on the terms corresponding to these two
regimes, one after the other.

By considering first the case where the velocity of the impactor is high and
the inertial contribution of granular drag, proportional to the cross
sectional area ($\sim d^{2}$) and to the density of the granular medium
$\rho$, overcomes the quasi-static contribution, the equation of motion for
the impactor of mass $m$ is written as

$m\frac{dv}{dt}=-K_{v}\,\rho d^{2}\,v^{2},$ (1)

where $v=dz/dt$ and $K_{v}$ is a characteristic prefactor of the collision
dissipation. As in the case of a sphere impact in a granular medium, $K_{v}$
is expected to depend on the packing fraction $\phi$ de Bruyn and Walsh
(2004); Seguin  _et al._ (2009); Guo (2018). The model is developed in the
limit of continuous depths $z$ and then discretized to $z_{N}$ to be compared
with experiments. At the beginning of impact number $N$, the impactor is
located at the depth $z=z_{N-1}$ of the previous impact and its velocity is
$v=v_{i}$. By using the relation
$dv/dt=(dv/dz)(dz/dt)=v\,dv/dz=(1/2)\,d(v^{2})/dz$, Eq. (1) leads to

$\frac{v^{2}(z)}{v_{i}^{2}}=\exp\left(-\frac{z-z_{N-1}}{L_{0}}\right),$ (2)

where $L_{0}=m/2K_{v}\,\rho d^{2}$ is a characteristic length, which scales as
$m/\rho\,d^{2}$. This expression is valid at the first instants of the
penetration dynamics. The final depth $z_{N}$ is reached when the impactor
velocity vanishes, i.e., $v(z_{N})=0$. We obtain a relation between two
successive rest positions $z_{N}-z_{N-1}=L_{0}$, which, by iteration from the
initial depth $z_{0}$, leads to the following prediction:

$\frac{z_{N}-z_{0}}{L_{0}}=N.$ (3)

This relationship describes the first asymptotic regime that is expected to
occur during the first set of impacts at shallow depths.

We now consider the opposite situation where the quasi-static contribution of
the drag force overcomes the inertial term and which occurs in the limit of
low velocities or high depths. In this limit, the resistance experienced by
the impactor from the granular medium is proportional to $z^{2}$ Albert  _et
al._ (1999); Seguin and Gondret (2018). We neglect here the resistive force
term of the pressure at the tip of the impactor, which should evolve as $z$,
assuming it is approximately cylindrical. Under these conditions, the equation
of motion for the penetration dynamics of the impactor is written as

$m\frac{dv}{dt}=-K_{z}\,\rho gd\,z^{2},$ (4)

where $K_{z}$ is a characteristic prefactor of the friction force. This
equation can be made non-dimensional by using $L_{0}$ and by introducing a
characteristic time $T_{0}=(K_{v}\,d/K_{z}\,g)^{1/2}$, which scales as
$(d/g)^{1/2}$. For the impact number $N$, the initial conditions are
$z=z_{N-1}$ and $v=v_{i}$. Using the same relation as before for $dv/dt$, we
obtain the following solution:

$\frac{v^{2}(z)}{v_{i}^{2}}=1-\frac{1}{3}\left(\frac{L_{0}}{v_{i}T_{0}}\right)^{2}\left(\frac{z^{3}-z_{N-1}^{3}}{L_{0}^{3}}\right).$
(5)

The final depth $z_{N}$ is reached when $v(z_{N})=0$. We obtain a relation
between two successive impacts, which, by iteration with respect to the
initial depth, leads to the following prediction:

$\frac{z_{N}^{3}-z_{0}^{3}}{L_{0}^{3}}=3N\left(\frac{T_{0}\,v_{i}}{L_{0}}\right)^{2}.$
(6)

In the limit of large depths ($z_{N}\gg z_{0}$), we can approximate that
$z_{N}^{3}-z_{0}^{3}\simeq(z_{N}-z_{0})^{3}$ and the previous equation leads
to:

$\frac{z_{N}-z_{0}}{L_{0}}=\left[3N\left(\frac{T_{0}\,v_{i}}{L_{0}}\right)^{2}\right]^{1/3}.$
(7)

Figure 3: (a) Normalized impactor depth $(z_{N}-z_{0})/z_{c}$ as a function of
the normalized impact number $N/N_{c}$. The solid line represents the
prediction of Eq. (8). (b) Crossover distance $z_{c}$ deduced from the fit and
normalized by the impactor diameter $d$ as function of the experimental
parameter $v_{i}/(d\,g)^{1/2}$. The solid line corresponds to
$z_{c}/d=A\,v_{i}/(d\,g)^{1/2}$, with $A=1.1$. (c) Crossover impact number
$N_{c}$ as a function of the experimental parameter $\rho
v_{i}\,d^{5/2}/(m\,g^{1/2})$. The solid line corresponds to $N_{c}=B\rho
v_{i}\,d^{5/2}/(m\,g^{1/2})$, with $B=15$. Symbols have the same meaning as in
Fig. 2.

To summarize, two intrusion regimes should be considered, where $z_{N}\sim
mN/\rho d^{2}\propto N$ in the limit of small depths, and
$z_{N}\sim(mv_{i}^{2}N/\rho gd)^{1/3}\propto N^{1/3}$ in the limit of large
depths. Note that both predictions provide that the depth of the impactor
after a given number of impacts decreases with the impactor diameter $d$ and
the density of the granular medium $\rho$, in qualitative agreement with
experiments displayed in Figs. 2(b) and 2(c). At intermediate depths, we
expect a crossover between these two regimes and we suggest to connect these
two predictions by the arbitrary expression

$\displaystyle\frac{z_{N}-z_{0}}{z_{c}}=\frac{\displaystyle\frac{N}{N_{c}}}{\displaystyle\left(1+\frac{N}{N_{c}}\right)^{2/3}},$
(8)

where $z_{c}$ is the crossover depth and $N_{c}$ the number of impacts
associated to this crossover. Note that shallow penetration depths
corresponding to $N/N_{c}\ll 1$ and large penetration depths corresponding to
$N/N_{c}\gg 1$, lead, respectively, to the limiting cases $z_{N}\propto N$ and
$z_{N}\propto N^{1/3}$ discussed before. We consider $z_{c}$ and $N_{c}$ as
free parameters and we seek the best fit of the measured intrusion dynamics
with Eq. (8). Figure 3(a) presents all the intrusion dynamics normalized by
$N_{c}$ and $z_{c}$ estimated through this procedure. We conclude that the
proposed modeling is compatible with the experimental data since all our
measurements collapse on a master curve which corresponds to Eq. (8). The
identification of Eqs. (3), (6), and (8) leads to the following expressions
for the crossover parameters: $z_{c}=\sqrt{3}\,v_{i}\,T_{0}\sim
v_{i}(d/g)^{1/2}$ and $N_{c}=\sqrt{3}\,T_{0}\,v_{i}/L_{0}\sim\rho
v_{i}\,d^{5/2}/(m\,g^{1/2})$. In the following, we compare the estimations
provided by our fitting procedure to these predictions. Figure 3(b) shows the
evolution of $z_{c}/d$ as a function of $v_{i}/(d\,g)^{1/2}$. We observe a
good agreement between the experimental data and the scaling of $z_{c}$
predicted by this modeling. The fit of the data highlighted by the solid line
in Fig. 3(b) provides an estimate of the ratio $K_{v}/K_{z}=0.4\pm 0.2$.
Figure 3(c) presents the evolution of $N_{c}$ as a function of $\rho
v_{i}\,d^{5/2}/(m\,g^{1/2})$. The fit of the data [solid line in Fig. 3(c)]
provides an estimate of the ratio $({K_{v}}^{3}/K_{z})^{1/2}=4\pm 3$. The
agreement between the measurements and predictions is still reasonable even
though there is more dispersion on the data. This dispersion arises from the
fact that $N_{c}$ is limited to a narrow range of values (between 1 and 10)
while the uncertainty on this parameter can hardly be less than 1. Moreover
the variations of prefactors in granular media are known to be highly
fluctuating Kang  _et al._ (2018); Seguin and Gondret (2018). These two
scaling laws allow to give an estimate of $K_{v}\simeq 6$ and $K_{z}\simeq
15$. Note that the values of $K_{v}$ and $K_{z}$ are known to depend on the
shape of the impactor. Indeed, a collisional model permitted to propose a
dependency for $K_{v}$ with the geometry of the object Cheng  _et al._ (2018).
In the quasi-static limit, an Archimedean law was proposed for the granular
drag at low depths, which permits to express the influence of the head
geometry on the resistive force Kang  _et al._ (2018).

The crossover between the two intrusion regimes is described by the ratio
between the collisional and the frictional forces. The transition between
these two regimes can be rationalized with a non-dimensional number which
corresponds in this case to the Bagnold number $\mathrm{Ba}$ defined as:

$\mathrm{Ba}=\frac{\rho d^{2}v^{2}}{\rho
gdz^{2}}=\left(\frac{d}{z}\right)\left(\frac{v^{2}}{gz}\right)=\left(\frac{d}{z}\right)\mathrm{Fr}^{2},$
(9)

where $\mathrm{Fr}=v/\sqrt{gz}$ is a dynamic Froude number. This definition
drops the constant relative to the ratio $K_{v}/K_{z}$ which is of the order
of unity. When $\mathrm{Ba}\ll 1$, the quasi-static contribution of the
granular resistance predominates, whereas when $\mathrm{Ba}\gg 1$, the
inertial term overcomes. In these experiments, this number is related to the
Froude number which compares two characteristic velocities: the initial
velocity due to the impact of the mass and the velocity linked to the
hydrostatic pressure. The dynamic side comes from the fact that the more the
object sinks, the smaller this number naturally becomes.

##  IV Penetration in a confined granular medium

In this section, we consider the effect of a lateral confinement on the
intrusion dynamics of the impactor over successive impacts. We follow the same
experimental procedure as previously, but we now investigate larger ratio of
the impactor diameter over reservoir diameter $d/D$ where the influence of the
lateral walls is not negligible anymore. Whereas previous experiments were
conducted for $d/D<0.125$, we now increase this ratio up to $0.4$. Figure 4
shows the intrusion dynamics of an impactor penetrating into glass beads with
different values of the ratio $d/D$. When $d/D$ is smaller than 0.3, all the
intrusion dynamics collapse on the prediction of Eq. (8) when rescaled by the
crossover depth $z_{c}$ and the impact number $N_{c}$. However, when $d/D$
becomes larger than 0.3, the intrusion dynamics starts to deviate from the
unbounded case. The lateral confinement not only reduces the depth of the
impactor after a given number of impacts, but also changes the penetration law
as highlighted by the semi-logarithmic scales of Fig. 4 that reveal a
transition towards a logarithmic trend, $z_{N}\propto\ln\leavevmode\nobreak\
N$, when $d/D\gtrsim 0.3$. To characterize this change in behavior, we fit the
intrusion dynamics by the following law:

$\displaystyle\frac{z_{N}-z_{0}}{z_{c}}=\frac{\displaystyle\left(\frac{N}{N_{c}}\right)^{\alpha+2/3}}{\displaystyle\left(1+\frac{N}{N_{c}}\right)^{2/3}},$
(10)

where $\alpha$ is a free parameter equals to $\alpha=1/3$ when the effect of
the lateral confinement is negligible, recovering Eq. (8), while in the limit
of large $N$, this relation scales as $z_{N}\propto N^{\alpha}$. Therefore, we
look for the exponents $\alpha$ that provide the best fits of the intrusion
dynamics and we plot them in the inset of Fig. 4 as a function of the ratio
$d/D$. We observe that $\alpha\simeq 0.33$ when $d/D\lesssim 0.3$ and
decreases towards zero for larger values of the ratio $d/D$.

Figure 4: Normalized depth $z_{N}/z_{c}$ as a function of the normalized
impact number $N/N_{c}$ for increasing ratio of impactor diameter over the
reservoir diameter $d/D$. The upper solid line indicates the prediction for
unbounded intrusion from Eq. (8) and the lower solid line represents the
extreme case $z_{N}\propto\ln\,N$ when the lateral confinement matters. Inset:
Estimated exponent $\alpha$ from the fit of the intrusion dynamics with Eq.
(10) as a function of $d/D$. The gray region distinguishes confined cases from
the unbounded case.

When the friction on the lateral walls is mobilized, the pressure in the
material does not increase linearly with depth, but rather saturates
exponentially towards a constant value Janssen (1895). This corresponds to a
dynamical Janssen effect resulting from the mobilization of the friction and
is already observed when moving a vertical wall upwards Bertho  _et al._
(2003). However, in practice, we do not observe any saturation of the force
experienced by a rod plunging into a granular medium Peng  _et al._ (2009);
Seguin and Gondret (2018); Darbois Texier and Seguin (2022). The moving wall
is the side of the impactor that goes downwards and thus mobilizes friction in
the opposite direction. In this case, the usual expression of the Janssen
force adopts a different form since there is no saturation: we therefore
consider that the pressure in the material increases exponentially with depth.
This exponential dependence was already proposed to rationalize the force
experienced by the bottom wall of a narrow granular column as it pushes up the
grains Ovarlez  _et al._ (2001). This dependency of the pressure with depth is
reflected in the drag force that applies on the impactor. Indeed, a previous
study revealed that the presence of lateral walls increases the drag
experienced by a sphere intruding at low speeds into a granular tank Katsuragi
(2012). To account for this effect up to the limit of extreme confinements, we
suggest an exponential variation of the force with depth

$m\frac{dv}{dt}=-K_{z}\,\rho gd\lambda^{2}\exp\left(\frac{z}{\lambda}\right),$
(11)

where $\lambda$ is the characteristic depth of the evolution of the pressure
profile. Following the same method as previously, the solution of this
equation is:

$v^{2}(z)-v_{i}^{2}=-\frac{2\,K_{z}\,\rho
gd\lambda^{3}}{m}\left[\exp\left(\frac{z}{\lambda}\right)-\exp\left(\frac{z_{N-1}}{\lambda}\right)\right].$
(12)

Looking for $z_{N}$ where $v(z_{N})=0$, and using the characteristic length
$L_{0}$ and the characteristic time $T_{0}$ introduced in the unbounded case,
we obtain:

$\exp\left(\frac{z_{N}}{\lambda}\right)-\exp\left(\frac{z_{N-1}}{\lambda}\right)=\frac{v_{i}^{2}L_{0}T_{0}^{2}}{\lambda^{3}}.$
(13)

By iteration, we obtain a prediction for the intrusion dynamics in the
presence of lateral confinement:

$\frac{z_{N}}{\lambda}=\ln\left[\exp\left(\frac{z_{0}}{\lambda}\right)+\frac{v_{i}^{2}L_{0}T_{0}^{2}}{\lambda^{3}}N\right].$
(14)

In the limit of large depths ($z_{N}\gg z_{0}$), this prediction scales as
$z_{N}\propto\ln N$ and thus has the same scaling as the observations made for
$d/D\gtrsim 0.3$ (Fig. 4). Since a power law of the form $z_{N}\propto
N^{\alpha}$ is always larger than $\ln N$ at large $N$, this explains why the
fits of the intrusion dynamics with Eq. (10) have an exponent $\alpha$ that
decreases towards zero when the effect of the confinement dominates.

##  V Conclusion

In this study, we analyze the different intrusion regimes of a cylindrical
impactor that penetrates a granular medium through $N$ successive impacts. In
an unbounded medium, the dynamics of the impactor during the first impacts is
ruled by a balance between the force resulting from the impact of the internal
mass and the inertial resistance of the granular medium due to collision
dissipation ($\propto v^{2}$), and leads to an intrusion law of the form
$z_{N}\propto N$. For larger impact numbers, as the impactor moves deeper in
the grains, the input energy is balanced by the quasi-static force applied by
the granular medium on its lateral surface ($\propto z^{2}$). Thus, the
intrusion dynamics becomes sublinear as $z_{N}\propto N^{1/3}$. We develop a
theoretical framework that accounts for the forces applied by the grains on
the impactor. The scaling laws predicted by the model are in agreement with
the experimental measurements. The existence of these two regimes of
penetration dynamics reveals a crossover depth $z_{c}\sim v_{i}(d/g)^{1/2}$
which depends on the geometry of the object and the impact velocity, also well
captured by the model.

In a confined granular medium, the penetration dynamics is modified as the
granular forces are modulated by the friction at the walls. The more confined
the environment, the more difficult is the penetration by successive impacts
since the resistant force increases. Consequently, the intrusion dynamics
transits towards a logarithmic trend, $z_{N}\propto\ln N$ in the case of
extreme confinement. We extend the theoretical framework that accounts for the
forces applied by the granular medium on the impactor in this case.

The agreement between the predictions of this model and our measurements
proves that we now have a reliable understanding of the granular forces
applying on an impactor to predict its dynamics when its submitted to complex
solicitations such as a series of impacts. This understanding offers promising
opportunities to optimize the design of autonomous digging systems based on
this principle and dedicated to explore any granular soils. In future studies,
we can explore the effect of cohesion of the granular medium on the intrusion
dynamics of the impactor to get closer to practical situations.

###### Acknowledgements.

We are grateful to J. Amarni, A. Aubertin, L. Auffray, C. Manquest, and R.
Pidoux for their contribution to the development of the experimental setup. We
thank Hugo Gerard for preliminary experiments. This work was supported by ANR
PIA funding: Grant No. ANR-20-IDEES-0002.

## References

  * Aguilar  _et al._ (2016) J. Aguilar _et al._ , Rep. Prog. Phys. 79, 110001 (2016).
  * Naclerio  _et al._ (2021) N. D. Naclerio _et al._ , Science Robotics 6, eabe2922 (2021).
  * Shi  _et al._ (2019) D. Shi _et al._ , Granular Matter 21, 74 (2019).
  * Spohn  _et al._ (2018) T. Spohn _et al._ , Space Sci. Rev. 214, 96 (2018).
  * Olaf  _et al._ (2019) K. Olaf _et al._ , Acta Astronaut. 164, 152 (2019).
  * Janssen (1895) H. Janssen, Z. Ver. Dtsch. Ing. 39, 1045 (1895).
  * Ovarlez  _et al._ (2003) G. Ovarlez _et al._ , Phys. Rev. E 67, 060302(R) (2003).
  * Cambau  _et al._ (2013) T. Cambau _et al._ , Phys. Rev. E 88, 022204 (2013).
  * Mahajan  _et al._ (2020) S. Mahajan _et al._ , Phys. Rev. Lett. 124, 128002 (2020).
  * Bertho  _et al._ (2003) Y. Bertho _et al._ , Phys. Rev. Lett. 90, 144301 (2003).
  * Bertho  _et al._ (2004) Y. Bertho _et al._ , Europhys. Lett. 67, 955 (2004).
  * de Bruyn and Walsh (2004) J. R. de Bruyn and A. M. Walsh, Can. J. Phys. 82, 439 (2004).
  * Deboeuf  _et al._ (2009) S. Deboeuf _et al._ , Phys. Rev. E 79, 041306 (2009).
  * Van Der Meer (2017) D. Van Der Meer, Annu. Rev. Fluid Mech. 49, 463 (2017).
  * Huang  _et al._ (2020) K. Huang _et al._ , Sci. Rep. 10, 3207 (2020).
  * Melosh (1989) H. J. Melosh, Clarendon, New York (1989).
  * Katsuragi (2016) H. Katsuragi,  _Physics of Soft Impact and Cratering_ (Springer, New York, 2016).
  * Altshuler  _et al._ (2014) E. Altshuler _et al._ , Geophys. Res. Lett. 41, 3032 (2014).
  * Uehara  _et al._ (2003) J. Uehara _et al._ , Phys. Rev. Lett. 90, 194301 (2003).
  * Ambroso  _et al._ (2005) M. Ambroso _et al._ , Phys. Rev. E 72, 041305 (2005).
  * Katsuragi and Durian (2007) H. Katsuragi and D. J. Durian, Nat. Phys. 3, 420 (2007).
  * Goldman and Umbanhowar (2008) D. I. Goldman and P. Umbanhowar, Phys. Rev. E 77, 021308 (2008).
  * Seguin  _et al._ (2008) A. Seguin _et al._ , Phys. Rev. E 78, 010301(R) (2008).
  * Seguin  _et al._ (2009) A. Seguin _et al._ , EPL 88, 44002 (2009).
  * Umbanhowar and Goldman (2010) P. Umbanhowar and D. I. Goldman, Phys. Rev. E 82, 010301(R) (2010).
  * Pacheco-Vázquez  _et al._ (2011) F. Pacheco-Vázquez _et al._ , Phys. Rev. Lett. 106, 218001 (2011).
  * Nordstrom  _et al._ (2014) K. Nordstrom _et al._ , Phys. Rev. Lett. 112, 228002 (2014).
  * Joubaud  _et al._ (2014) S. Joubaud _et al._ , Phys. Rev. E 90, 060201(R) (2014).
  * Tsimring and Volfson (2005) L. Tsimring and D. Volfson, Powders and Grains 2, 1215 (2005).
  * Hinch (2014) J. Hinch, J. Eng. Math. 84, 41 (2014).
  * Guo (2018) J. Guo, J. Eng. Mech. 144, 06017018 (2018).
  * Takehara  _et al._ (2010) Y. Takehara _et al._ , EPL 92, 44003 (2010).
  * Takehara and Okumura (2014) Y. Takehara and K. Okumura, Phys. Rev. Lett. 112, 148001 (2014).
  * Cheng  _et al._ (2018) B. Cheng _et al._ , Phys. Rev. E 98, 012901 (2018).
  * Kang  _et al._ (2018) W. Kang _et al._ , Nat. Commun. 9, 1101 (2018).
  * Hill  _et al._ (2005) G. Hill _et al._ , EPL 72, 137 (2005).
  * Peng  _et al._ (2009) Z. Peng _et al._ , Phys. Rev. E 80, 021301 (2009).
  * Brzinski III  _et al._ (2013) T. A. Brzinski III _et al._ , Phys. Rev. Lett. 111, 168002 (2013).
  * Seguin and Gondret (2018) A. Seguin and P. Gondret, Phys. Rev. E 98, 012906 (2018).
  * Stone  _et al._ (2004) M. Stone _et al._ , Phys. Rev. E 70, 041301 (2004).
  * Albert  _et al._ (1999) R. Albert _et al._ , Phys. Rev. Lett. 82, 205 (1999).
  * Darbois Texier and Seguin (2022) B. Darbois Texier and A. Seguin, Phys. Rev. E 106, 014906 (2022).
  * Ovarlez  _et al._ (2001) G. Ovarlez _et al._ , Phys. Rev. E 64, 060302(R) (2001).
  * Katsuragi (2012) H. Katsuragi, Phys. Rev. E 85, 021301 (2012).


# Long Short-Term Memory Pattern Recognition in Currency Trading

Jai Pal
Independent Researcher
<EMAIL_ADDRESS>
###### Abstract

This study delves into the analysis of financial markets through the lens of
Wyckoff Phases, a framework devised by Richard D. Wyckoff in the early 20th
century. Focusing on the accumulation pattern within the Wyckoff framework,
the research explores the phases of trading range and secondary test,
elucidating their significance in understanding market dynamics and
identifying potential trading opportunities. By dissecting the intricacies of
these phases, the study sheds light on the creation of liquidity through
market structure, offering insights into how traders can leverage this
knowledge to anticipate price movements and make informed decisions. The
effective detection and analysis of Wyckoff patterns necessitate robust
computational models capable of processing complex market data, with spatial
data best analyzed using Convolutional Neural Networks (CNNs) and temporal
data through Long Short-Term Memory (LSTM) models. The creation of training
data involves the generation of swing points, representing significant market
movements, and filler points, introducing noise and enhancing model
generalization. Activation functions, such as the sigmoid function, play a
crucial role in determining the output behavior of neural network models. The
results of the study demonstrate the remarkable efficacy of deep learning
models in detecting Wyckoff patterns within financial data, underscoring their
potential for enhancing pattern recognition and analysis in financial markets.
In conclusion, the study highlights the transformative potential of AI-driven
approaches in financial analysis and trading strategies, with the integration
of AI technologies shaping the future of trading and investment practices.

##  1 Introduction

The study of financial markets involves navigating a complex landscape where
myriad factors influence asset prices and market dynamics. Traders and
analysts often rely on various tools and techniques to interpret market
behavior and identify trading opportunities. Among these methodologies, the
Wyckoff Phases stand out as a framework that provides insights into the
cyclical nature of market movements and the interplay between supply and
demand.

Developed by Richard D. Wyckoff in the early 20th century, the Wyckoff Phases
offer a systematic approach to analyzing market trends and identifying
potential turning points. The framework consists of several distinct phases,
each reflecting a specific stage in the evolution of market sentiment and
investor behavior. In this research, we focus on one of the key patterns
within the Wyckoff framework: the accumulation pattern.

##  2 Wyckoff Pattern

In the context of Wyckoff analysis, the phases of trading range and secondary
test play pivotal roles in understanding market dynamics and identifying
potential trading opportunities.

During the trading range phase, the market enters a period of consolidation
and indecision, where prices fluctuate within a relatively narrow range. This
phase reflects a balance between buyers and sellers as they engage in a tug-
of-war for control. The formation of lower lows and lower highs within the
trading range signifies a potential shift in market sentiment, with downward
pressure gradually diminishing.

Following the trading range, the secondary test phase emerges as a crucial
stage in the accumulation pattern. This phase involves a retest of previous
support levels, typically accompanied by a decrease in selling pressure and an
uptick in buying interest. The creation of liquidity through uniform and equal
lows reinforces the bullish bias, signaling a strengthening of underlying
demand. This sets the stage for a potential breakout to the upside, as market
participants seek to capitalize on the emerging bullish momentum.

Liquidity creation plays a vital role in both phases, facilitating smoother
price movements and providing opportunities for market participants to enter
or exit positions with minimal impact on prices. By understanding how
liquidity is created through market structure, traders can better anticipate
price movements and identify optimal entry and exit points in the market. This
underscores the importance of incorporating Wyckoff principles into trading
strategies, as they offer valuable insights into market psychology and price
action dynamics.

Figure 1: Wyckoff Accumulation Pattern Figure 2: Wyckoff Distribution Pattern

###  2.1 Trading Range Phase

The trading range phase represents a period of consolidation and indecision in
the market. During this phase, prices oscillate within a relatively narrow
range as buyers and sellers engage in a tug-of-war for control. The formation
of lower lows and lower highs within the trading range signals a potential
shift in market sentiment, with downward pressure gradually waning.

###  2.2 Secondary Test Phase

Following the trading range, the secondary test phase emerges as a critical
juncture in the accumulation pattern. This phase is characterized by a retest
of previous support levels, often accompanied by diminishing selling pressure
and increased buying interest. The creation of liquidity through uniform and
equal lows reinforces the bullish bias, setting the stage for a potential
breakout.

##  3 Model Selection

The effective detection and analysis of Wyckoff patterns require robust
computational models capable of processing and interpreting complex market
data. In this regard, the selection of an appropriate model hinges on the
intrinsic characteristics of the data under consideration.

###  3.1 Spatial Data and Convolutional Neural Networks

CNNs operate by using convolutional layers to extract features from input
data. These layers consist of filters that slide over the input data,
performing element-wise multiplications and summations to produce feature
maps. By applying multiple convolutional layers with non-linear activation
functions such as ReLU (Rectified Linear Unit), CNNs can learn hierarchical
representations of data, capturing increasingly complex patterns and
structures.

CNNs excel at processing spatial data due to their inherent ability to exploit
local correlations and spatial dependencies within the data. For example, in
image recognition tasks, CNNs can identify objects based on the arrangement of
pixels and the presence of certain visual features. Similarly, in financial
analysis, CNNs can analyze spatial patterns in market data, such as the
configuration of candlestick patterns or the distribution of technical
indicators, to make predictions or extract meaningful insights.

However, it’s important to note that while CNNs are effective for analyzing
spatial data, financial market data such as price movements is fundamentally
sequential rather than spatial. Unlike images or spatial datasets where the
arrangement of elements carries intrinsic meaning, price data represents a
temporal sequence of events. Each data point in a price chart is not
independent but instead influenced by preceding data points and contextual
factors. Therefore, while CNNs can be applied to spatial aspects of financial
data, sequential models such as Long Short-Term Memory (LSTM) networks are
better suited for analyzing temporal relationships and sequential patterns in
price data.

Figure 3: Convolutional Neural Network Diagram

###  3.2 Temporal Data and Long Short-Term Memory Models

Temporal data, characterized by sequential information and time-dependent
patterns, is ubiquitous in financial markets. Long Short-Term Memory (LSTM)
models, a type of recurrent neural network (RNN), excel at modeling sequential
data and capturing long-term dependencies. LSTMs are specifically designed to
address the challenges of modeling sequential data by incorporating mechanisms
for capturing both short-term and long-term dependencies.

At the core of an LSTM unit are three gates: the input gate, the forget gate,
and the output gate. These gates control the flow of information within the
LSTM cell, allowing it to selectively retain or discard information over time.
The input gate regulates the flow of new information into the LSTM cell,
deciding which information to incorporate into the current state based on the
input data and the current state of the cell. The forget gate determines which
information to discard from the current state, considering both the input data
and the previous state of the cell to decide which information is no longer
relevant or should be forgotten. Meanwhile, the output gate controls the flow
of information from the current state to the output of the LSTM cell,
regulating the information that gets passed on to subsequent cells in the
network or used for making predictions.

Unlike traditional RNNs, LSTMs include a cell state that serves as a conveyor
belt, allowing information to persist and flow through multiple time steps,
thereby enabling them to capture long-term dependencies in the data. By
leveraging both short-term and long-term memory mechanisms, LSTMs are capable
of learning complex patterns and capturing dependencies that span across the
entire sequence of data. In the context of financial markets, where historical
price movements and trends play a crucial role in decision-making, LSTMs offer
powerful tools for analyzing and forecasting market dynamics.

Figure 4: Long Short-Term Memory Model Diagram

##  4 Data Creation

The creation of training data for modeling Wyckoff patterns involves two main
components: swing points and filler points. Swing points represent significant
market movements, while filler points introduce noise and enhance model
generalization.

###  4.1 Swing Points

Swing points play a pivotal role in technical analysis, particularly within
the framework of Wyckoff methodology. These points represent significant
extremas in price movement, capturing moments where the market experiences
notable shifts in direction. In the context of Wyckoff analysis, swing points
are characterized by the formation of lower lows and lower highs, signaling a
potential change in trend direction.

The identification of swing points involves scrutinizing price charts and
identifying key price levels where significant highs and lows occur. A lower
low is established when a subsequent price low is lower than the preceding
low, indicating a downward movement in price. Conversely, a lower high occurs
when a subsequent price high is lower than the preceding high, suggesting a
downward reversal in price momentum.

By pinpointing these swing points, traders can discern the underlying trends
within the market. Lower lows and lower highs signify a downtrend, indicating
a prevailing bearish sentiment in the market. Conversely, higher highs and
higher lows denote an uptrend, reflecting a bullish bias among market
participants.

Understanding the concept of swing points enables traders to identify
potential trend reversals and anticipate future price movements. By analyzing
the sequence of swing points over time, traders can gain insights into the
market’s overall direction and make informed trading decisions. Additionally,
swing points serve as reference points for defining support and resistance
levels, aiding in the identification of key price zones where buying and
selling pressure may intensify.

Listing 1: Creating the Trading Range Phase Pattern

⬇

def generate_pattern(validity):

if validity:

p1 = random.uniform(0, 100)

p2 = random.uniform(0, p1)

p3 = random.uniform(p2, p1)

p4 = random.uniform(p2, p3)

return [validity, p1, p2, p3, p4]

if not validity:

pattern = [validity, random.uniform(0,100),

random.uniform(0,100), random.uniform(0,100),

random.uniform(0,100)]

if pattern[1] > pattern[2] and pattern[2] < pattern[3]

and pattern[4] < pattern [3] and pattern[3] < pattern[1]

and pattern[4] > pattern[2]:

pattern.remove(pattern[0])

pattern.insert(0, True)

return pattern

Listing 2: Creating the Secondary Test Phase Pattern

⬇

def generate_pattern(validity):

if validity:

p1 = random.uniform(0, 100)

p2 = random.uniform(0, p1)

p3 = random.gauss(p2, 5)

p4 = random.gauss(p2, 5)

p3 = min(max(0, p3), p1)

p4 = min(max(0, p4), p1)

pattern1 = [validity, p1, p2]

pattern2 = upFiller([p3,p4], p1)

final_pattern = filler(pattern1 + pattern2)

return final_pattern

###  4.2 Filler Data

Filler points are introduced to augment the dataset with additional
variability and simulate real-world market conditions. These points are
randomly inserted between swing points, creating a more diverse and
representative dataset for training the model. By incorporating filler points,
the model becomes more robust and capable of generalizing to unseen market
scenarios.

In machine learning, the generation of training data plays a crucial role in
the performance and generalization ability of models. Noise generation,
specifically the introduction of filler points, is an essential aspect of this
process. While swing points represent significant market movements and provide
valuable information for training, filler points serve to add variability and
randomness to the data, mimicking the noisy nature of real-world datasets.

The importance of noise generation lies in its ability to improve the
robustness and generalization of machine learning models. By exposing models
to a diverse range of data points, including those that may not directly
contribute to the target outcome, filler points help prevent overfitting and
ensure that models can effectively capture underlying patterns in the data.

Moreover, noise generation allows models to learn to distinguish between
signal and noise, enabling them to focus on relevant features while
disregarding irrelevant fluctuations or anomalies in the data. This process
enhances the model’s ability to make accurate predictions on unseen data by
promoting a more nuanced understanding of the underlying relationships within
the dataset.

In the context of modeling Wyckoff patterns, the inclusion of filler points
alongside swing points ensures that the model can effectively discern between
genuine pattern formations and random market fluctuations. By exposing the
model to a diverse range of scenarios, including noise generated by filler
points, the model becomes more robust and capable of identifying patterns in
real-world market data, thereby enhancing its predictive performance and
utility in trading applications.

Listing 3: Creating Filler Data

⬇

def filler(pattern):

new_pattern = [pattern[0]]

num_fillers = 2

for i in range(1, len(pattern) - 1):

new_pattern.append(pattern[i])

for _ in range(num_fillers):

filler_val = random.uniform(pattern[i], pattern[i+1])

new_pattern.append(filler_val)

new_pattern.append(pattern[-1])

return new_pattern

def upFiller(pattern, upperLimit):

new_pattern = []

for i in range(len(pattern) - 1):

start_val = pattern[i]

new_pattern.append(start_val)

end_val = pattern[i + 1]

num_fillers = 1

for _ in range(num_fillers):

filler_val = random.uniform(start_val, upperLimit)

new_pattern.append(filler_val)

return new_pattern

##  5 Activation

While there exist several other activation functions, such as ReLU (Rectified
Linear Unit), tanh (Hyperbolic Tangent), and softmax, the sigmoid activation
function remains a popular choice for binary classification tasks due to
several key advantages.

One notable advantage of the sigmoid function is its smooth and differentiable
nature across its entire domain, which enables efficient gradient-based
optimization during model training. This property is particularly advantageous
in training deep neural networks, where the smoothness of the activation
function helps mitigate the issue of vanishing gradients, allowing for more
stable and effective learning.

Moreover, the sigmoid function outputs probabilities that are intuitively
interpretable, ranging from 0 to 1. This makes it easier for traders and
analysts to understand the model’s predictions as likelihoods of a certain
outcome, such as the presence of a Wyckoff pattern. The probabilistic nature
of the sigmoid activation also lends itself well to uncertainty
quantification, allowing traders to assess the confidence level of the model’s
predictions and adjust their trading strategies accordingly.

Additionally, the sigmoid function naturally handles imbalanced datasets
commonly encountered in financial markets, where instances of Wyckoff patterns
may be relatively rare compared to non-pattern instances. By outputting
probabilities, the sigmoid function provides a continuous measure of the
model’s confidence in its predictions, allowing for more nuanced decision-
making, such as adjusting the threshold for classifying patterns based on the
prevailing market conditions. Overall, while alternative activation functions
like ReLU and tanh may offer computational advantages or better performance in
certain scenarios, the sigmoid activation function remains a robust choice for
binary classification tasks in financial markets due to its interpretability,
smoothness, and probabilistic output nature.

Figure 5: Sigmoid Activation Function Listing 4: Creating the Model with
Sigmoid Activation

⬇

model = Sequential([

LSTM(64, input_shape=(1, n_features)), # LSTM layer with 64 units

Dense(1, activation=’sigmoid’) # Output layer with sigmoid activation

])

##  6 Results

In the context of analyzing 100,000 valid and 100,000 invalid Wyckoff
patterns, the results of our study showcase the robustness and reliability of
deep learning models for pattern recognition tasks in financial markets.
Across both phases of the Wyckoff pattern – the trading range phase and the
secondary test phase – our models demonstrated exceptional accuracy and
minimal loss, highlighting their effectiveness in detecting subtle yet
significant patterns within complex financial data.

The model designed to identify the trading range phase yielded impressive
results, with a test loss of 0.0207 and a test accuracy of 99.34%. This high
level of accuracy indicates the model’s ability to accurately discern the
initial phase of Wyckoff patterns, which is characterized by distinctive price
movements signaling potential shifts in market trends. By successfully
identifying these patterns, the model provides invaluable insights for traders
aiming to capitalize on emerging market trends and capitalize on lucrative
opportunities.

Figure 6: TR Model Accuracy by Epoch

Similarly, the model dedicated to detecting the secondary test phase exhibited
outstanding performance, achieving a test loss of 0.0010 and a test accuracy
of 99.98%. This exceptional accuracy underscores the model’s proficiency in
identifying liquidity creation patterns within financial data, a critical
aspect of Wyckoff patterns. By accurately capturing these patterns, the model
empowers traders to anticipate potential market movements and make well-
informed decisions regarding their investment strategies.

Figure 7: ST Model Accuracy by Epoch

Overall, the results of our study underscore the significant potential of AI-
driven approaches in enhancing pattern recognition and analysis in financial
markets. By leveraging deep learning models, traders and analysts can gain
deeper insights into market dynamics, identify emerging trends, and make data-
driven decisions that maximize profitability and mitigate risks. As such, our
findings contribute to advancing the field of algorithmic trading and
highlight the transformative impact of AI technologies on the finance
industry.

Figure 8: Receiver Operating Characteristics Curve for TR and ST Models

##  7 Shortcomings

While the results of this study are promising, it is essential to acknowledge
certain limitations and areas for future research. One notable limitation is
the reliance on a fixed time step for model training, which may restrict the
models’ ability to capture nuanced patterns present in larger time frames.
Future research could explore adaptive time step approaches or alternative
architectures to overcome this limitation and enhance the models’ ability to
analyze data across various timeframes.

Additionally, the current study focuses primarily on the detection of Wyckoff
patterns within financial data. Future research could extend this framework to
incorporate other technical indicators, fundamental data, or sentiment
analysis to develop more comprehensive trading strategies. Furthermore,
exploring the application of reinforcement learning techniques could enable
the models to dynamically adapt their strategies based on real-time market
conditions, further enhancing their performance and robustness.

##  8 Application

The applications of this research extend beyond academic inquiry, holding
significant implications for the fintech industry and algorithmic trading. By
leveraging AI-driven models to detect Wyckoff patterns, financial institutions
can enhance their trading strategies, optimize investment decisions, and
mitigate risks effectively. These models can be integrated into existing
trading platforms to provide traders with real-time insights and decision
support, empowering them to make data-driven investment choices.

Furthermore, the adoption of AI-driven approaches in algorithmic trading can
revolutionize traditional trading strategies, enabling firms to automate
trading processes, minimize human error, and capitalize on emerging market
opportunities more efficiently. As the financial industry continues to evolve,
the integration of AI technologies will play a crucial role in shaping the
future of trading and investment practices.

##  9 Conclusion

In conclusion, this study underscores the transformative potential of AI-
driven models in pattern recognition and analysis within financial markets. By
accurately identifying key phases of Wyckoff patterns with high precision,
these models provide valuable insights for traders and investors, enabling
them to navigate complex market conditions and capitalize on emerging trends.
As we continue to explore the intersection of AI and finance, we unlock new
opportunities for innovation, efficiency, and profitability, reshaping the
landscape of financial analysis and trading strategies.

##  10 Bibliography

1.17. Neural network models (supervised). (n.d.). Scikit-Learn. Retrieved
February 22, 2024, from https://scikit-
learn.org/stable/modules/neural_networks_supervised.html

API Documentation. (n.d.). TensorFlow. Retrieved February 22, 2024, from
https://www.tensorflow.org/api_docs

Matplotlib documentation — Matplotlib 3.8.3 documentation. (n.d.). Retrieved
February 22, 2024, from https://matplotlib.org/stable/index.html

NumPy documentation. (n.d.). Retrieved February 22, 2024, from
https://numpy.org/doc/

seaborn: Statistical data visualization — seaborn 0.13.2 documentation.
(n.d.). Retrieved February 22, 2024, from https://seaborn.pydata.org/

User Guide — pandas 2.2.0 documentation. (n.d.). Retrieved February 22, 2024,
from https://pandas.pydata.org/docs/user_guide/index.html

(N.d.-a). Retrieved February 22, 2024, from
https://miro.medium.com/v2/resize:fit:1400/1*CnNorCR4Zdq7pVchdsRGyw.png

(N.d.-b). Retrieved February 22, 2024, from
https://school.stockcharts.com/lib/exe/fetch.php?media=market_analysis:
the_wyckoff_method:wyckoffaccumulation2.png

(N.d.-c). Retrieved February 22, 2024, from
https://school.stockcharts.com/lib/exe/fetch.php?media=market_analysis:
the_wyckoff_method:wyckoffdistribution1.png

(N.d.-d). Retrieved February 22, 2024, from
https://miro.medium.com/v2/resize:fit:984/1*Mb_L_slY9rjMr8-IADHvwg.png

(N.d.-e). Retrieved February 22, 2024, from
https://miro.medium.com/v2/resize:fit:970/1*Xu7B5y9gp0iL5ooBj7LtWw.png