Share it with your friends Like

Thanks! Share it with your friends!


Using previous pattern outcomes to help us begin to predict future outcomes.

Welcome to the Machine Learning for Forex and Stock analysis and automated trading tutorial series. In this series, you will be taught how to apply machine learning and pattern recognition principles to the field of stocks and forex.

This is especially useful for people interested in quantitative analysis and algo or high frequency trading. Even if you are not, the series will still be of great use to anyone interested in learning about machine learning and automatic pattern recognition, through a hands-on tutorial series.



vinod kumar says:

Okay Its been 7 years. Are you a billionaire now?

Trần Ngọc Dũng says:

Can you turn on the subtitles of the video for me? You do not need to create subtitles, I will use YouTube's automatic translation function. Thankyou, Sincerely

DCap says:

ok so it seem the repo is not complete. Can't use it.

DogeEyes DogeMinds says:

Hello, i have a question why do we store the 'futureOutcome' as the percentChange between one element in the 'avgLine' array and the average of 10 elements in the '20 element future'? And then in the end we print these as the 'predicted outcome'(cause its used to form the performanceAr) , i don't understand how this 'futureOutcome' at some indexes is the 'predicted outcome'. The lines i'm talking about:
avgOutcome = reduce(lambda x, y: x+y, outcomeRange) / len(outcomeRange)
currPoint = avgLine[y]
futureOutcome = percentChange(currPoint, avgOutcome)
print 'predicted outcome', performanceAr[patDex] .
Please help me out want to understand this fully 😀 .

DCap says:

Just downloaded the repository. Need to watch all 10 videos again….so good.

DCap says:

Fascinating. New to python and new to ML. Seeking to implement pattern recognition into my trading algos. Thanks for the videos. Hopefully code will work in Python 3.7

David Ho says:

whats wrong with my code?

if I do this

def percentChange(startPoint, currentPoint):


x = ((float(currentPoint) – startPoint) / abs(startPoint)) * 100.00

print('x chg', 100.00 – abs(x))

if x == 0.0:

return 0.000000001


return x

except ValueError as err:

return 0.00000000

The x chg looks right, but if I run this

for eachPattern in patternAr:

i = 0

simAccum = 0

while i < 30:

chg = percentChange(eachPattern[i], patForRec[i])

print('chg', chg)

simAccum += 100.00 – abs(chg)

i += 1

print('simAccum', simAccum)

The chg print does not match the prints for percentChange

– Original post by David Wynter

Kenneth Wong says:

don't understand what's the problem hereeee

Warning (from warnings module):
File "/Users/kennethwong/Desktop/Forex Bot/", line 18
return ((float(currentPoint) – startPoint)/abs(startPoint))*100.00
RuntimeWarning: divide by zero encountered in double_scalars

Jeremy P says:

I'm getting an Typeerror: 'list' not callable on the line print('Predicted Outcome: ', performanceAr(patDex))

Fernando Jauregui says:

this is the most messy language i've ever seen
you keep explaining.. but if the code has no logic at all… it's a waste of time

Liangyu Min says:

ennn… Maybe we should use enumerate and list sub for the loop body…

Swagat Ranjit says:

Any idea about forecasting of foreign exchange rate?

Ben Liu says:

Hi, I went through step by step and got weird outcomes for patternRecognition(). When I calculated patterns, some elements (percentChange) of them are tiny small so that when I computed "sim", some eachpattern[i] are relatively much smaller than patternForRec[i]. As a result, the corresponding percentChange(eachpattern[i],patternForRec[i]) is far more bigger than 100, and I got a lot of VERY negative values for sims. I checked the whole program and I don't know why I cannot get the similar results as yours 🙁

Jinex2010 says:

So, I am currently developing this in QT C++. It took me 2 hours to discover that the abs() function applied on the startPoint in the percentChange function caused Nan error on every single computation ran by the paaternRecognition function. It was the fault of the Qt's abs() function. The std::abs() works fine! (#include <cmath>)

Antonio Constandinou says:

i got a similar error as below – seems like I may be dividing by 0

File "", line 22
    return ((float(currentPoint – startPoint)/abs(startPoint)))*100.00
RuntimeWarning: divide by zero encountered in double_scalars

Jason Turner says:

I go through the whole process no errors but the predicted outcome is not printing.Only the current pattern, pattern storage takes to long and the pattern recognition doesn't print like it does for you. I don't see the lines in between etc.and this takes me 1004.8870008 seconds to print the whole process. while yours take 7 seconds, why?

sentdex says:

Sounds like it was caught by a try and except. Probably just a pattern that wasn't filled in the first round or something. I went back and ran to see if I could find the error, and I couldn't Somewhere you're dividing by 0 and it's probably in one of the averaging lambda 1-liners. If you continue to see it, it'll probably cause problems down the line. Definitely want to figure out what is wrong.

dfrusdn says:

I continued further in the tutorial and it disappeared. very strange. The error was printed and skipped and I still got the same data come out.

Write a comment


DARPA SUPERHIT 2021 Play Now!Close


(StoneBridge Mix)

Play Now!