Hello Friend,

If this is your first visit to SoSuave, I would advise you to START HERE.

It will be the most efficient use of your time.

And you will learn everything you need to know to become a huge success with women.

Thank you for visiting and have a great day!

Neural Network - Stocks/Options/Forex

beforeimgone

Master Don Juan
Joined
Dec 28, 2013
Messages
628
Reaction score
164
Hi guys,

I program mainly in python, but I know java, c#, and a lot of other languages. I previously made a program using a machine learning algorithm to predict closing prices of a stock. The accuracy was close to 70 percent. That isn't enough for me to risk anything so I tore it down and am starting over.

I'm building this in python, but am willing to use another language if it would be better for my cause. Any ideas?

Also, I made a dating website and open sourced it if you are into that. Python
 

switch7

Master Don Juan
Joined
Dec 20, 2014
Messages
643
Reaction score
335
Location
uk
Why wasn't 70% accuracy good enough?

What strategy do you use to predict the prices?
 

synergy1

Master Don Juan
Joined
Sep 22, 2006
Messages
1,995
Reaction score
191
70% seems like a pretty high prediction rate for any sort of intraday time series forecast model. That said thats pretty good if you know your stuff. When you say you predict 70% of the time, what are your hit rates - in a confusion matrix what are you Type 1 errors? How are you training your methods, and what % of out of sample data are you using?

I am not that solid in this area, but managed to land a job offer at DE shaw with a time series forecasting code test they gave me. The difficult part was determining if my predictions were correct due to the model, or if the time series was simply trending for the regime in question.

I always liked this stuff and told myself i'd get back into it once my application is done and I have a little more free time to look at it. Good luck with it all
 

beforeimgone

Master Don Juan
Joined
Dec 28, 2013
Messages
628
Reaction score
164
70% seems like a pretty high prediction rate for any sort of intraday time series forecast model. That said thats pretty good if you know your stuff. When you say you predict 70% of the time, what are your hit rates - in a confusion matrix what are you Type 1 errors? How are you training your methods, and what % of out of sample data are you using?

I am not that solid in this area, but managed to land a job offer at DE shaw with a time series forecasting code test they gave me. The difficult part was determining if my predictions were correct due to the model, or if the time series was simply trending for the regime in question.

I always liked this stuff and told myself i'd get back into it once my application is done and I have a little more free time to look at it. Good luck with it all
Congrats on the cool job!

What problem did you solve? I'd definitely like to learn it.

I used an Ann with 4 inputs and one hidden layer. I also used lots of scikit learn algorithms that were trained with about 3/4 ths of the data. What yielded the highest result was decision tree. Around 68 percent. It sounds nice but there are only two options, Right or wrong. I'm trying to get to 85 percent. What do you suggest?
 

synergy1

Master Don Juan
Joined
Sep 22, 2006
Messages
1,995
Reaction score
191
Congrats on the cool job!

What problem did you solve? I'd definitely like to learn it.

I used an Ann with 4 inputs and one hidden layer. I also used lots of scikit learn algorithms that were trained with about 3/4 ths of the data. What yielded the highest result was decision tree. Around 68 percent. It sounds nice but there are only two options, Right or wrong. I'm trying to get to 85 percent. What do you suggest?
Mine was likely simpler than what you have done. Basically I had a time series of an asian stock and had to determine (1) which of 10 securities appeared to correlate with it and (2) what kind of predictions I could make based on the asians stock movement. It was a small sample set, and I used simple ols to determine how well price movements correlated and eliminated ones that didn't seem strong. I did a few other time series sticks that I probably can't elaborate on in an intelligent fashion, but basically I determined if the two series were trending since that can throw ones results.

That said you are further ahead of where I am at the present. I did a ton of ts stuff in graduate school, but with any non-stationary or trending signal, the **** gets hard.

And for what its worth, I did the same thing - right or wrong. Was an up day in asia and an up day in america statistically significant? That was my basic question.

Keep it up. I might look more into this as a hobby down the road, but for now its been on hold for about a year!

cheers
 

beforeimgone

Master Don Juan
Joined
Dec 28, 2013
Messages
628
Reaction score
164
Mine was likely simpler than what you have done. Basically I had a time series of an asian stock and had to determine (1) which of 10 securities appeared to correlate with it and (2) what kind of predictions I could make based on the asians stock movement. It was a small sample set, and I used simple ols to determine how well price movements correlated and eliminated ones that didn't seem strong. I did a few other time series sticks that I probably can't elaborate on in an intelligent fashion, but basically I determined if the two series were trending since that can throw ones results.

That said you are further ahead of where I am at the present. I did a ton of ts stuff in graduate school, but with any non-stationary or trending signal, the **** gets hard.

And for what its worth, I did the same thing - right or wrong. Was an up day in asia and an up day in america statistically significant? That was my basic question.

Keep it up. I might look more into this as a hobby down the road, but for now its been on hold for about a year!

cheers
Nice, sounds like a helluva job. Was it a school project?

And the hardest part of what I'm doing is building the classifier
 

synergy1

Master Don Juan
Joined
Sep 22, 2006
Messages
1,995
Reaction score
191
Nice, sounds like a helluva job. Was it a school project?

And the hardest part of what I'm doing is building the classifier
It was an interview question. Some of the other stuff was just to get the hang of it and learn coding. I have been out of college for quite some time.
 

beforeimgone

Master Don Juan
Joined
Dec 28, 2013
Messages
628
Reaction score
164
I feel that. Well if you ever wanna get into it you could help me with my algorithm. I'll let you know when I make a breakthrough
I figured it out! I got it to 92.6 percent accuracy! I paid off my truck today. I'll create an Instagram and post all of the shvt I buy there. If a month goes by and I haven't posted a link there please contact me so I can show
 

Cambridge

Don Juan
Joined
Aug 9, 2017
Messages
40
Reaction score
17
Location
California
The accuracy was close to 70 percent. That isn't enough for me to risk anything so I tore it down and am starting over.
IME you typically need to push above 60% successful trades to make a living trading any market. The best momentum traders are typically around 70% profitable trades (different from just "successful" trades). What you are probably doing is "overfitting", inventing an algorithm or model that describes something as opposed to predicts something. You'll find several momentum-style algorithms will overfit lots of mature assets/equities. You can make money doing this but usually you just get bitten by the risk exposure.

python is the best language to get started.
 

beforeimgone

Master Don Juan
Joined
Dec 28, 2013
Messages
628
Reaction score
164
IME you typically need to push above 60% successful trades to make a living trading any market. The best momentum traders are typically around 70% profitable trades (different from just "successful" trades). What you are probably doing is "overfitting", inventing an algorithm or model that describes something as opposed to predicts something. You'll find several momentum-style algorithms will overfit lots of mature assets/equities. You can make money doing this but usually you just get bitten by the risk exposure.

python is the best language to get started.
I took great care to avoid overfitting. It's a death sentence

And true, python is what I use mostly
 

synergy1

Master Don Juan
Joined
Sep 22, 2006
Messages
1,995
Reaction score
191
I feel that. Well if you ever wanna get into it you could help me with my algorithm. I'll let you know when I make a breakthrough
I might take you up on that. There is a possibility that I am going to review machine learning and start some example projects for myself. It would be fun to collaborate on something once I have all my knowledge back up to snuff. I'll send you a PM.

cheers
 

Bible_Belt

Master Don Juan
Joined
Jul 27, 2005
Messages
17,023
Reaction score
5,605
Age
48
Location
midwestern cow field 40
The win percentage that you are talking about is meaningless by itself, because the amount won or lost on each trade is not the same. The best traders often have a surprisingly low percentage of winners. The worst trader I ever knew was right over 90% of the time. He lost everything. He was a client, and I ran a computer program to analyze his trades, which is how I know. Later in life, when I had company money, my own percentage of being right was more like 30%. And I always had a profitable account. I kept my job in an environment where the vast majority got fired. My employer eventually went out of business, but that wasn't my fault.

There's a lot more to risk management than trying to win on more trades that you lose on. You have to use stop losses to limit your losses on bad trades. That's what happened to my 90% guy - the other ten percent were huge losses that wiped out everything. When I looked at traders' accounts, I could tell they knew what they were doing if I saw a pattern of small loss, small loss, big gain - that's being a professional. Amateurs get caught up in the psychology of always wanting to win, and they don't use stops. There's many other levels of risk management as well: particular stocks to avoid, days or times to not trade, daily circuit breakers that shut yourself off on really bad days. Plus, setting the exact levels on your stops is an art form all by itself.
 
Top