►
From YouTube: Market Patterns [DEMO #4] (2015 Spring NuPIC Hackathon)
Description
An attempt to use NuPIC to understand market pattern trends.
http://nupic2015spring.challengepost.com/submissions/37833-market-patterns
A
Hi
everyone,
my
name
is
sage
and
we
did
market
patterns,
which
is
not
a
very
sexy
name
for
what
we're
doing.
But,
first
of
all,
thank
you
for
having
us
here.
It's
been
a
pleasure
to
meet
some
of
the
most
wonderful
people
and
talk
about
some
of
the
most
ingenious
ideas
over
this
weekend.
I
also
haven't
slept
a
lot,
so
if
this
goes
downhill,
it's
probably
because
of
that
all
right
there
go.
Ok,
I'm
just
going
to
drag
this
over
because
I
think
otherwise
the
resolutions
gonna
be
too
low.
A
Right
side
there
you
go
alright,
so
we
started
well
I
started
working
with
Daniel
who's,
not
here
he
had
to
leave
early
to
drop
our
son
to
camp.
That's
not
important.
What
is
important
is
what
we
did
here.
Daniel
proposed
this
idea,
I'm
going
to
talk
to
him
about
trading,
but
in
a
very
specific
way.
We
look
at
stock
markets
and
it's
always
ambitious
to
kind
of
predict
where
stock
market's
going
to
be.
A
A
But
if
you
have
a
specific
strategy
in
mind
for
trading,
then
it's
kind
of
easier
to
predict
or
kind
of
realize
what
the
patterns
are
and
hopefully
select
the
data
that
you
want
to
Train
something
like
new
mint
new
pic
on,
so
that
you
can
kind
of
get
what
you
want
at
the
end
of
the
day,
so
I'm
explained
a
little
bit
further.
So
what
we
did
was
we
took
stock
data
from
the
S&P
500.
We
looked
at
15
years
in
the
past
and
we
just
picked
one
stock.
A
In
case
of
this,
we
picked
google
because
we're
already
here
so
we
picked
google's
stock
and
we
look
15
years
back
and
we
started
selecting
for
data
that
we
wanted
to
kind
of
see.
So
we
knew
we
were
not
treating
for
large
gains.
We
were
trading
for
small
gains,
maybe
one
to
five
dollar
gains,
but
at
least
a
three
day
window
of
trading
and
a
maximum
of
14
days
of
trading
window
party
either
something
okay.
The
second
thing
we
did
was
we
kind
of
started
looking
at
where
these
events
happened.
A
So
we
looked
at
where
these
events
happen
specifically,
and
once
we
had
those
points,
we
knew
where
the
deeds,
where
the
t0
was
really
think
of.
Like
physics
way
of
thinking
about
it,
t
zeroes
happen
in
certain
points
in
the
past
15
years.
So
then
we
said
if
t0
happened
here,
what
happened
preceding
that
event?
Was
there
a
pattern
that
happened
preceding
that
event?
That
kind
of
helps
us
detect
whether
this
pattern
is
going
to
happen
again.
A
We
don't
quint
predict
it
was
going
to
go
up
or
down
specifically
yet,
but
we
think
that
the
patterns
has
something
to
say
about
what
happened
next,
so
what
we
did
was
we
took
the
data
we
put
it
through
this
selective
process
kind
of
like
a
Darwinian
thing,
and
we
just
selected
for
data
that
we
wanted.
We
looked
back
from
those
data
points
about
that
say
about
28
days
and
we
try
to
get
all
the
past
points.
A
Then
we
took
that
data
and
not
describe
just
the
prices,
because
that's
that
that
kind
of
misses
the
point
of
predictive
analysis
more
about
describing
what's
happening.
So
we
looked
at
the
patterns
in
the
market
and
we
looked
at
the
candlestick
patterns
and
we
tried
to
describe
them
semantically
in
a
way
that
new
pic
understands
similarities
and
concurrence
ease
and
differences.
So
we
had
overlaps
between
the
highs
and
the
lows,
and
we
looked
at
the
upper
shadows
and
lower
shadows.
A
We
looked
at
whether
the
data
with
the
two
candlesticks
were
engulfing
one
another
why
the
midpoint
was
higher
and
lower
a
lot
of
different
ways
of
kind
of
coding.
We
basically
built
our
own
encoder
for
that
candlestick
pattern.
We
also
looked
at
the
Stoke
RSI
to
kind
of
analyze
whether
we
were
trading
at
a
really
low
point
and
whether
we
should
be
it
should
be
over.
It
was
over
traded
or
was
under
training.
So
that's
a
daily
person
yeah.
So
it
was.
A
We
had
a
high,
we
had
the
low
and
we
had
to
open
and
close
prices
for
daily
records
for
the
past
15
years,
and
we
kind
of
use
all
that
to
describe
the
data
more
than
just
put
the
prices
in
there.
So
with
that
being
said,
what
we
got
out
were
for
Google
stocks.
We
got
about
right
here,
of
course.
Not
it's
good
me
on
this
side,
so
we
were
able
to
build
so
I
was
freaking
the
mic.
A
We
were
able
to
build
this
thing
called
a
trainer
that
uses
our
encoding
method
to
encode
the
data.
We
have
to
train
new
pic
using
the
the
temporal
pooler.
Only
we
took
the
spatial
part
out
of
it.
We
thought
we
were
doing
a
pretty
good
job
at
encoding,
no
offense,
and
we
use
the
temporal
part
because
we
think
that's
where
the
patterns
really
emerge.
A
So
what
we
did
was
we
broke
the
data
that
we
had
into
about:
seventy
percent,
try
alike,
training,
data
and
thirty
percent
test
data,
and
we
never
showed
the
test
data
to
the
two
new
pic.
We
only
show
you
the
train
data,
so
this
is
one
of
the
ways
it
does
it.
We
just
go
ahead
and
load
the
training
edit
and
right
here,
I'm
loading,
the
file,
it's
super
losa
must
and
put
it
up
higher
right
here.
So
it's
loading
up
a
table
of
Google
CSV
file
into
the
thing.
A
Looking
for
the
exact
markets
up
and
downs,
finding
the
exact
points
we
want
for
trading
that
whatever
amount
it
is
we're
looking
for
and
it's
going
to
find
those
perfect
points
and
then
go
back
from
those
points
and
feed
those
into
new
pig.
But
it's
never
going
to
show
it
the
test
data
which
we're
going
to
also
make,
at
the
same
time,
so
I
go
ahead
and
run
that
it
runs
through
a
whole
process.
A
We
get
about
250
data
points
and
from
that
we
go
backwards
in
time
we
get
about
two
thousand
days
worth
of
records
in
New
picked
up
training.
Then
we
went
ahead
and
tested
it
using
the
data.
We
had
never
shown
it
before
oops.
We
never
shown
new
pic
before
and
want
to
see
how
good
it
was
at
recognizing
the
same
patterns
again,
and
we
want
to
look
at
the
anomalies
from
that.
A
I'm
hoping,
I
hope
I
hope,
I'm
making
Daniel
proud,
because
you
did
a
lot
of
look
at
this
so
anyway,
go
through
a
training
process
got
about
a
hundred.
Thirty
I
was
going
to
stop
it
because
it's
been
trained
like
three
or
four
times
already,
so
we
went
ahead
and
we
analyzed.
So
this
is
a
test
file
that
we
produce,
and
this
is
never
shown
to
new
pic
and
we
turned
a
learning
process
off
at
this
point.
A
I
want
to
see
whether
it
could
recognize
the
same
patterns
happening
again
and
whether
the
anomalies
were
low
enough.
So
then
we
go
ahead.
Did
that
this
produces
a
graph,
and
it
shows
you
on
like
a
graph
way,
how
close
it
is
to
predicting
and
anomalies,
and
if
it's
closer
to
zero,
then
that
means
that's
recognizing
the
patterns
that
we
wanted
to
recognize,
and
hopefully
I'll
pop
up
in
about
ten
seconds.
Ten,
nine,
eight,
seven,
six,
five,
four,
three,
two
one:
no
okay,
but
there
you
go
so
you
can
see.
I
mean
it
starts
off.
A
Okay,
but
then
you
can
see
start
to
recognize
more
and
more
the
patterns
and
it's
realizing
the
patterns
we
want.
We
selected
the
patterns
before
it's
happening
in
the
test
files
to
obviously
so
you're,
starting
to
see
that
the
patterns
have
been
it
has
been
trained
on
and
it
kind
of
recognized
that
it
becomes
more
closer
to
being
20
and
being
like.
Yes,
this
is
the
pattern
that
I
want
that
I
have
that
I
know
of
so
then
I
was
like.
A
We
can
look
at
the
opposite
side
and
teacher.
The
patterns
we
don't
want
also
happening,
and
they
can
kind
of
compare
the
two
and
correlate
when
the
best
probability
of
as
investing
in
those
stocks
are
really
it's,
for.
I
think
I
think
the
application
for
this
stems
beyond
just
finance.
I
think
human
behavior
plays
a
great
role,
but
I
think
this
is
a
demo
for
something
like
this
and
for
temporal
learning
and
patterns,
and
that's
basically
it
thank
you
for
your
time.
A
Sorry,
boys,
it
is,
it's
all
been
pushing
github,
it's
all
free
to
use,
feel
free,
yeah,
so
I
mean
I
wanted
to
do
more,
but
the
more
I
do
the
more
I
break
last
minute.
So
I
didn't
well
I
talks.
A
A
So
so,
within
this
anomaly,
it's
taking
a
pretty
significantly
big
window
and
it's
taking
an
average
of
all
the
anomalies
within
that
window.
So
the
idea
would
be
to
go
with
this
anomaly.
Look
at
the
array
and
see
where
the
lowest
anomaly
happened,
because
then
you
can
start
seeing
the
same
patterns
again
that
happened
before
and
if
you
recognize
these
candlesticks
are
happening
again
before
a
significant
event,
whether
it
be
up
or
down
that
I
don't
know
of
yet
but
I
think
that's
where
the
idea
fundamentally
lies.
A
If
you
can
figure
out
at
what
point
you
want
to
kind
of
investigate,
and
the
idea
is
to
compare
something
like
this
against
things
they
already
have,
because
really,
this
involves
temporal
learning
and
building
connections
to
synapses
versus
something.
That's
an
algorithm.
I
feel
like
it's
too
fixed
and
I.
Think
something
like
this
has
a
lot
more
potential
to
do
a
lot
more
in
the
long
run
than
something
that's
already
fixed
in
spur
a
meters.
Is
that
how
your
question
kind
of
not
really
I,
know
I'm
terrible
at
that?
A
A
It
was
daily
as
daily
again
I
just
went
ahead
and
looked
at
I
just
asked
yahoo
stock
finance
to
give
me
data
200
days
in
the
past,
starting
at
two
hundred
a's
in
the
past
and
then
going
30
days
forward
from
there
and
every
time.
I
just
went
one
day
forward
and
then
30
days
from
that
and
looked
at
the
anomalies
between
those
two
sections,
yeah.
A
The
na
mele
scores
so
they
have
to
be
taken
with
a
grain
of
salt.
They
tell
you
when
new
pic
is
seeing
something
that
has
seen
before,
because
the
way
we
picked
our
patterns,
it
tells
us
that
new
pic
recognizes
the
patterns
that
are
happening
again,
since
it
was
trained
on
those
very
same
patterns
and
if
we
can,
if,
if
if
patterns,
do
hold
true,
if
his,
if
history
does
repeat
itself
as
they
say
then
I
think
to
a
certain
extent,
there
is
some
predictability
in
these
kind
of
datas.
A
I
know:
there's
a
lot
of
things
that
happen
in
the
world
that
change
markets,
but
I,
think
markets
are
a
meta-analysis
of
looking
at
those
kind
of
events.
Yes,
obviously
anomalies
exist
and
that's
what
we're
doing
here
but
I
think
at
the
end
of
the
day-
and
this
is
basically
just
read
out
data
because
it's
caught
up
today-
it's
not
my
failure.
That's
just
I
can't
I'm.
Sorry,
there's
no
future
data,
but
but
yes,
I,
think
there's
some
there's
some
predictability
to
something
like
this
and
the
question.
A
I
don't
take
too
much
time
so
I
feel
like
okay.
Anybody
else.
Oh
thank
you
well
I'd,
like
to
thank
my
team.
I
mean
they
put
a
lot
of
effort
and
Daniel
who's.
Not
here
he's
amazing
and
he
really
sold
me
on
the
idea
and
I
think
we
started
working
in
after
that.
Just
we
couldn't
stop.
Why
couldnt
near
the
questions?
Oh
okay,
thank
you
for
your
time.
Yeah.