Page 1 of 1

Using neural network in stock exchange

PostPosted: Sat Dec 01, 2012 9:02 am
by Motig
First, let me say that this is absolutely great library! I'm so glad I found it.

I have 40 inputs, market values from the stock exchange.

The learning goes like this: for the 40 inputs, I calculate 2 numbers.
1) How much money would I earn or lose with a buy order
2) How much money would I earn or lose with a sell order

Because of how stock exchanges work, both numbers can actually be negative/positivie indicating that I can lose/earn money for either buy and sell. If that happens, it is an indication that I should not place an order at all, even if both buy&sell are positive numbers.

Therefore, I imagine using the network to work as this:
Code: Select all
new ActivationNetwork(new BipolarSigmoidFunction(), 40, 40 * 2, 1)
(I've got the idea of doubling the neurons in the first layer (40*2) from the TimeSeries sample)
- BackPropagationLearning teaches the network that for various 40 inputs, the output is either
-1 (sell order is going to earn money, buy is going to lose money)
+1(buy order is going to earn money, sell is going to lose money)
0 (buy and sell are both going to sell/lose money, avoid trading)

I don't even know if this is the good approach. I'm imagining that after learning, the network output will be always some number close to -1, 1 or 0 and it's just up to me where I set the threshold for buying or selling.

Is this a right way to use a neural network?

Re: Using neural network in stock exchange

PostPosted: Thu Dec 13, 2012 6:44 pm
by Tievoli
Well there are some options maybe.

There is fuzzie logic, and ther is neural networks.

Fuzzie logic excels in rule sets and finding balance in it (eventually).
Fuzzie logic is used for things like -15 to 0 = freezing, -5 to 17 is cold 15 to 30 is warm and 25 to 41 is hot.
Dose numbers overlap as you see and you can still calculate with them in a fuzzie way like probability, so 28 degrees is both warm and hot. > so you go trough both their "action" in some balance to do something
this blance is part of fuzzie logic and in the end it result in da de-fuziefication to something like turn the heater off.

if you do stock exchange and you figured out some kind of rules just like the temperature readings do this or do that based upon if that is in the range of... etc..
then fuzzie logic is your king.

Neural networks are an advancement of it but in a verry different way, neural networks need to be trained, they are not exact, they can make errors, just like our own mind.
neural networks easily become so complex, its hard to evaluate why they behave like they do.. its often difficult to determine how many input nodes you need and how many layers.
In most cases 1 hidden and rarely 2 hidden layers is enough their node ratio.. is another topic how many nodes per layer.
However you should wonder what can you do with them, for what are neural networks king in their area..
They are good for patern recognition, like letters, symbols, for formula emulation like a neural network that perfoms f(x)=sin(y)
Their performance greatly depends on the training data you can give them, (can you train/emulate a market ??)

Ofcourse you're not limmited here, you might use both programming fields they are closely related, although i think maybe start with fuzzie logic that keeps you slightly more in control of your money