
steevo


Total Posts: 9 
Joined: Feb 2019 


imagine a stock with 2 bollinger bands...2st.devs, and 3 st.devs. and every time the stock price touched the 2nd st dev band, price always stretched to touch the 3rd st dev band. Outside of that pattern, the time series is completely random.
now lets imagine that we were unaware of that pattern existing, so we didn't feed bollinger bands into the NN as one of the inputs.
will the NN, built with Keras over TensorFlow find that pattern on its own? is a NN capable of doing that? 




ronin


Total Posts: 427 
Joined: May 2006 


The question is a bit ill posed.
What standard deviation? Daily?
How does this "every time the stock price touched the 2nd st dev band, price always stretched to touch the 3rd st dev band" work? After the first band is touched, it does a big jump? It only has down ticks until it hits the second band?
Two standard deviations would have the frequency of once every 45 days, three standard deviations once every 750 days.
Exaggerated frequency of down moves would drag the mean down, so there would have to be a correction to the mean to leave it "completely random"  which presumably means zero mean. After correcting the mean, there would be some visible skew. So your time series would be ticking up on average, but brought down every once in a while by an exaggerated down move.
Whether or not a NN would catch it depends on what sort of thing the NN is looking for. When all is said and done, NNs are just curve fitters. And asking "what is the mean, variance, skew and kurtosis of this time series" is a fairly simple place to start.
So, yes.
What you use to construct the NN doesn't matter. That's like saying "could excel spot this". Excel couldn't, but any entry level trader or quant using excel could. 
"There is a SIX am?"  Arthur 


steevo


Total Posts: 9 
Joined: Feb 2019 


ok, this was a great reply..its helping my brain.
so i guess my question now should be...what type of approach should i use when setting up the NN? are there particular models (LSTM i'm guessing), algorithims, number of nodes, layers, other parameters that would need to be set, in order for the NN to be capable of detecting these things?
Maybe those bollinger bands were based on 15 minute bars using a 60 period moving avg...or maybe they were based on 50k shares per bar (so, not time based, but volume based). If the NN was fed tick level trade data, would it be able to aggregate on all those different levels to find those patterns? 




Maggette


Total Posts: 1093 
Joined: Jun 2007 


That depends on your answers to ronins questions:
"What standard deviation? Daily?
How does this "every time the stock price touched the 2nd st dev band, price always stretched to touch the 3rd st dev band" work? After the first band is touched, it does a big jump? It only has down ticks until it hits the second band? " LSTM and GRU come to mind. But again, if you think that stddev bollinger bands play a role, there are far more data efficient ways to find it.
If you think: if configure a super deep and smart ANN and it will find any pattern (if there are one), you are wasting your time.
Make the nertwork deep enougfh and you will find "patterns".......like humans do. 
Ich kam hierher und sah dich und deine Leute lächeln,
und sagte mir: Maggette, scheiss auf den small talk,
lass lieber deine Fäuste sprechen...



ronin


Total Posts: 427 
Joined: May 2006 


I'd second this. Start with a simple model, fit that and see how it works.
E.g. some sort of local volatility, or maybe diffusion plus a jump process with some correlation betweem diffusion and jumps, maybe even correlation skew, or something like that. There may be autocorrelation, or autocorrelation conditional on something.
Of course, you need a bit of data. Enough to resolve stuff that happens in the tails that only comes up very rarely. Look up importance sampling.
Like @maggette says, give it too many degrees of freedom and it will overfit. There is zero predictive value in overfits.
The model I described is say 510 parameters (mean, variance, skew, kurtosis = 4, then add a few more to deal with the exotic overlays). All this assumes the distribution is Gaussian plus perturbation. So your NN needs to be able to approximate a Gaussian, and then have those extra degrees of freedom to fiddle with. How many nodes and layers to approximate a Gaussian is a bit like asking how long is a piece of string.
Or, you can just start from a Gaussian model plus perturbation and fit that. Bonus points if you can guess the form of the perturbation well.

"There is a SIX am?"  Arthur 



gaj


Total Posts: 39 
Joined: Apr 2018 


@ronin, can you elaborate how you use your time series model for prediction? I think in trading we ultimately care about expected values. How does knowing skew and kurtosis affect your prediction? 



ronin


Total Posts: 427 
Joined: May 2006 


> I think in trading we ultimately care about expected values.
Do we though?
E.g. in mean reversion, you'd worry about skew and kurtosis more than the mean. Who cares where it will come back to if it wipes you out in the meantime. In fundamental, you worry about the mean, and skew and kurtosis are risk parameters. You'll get there eventually, and you'll hold it as long as you have to or until the fundamentals change. In trend following, you are looking at the ratio of the mean to some combination of variance, skew and kurtosis. Etc.
In this particular example, there would beat least two obvious ways to trade it, one long gamma and the other short gamma  if the statistics holds.

"There is a SIX am?"  Arthur 



jslade


Total Posts: 1164 
Joined: Feb 2007 


I fail to see what a neural net will capture that an if statement isn't going to capture in the problem as stated. Is a neural net going to tell you, "hey man, trade the rolling std dev crossover?" Even if it manages to fit to that pattern, which is doubtful; absolutely not; a neural net is the worst tool possible to attempt to gain insight into what a timeseries or any other pile of data is doing. I'd even say it's the worst possible tool to imagine modeling a financial system with, though I am sure you can do it. Ain't no n00b gonna do it.

"Learning, n. The kind of ignorance distinguishing the studious." 


gaj


Total Posts: 39 
Joined: Apr 2018 


@ronin: Good point. I guess I'm biased towards HFT where CLT kicks in quickly and only lower order statistics matter. 








