Page 1 of 1

Perceptron – Single layer neural network

PostPosted: Sun Oct 08, 2017 3:18 pm
by isamegrelo
Formula:

// --- settings ---
//weight in % for each neuron
//x1=5
//x2=10
//x3=25
//x4=50
//indicator previous period
//y1=0
//y2=7
//y3=14
//y4=21
// --- end of settings ---

//indicator to be used by the neural network
indi = average[5](rsi[14])

w1=x1-100
w2=x2-100
w3=x3-100
w4=x4-100
a1=indi[y1]
a2=indi[y2]
a3=indi[y3]
a4=indi[y4]

return(w1*a1+w2*a2+w3*a3+w4*a4)



Indicator in this chart:

Image

Re: Perceptron – Single layer neural network

PostPosted: Mon Oct 09, 2017 4:42 am
by Apprentice
Try this fixed version.
viewtopic.php?f=17&t=65166
This is the original version, I believe there is a bug in this indicator logic.
Perceptron2.lua
(3.43 KiB) Downloaded 505 times

Re: Perceptron – Single layer neural network

PostPosted: Wed May 04, 2022 10:33 am
by Gilles
Hi Apprentice,

here, the problem is that the perceptron is useless because it is a linear model. While we seek to solve every day a problem that is not. It is for this reason that I proposed to convert a tradingview code into lua: https://fxcodebase.com/code/viewtopic.p ... 89#p145061

Or you could still predict the development of the multilayer perceptron :)

See you soon :)