Perceptron – Single layer neural network

If you need an Indicator or Signal developed or translated from other language, please post all Indicator development REQUESTS to this section here.

Moderator: admin

Perceptron – Single layer neural network

Postby isamegrelo » Sun Oct 08, 2017 3:18 pm

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
isamegrelo
FXCodeBase: Initiate
 
Posts: 114
Joined: Mon May 29, 2017 3:36 pm

Re: Perceptron – Single layer neural network

Postby Apprentice » Mon Oct 09, 2017 4:42 am

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 501 times
User avatar
Apprentice
FXCodeBase: Confirmed User
 
Posts: 36341
Joined: Thu Dec 31, 2009 11:59 am
Location: Zagreb, Croatia

Re: Perceptron – Single layer neural network

Postby Gilles » Wed May 04, 2022 10:33 am

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 :)
Gilles
FXCodeBase: Initiate
 
Posts: 158
Joined: Tue Jul 31, 2018 8:28 am
Location: France


Return to Indicator and Signal Requests

Who is online

Users browsing this forum: Google [Bot] and 11 guests