Neural network
Neural network
26 Dec 2017, 21:50
Hi all,
Before I spend time on coding this new project, I just wanted to see if anyone else has some experience with it. The topic at hand is per subject line, has anyone out there coded neural networks into an indicator before? If so was it a success? I'm going to be working on this project now and see where it takes me.
Thanks,
Tony
Replies
HTtrader
04 Jan 2018, 12:51
Hi itmfar,
I have an idea on how I am going to go about this, how much programming and knowledge of neural netoworks do you have? If you can understand this we might be able to collaborate on this. I plan to have 4 input neurons high low open and close with 3 output bull bear neutral and at this stage plan to back propogate the learning.
Regards,
Tony
@HTtrader
itmfar
06 Feb 2018, 10:06
RE:
hungtonydang said:
Hi itmfar,
I have an idea on how I am going to go about this, how much programming and knowledge of neural netoworks do you have? If you can understand this we might be able to collaborate on this. I plan to have 4 input neurons high low open and close with 3 output bull bear neutral and at this stage plan to back propogate the learning.
Regards,
Tony
I used to program java and c# as a junior and I worked with weka api as a learning machine.
@itmfar
suradi
06 Feb 2018, 12:31
This should get you started with perceptrons :)
private double perceptron1() { int[,] input = new int[,] { { 1, 0 }, { 1, 1 }, { 0, 1 }, { 0, 0 } }; int[] outputs = { 0, 1, 0, 0 }; Random r = new Random(); double[] weights = { r.NextDouble(), r.NextDouble(), r.NextDouble() }; double learningRate = 500; double totalError = 1; int last = MarketSeries.Close.Count - 1; while (totalError > 0.2) { totalError = 0; for (int i = 0; i < 4; i++) { int output = calculateOutput1(input[i, 0], input[i, 1], weights); int error = outputs[i] - output; weights[0] += learningRate * error * input[i, 0]; weights[1] += learningRate * error * input[i, 1]; weights[2] += learningRate * error * 1; totalError += Math.Abs(error); } } //macd.Histogram double a1 = macd.Histogram[last - 1]; double a2 = macd.Histogram[last - 1 - 1]; double a3 = macd.Histogram[last - 1 - 1 * 2]; double a4 = macd.Histogram[last - 1 - 1 * 3]; double sum = (weights[0] * a1) + (weights[1] * a2) + (weights[0] * a3) + (weights[1] * a4); return (sum >= 0) ? 1 : 0; } private static int calculateOutput1(double a1, double a2, double[] weights) { double sum = a1 * weights[0] + a2 * weights[1] + 1 * weights[2]; return (sum >= 0) ? 1 : 0; }
itmfar
02 Jan 2018, 19:43
I would glad if we can cooperate in this field
@itmfar