• Welcome back! Thank you for being a part of this Traders Community. Let's discuss and share :)
    Selamat datang kembali! Trimakasih telah menjadi bagian dari Komunitas Trader ini. Mari berdiskusi dan berbagi :)

Suggestion One Perceptron EA code AI Neural Network

fxgreen

Member
Credit Hunter
Credits
0
all ea sample you can download source code from mql5.com

https://www.mql5.com/en/articles/497
https://www.mql5.com/en/code/1104
https://www.mql5.com/en/code/16727
https://www.mql5.com/en/code/1135
https://www.mql5.com/en/code/23220
https://www.mql5.com/en/code/17137
https://www.mql5.com/en/code/8499
https://www.mql5.com/en/code/16762
https://www.mql5.com/en/code/22693
https://www.mql5.com/en/code/22573
https://www.mql5.com/en/code/1649
https://www.mql5.com/en/code/23338


the problem for one perceptron is not enough for trade
advice to modify that EA
1. add more input
1.1 add more input like more price (maybe shift price)
1.2 add more input like more Timeframe
1.3 add more input like indicator MA, CCI, RSI, BB
2. add more weight
3. add bias
4. add activate function (Sigmoid, Relu, softmax)
5. add more perceptron to multiple perceptrons
6 . add more layer ( add more 2 hidden layer)

reference code 1 perceptron
add more
one perceptron not enough for trade forex
some code has only 4 input, I think is not enough for can trade
input can be more price
input can be all timeframe from 1 minute to monthly
input can be multiple indicators MT5 have 38 indicator build-in without use external indicator
some code has only 4 weight I think is not enough for perceptron
some code does not have bias mush be added to the perceptron
some code did not have an activated function
all code has only 1 perceptron again add it more
all code is only 1 layer need to add more layer 1 hidden layer or 2 hidden layer

modify more
recommend making 1 perceptron to multi perceptron or complex perceptron
recommend making 2 layer perceptron

explains
Neural Networks from Scratch - P.1 Intro and Neuron Code - YouTube
this clip explains to know and code better

so, EA has perceptron inside still limited a lot
Better than EA build-in code perceptron is External software like using python with real AI . (using Keras and TensorFlow or PyTorch)

most AI trade is python program that code with API from broker and trade directly to the broker (not using MT4, MT5)

MT5 have MetaTrader for Python so you can using pure python trade via MT5 (without mql5)
however MetaTrader for Python using like EA mode on MT5 (require open MT5 and enable using Expert Advisor)
 

Attachments

sentdex is good one tutor tech about python and neural network and on youtube has a lot of good stuff

Compare with one perceptron EA

Very small tiny neural network. multilayer 10,8,8,8,2

Small neural network size 10,128,128,128,2 (with 34700 paramiter value)

is really small when compared with AI.

AI for Trade minimum you need to develop AI. like tiny AI. that using run on mobile phone Apple iPhone and an android new generation(Tensorflow Lite, Core ML, PyTorch Mobile)
but you have a PC it can use a large neural network

Sample code on python you can convert to MQL5 to put on MQL5 (forget MQL4)
compare with one perceptron EA from mql5.com is same
So, now you got 1 perceptron, next step you need to use 1 perceptron make to multi perceptron and next, will be adding more layer

vlcsnap-2020-12-24-19h09m03s761.png vlcsnap-2020-12-24-19h09m20s092.png vlcsnap-2020-12-24-19h09m39s148.png
 

Attachments

  • vlcsnap-2020-12-24-19h09m03s761.png
    vlcsnap-2020-12-24-19h09m03s761.png
    946.7 KB · Views: 511
  • vlcsnap-2020-12-24-19h09m20s092.png
    vlcsnap-2020-12-24-19h09m20s092.png
    554.3 KB · Views: 507
  • vlcsnap-2020-12-24-19h09m39s148.png
    vlcsnap-2020-12-24-19h09m39s148.png
    260.5 KB · Views: 504
MT4 have limited a lot

MT5 has limited same

if you think using MQL5 generate weight value for tiny ML
using Optimization
MQL5 with 5 digits have weight limited about <70 weight only
MQL5 with 4 digits have weight limited about <90 weight only
MQL5 with 3 digits have weight limited about <200 weight only
MQL5 has limited 64 bit generate optimization

not enough for neural network

other way is random and write weight and write to CSV file
or maybe using a database like SQLite3 to store weight data
SQLite3 have a limited table at 32767 columns and 1073741824 roll

both not enough for neural network, same

recommend making python API work external and communication with python AI. still easy to develop, easy work, easy using

So for AI. on ex4, ex5 one file
Yes, it can call Real AI. because make code like AI.
BUT BUT BUT BUT, it is a very small neural network

forget AI. ex4 standalone (one file)
forget AI. ex5 standalone (one file)

Sorry
when compare with AI. in real-world like
it can call like this or giving level of AI. like this

one perceptron ==> NOT network (have only one)
many perceptron ==> stupid neural network (So stupid)
very very large perceptron + complex perceptron ==> neural network
python+keras+tensoflow ==> neural network
GPU/TPU + python+keras+tensoflow ==> smart neural network
Super Computer ==> super smart neural network

So, Do you want to use So stupid neural network to trade for you
using So stupid neural network to play you REAL money is good thinking?

GPU is a graphics card on your PC you need one to use
only using NVIDIA (for now, not using AMD.)
NVIDIA gtx 1080 ti 11gb gpu
NVIDIA gtx 2080 ti 11gb gpu
NVIDIA GeForce RTX 3070 gpu
NVIDIA GeForce RTX 3080 gpu
NVIDIA GeForce RTX 3090 gpu

Compare with using python for external work with using EA sent a lot of data (large data) to python via using web requests and get response return to using the decision to trade is a better way to using AI. trade

the problem most AI. EA can not BACKTEST (can only forward test)

TRICK(possible)
using DLL it possible can BACKTEST AI.
because backtest mode can not use the web requests function
Yes, it is limited of MT4 and MT5
backtest mode still can using DLL.
try to testing I don't know it works or not, not confirm

for MT4
if MT4 using methods using EA sent data to external AI. for work and get responses to the result
this way still can work on MT4

(don't using MT4 backtest, try using EA save TICK to run on backtesting and save tick from backtesting to see the result you will know, Why not using MT4)


Solution AI for trade forex
1. Pure Python AI. + API from broker directly (OANDA,FXCM,fix-api)
2. Pure Python AI. + FIX API from Ctrader
3. Pure Python AI. + MetaTrader for Python + Open MT5
note minimum Python AI = python + Keras + TensorFlow
4. Python AI. + EA. MT4
5. Python AI. + EA. MT5 by web request service submit
6. Python AI. + EA. MT5 by DLL communication. (backtest)
7. Python AI. + EA. MT5 by socket named pips communication.
(R. Language AI. is fine but Python is easy to develop and work better, R is good but limited people to know you will alone and trouble with have a problem to solve, python has many friends to consult to fix the problem)

Solution Cloud AI.
1. make an EA. AI. to work with Google Cloud AutoML Tables
2. make EA. AI. to work with Azure AutoML automatedml
3. make EA. AI. to work with Amazon SageMaker Autopilot

for seller
you need to sell Python AI. with source code

Python is open code not good for protecting code
and make python to exe is not work well
open-source code is better.

for user
you need to have a high-end graphics card
recommend only buy NVIDIA for now
don't buy AMD GPU but buy AMD CPU
AMD CPU work for AI better than Intel CPU
use AI with GPU will be work faster GBP
you need to invest in hardware for AI. fast work
 
Back
Top