Taking Neural Networks to the next level - page 34

 

Forum on trading, automated trading systems and testing trading strategies

Neural Networks

Sergey Golubev, 2022.08.12 12:06

Data Science and Machine Learning — Neural Network (Part 01): Feed Forward Neural Network demystified

Data Science and Machine Learning — Neural Network (Part 01): Feed Forward Neural Network demystified

Neural networks sound like this fancy new thing that seems as a way forward to build holy grails trading systems, many traders are stunned by the programs made of neural networks, as they seem to be good at predicting market movements basically, they are good at any task at hand.

In this article, we are going to see the basics of a neural network and answer some of the basic questions that I think are important for an ML enthusiast to understand for them to master this subject.

 
Indanguang Samrow Panmei #:
is there profitable NN EA? if so its the end of markets and so unlikely to exist

There are profitable NN's here already in the EA market.  But they just scratch the surface of what is coming.  Google already has created what one of their engineers said is a sentient AI program.  I've listened to a conversation with the AI and it is much smarter than the average human and has an unlimited knowledge base through the Internet.  Google promptly fired the engineer who disclosed their progress.

I haven't done any programming in decades.  But there are some talented programmers here on mql5.com.  I've purchased several EA's here that are making me money and I'll monitor developments in the market here for even more intelligent products that make money in the exchange markets or can even be applied to the stock markets.

I'm counting on the young programmers here to work hard and keep learning at the edge of computer science to create new and innovative ways to make money in the markets.  We can all benefit from their hard work.

 

Forum on trading, automated trading systems and testing trading strategies

Neural Networks

Sergey Golubev, 2022.08.24 16:43

Data Science and Machine Learning — Neural Network (Part 02): Feed forward NN Architectures Design 

In the prior article, we discussed the basics of a neural network and build a very basic and static MLP, but we know in real-life applications we are not going to need a simple 2 inputs and 2 hidden layers nodes in the network to the output, something we built last time.
My point is that we need something dynamic. A dynamic code that we can change the parameters and optimize without breaking the program. If you use python-keras library to build a neural network you will have to do less work of configuring and compiling even complex architectures, that is something that I want us to be able to achieve in MQL5.

Just like I did on the Linear regression part 3 which is one among the must-read in this article series, I introduced the matrix/vector form of models to be able to have flexible models with an unlimited number of inputs.

-------------------

 
There is one thread in Russian forum where the users are talking about it, and it is 2,739 pages on the thread for now (yes, the thread is very popular one).


I am not fully understand about what they are talking about ... something related to this page:
https://cs.stanford.edu/people/karpathy/convnetjs/demo/rldemo.html

..and something about the following ("machine translation" from Russian):

Forum on trading, automated trading systems and testing trading strategies

Machine learning in trading: theory, models, practice and algorithmic trading

mytarmailS , 2022.09.07 07:24

It makes no sense to look at the old model, it does not capture market changes.

I propose to implement as suggested)))
In the sliding window, retrain the model and look at the importance of the features, or simply take some kind of good feature determinant and look at it in the sc. window


Here is an example on a randomly generated sample of 5 features and 1 binary target

for forest and feature selector

X <- matrix (rnorm( 1000 ),ncol = 5 )
Y <- as .factor(sample( 0 : 1 ,nrow(X),replace = T))

head(X)
head(Y)

#install.packages( "randomForest" )
library (randomForest)
rf_imp_mat <- matrix (ncol = ncol(X),nrow = nrow(X))
for (i in 30 :nrow(X)){
  ii <- (i- 29 ):i
  rf <- randomForest(Y[ii]~.,X[ii,],ntree= 100 )
  rf_imp_mat[i,] <- importance(rf)[, 1 ]
}

#install.packages( "FSelectorRcpp" )
library (FSelectorRcpp)
fs_imp_mat <- matrix (ncol = ncol(X),nrow = nrow(X))
for (i in 30 :nrow(X)){
  ii <- (i- 29 ):i
  infg <- information_gain(y = Y[ii],x = as .data.frame(X[ii,]))
  fs_imp_mat[i,] <-  infg$importance
}

par(mfrow=c( 1 , 2 ))
matplot(rf_imp_mat , t= "l" ,lty= 1 ,main= "rf_var_imp" )
matplot(fs_imp_mat , t= "l" ,lty= 1 ,main= "fs_var_imp" )


In R, of course, it is not customary to write in cycles if it is not necessary, but this style confuses beginners, and middle peasants, like me, also confuses ..

but you can write short and so, the code is 3 times less, the result is the same

X <- matrix (rnorm( 1000 ),ncol = 5 )
Y <- as .factor(sample( 0 : 1 ,nrow(X),replace = T))
idx <- embed( 1 :nrow(X),dimension = 30 )[, 30 : 1 ]

library (randomForest)
rf_imp_mat <- t(apply(idx, 1 ,function(i) importance(randomForest(Y[i]~.,X[i,]))[, 1 ]))
library (FSelectorRcpp)
fs_imp_mat <- t(apply(idx,1,function(i) information_gain(y=Y[i],x=as.data.frame(X[i,]))$importance))

par(mfrow=c( 1 , 2 ))
matplot(rf_imp_mat , t= "l" ,lty= 1 ,main= "rf_var_imp" )
matplot(fs_imp_mat , t= "l" ,lty= 1 ,main= "fs_var_imp" )


Also , different feature selectors for every taste, probably 5% of what is in R-ke

 
Jean Francois Le Bas #:

yes they are but you don't trade them as reversals in the Chaos Trading System

https://www.youtube.com/watch?v=bNxt298VVOw

i have shared this with my group of traders thank you so much 

 

Experiments with neural networks (Part 2): Smart neural network optimization

Experiments with neural networks (Part 2): Smart neural network optimization

The main objective of this article is the development of a full-fledged trading robot based on a neural network and using MetaTrader 5 without third-party software.
Experiments with neural networks (Part 2): Smart neural network optimization
Experiments with neural networks (Part 2): Smart neural network optimization
  • www.mql5.com
In this article, I will use experimentation and non-standard approaches to develop a profitable trading system and check whether neural networks can be of any help for traders. MetaTrader 5 as a self-sufficient tool for using neural networks in trading.
 

Forum on trading, automated trading systems and testing trading strategies

Better NN EA development

Sergey Golubev, 2023.09.19 13:14

Neural networks made easy (Part 37): Sparse Attention 

Neural networks made easy (Part 37): Sparse Attention

In the previous article, we discussed relational models which use attention mechanisms in their architecture. We used this model to create an Expert Advisor, and the resulting EA showed good results. However, we noticed that the model's learning rate was lower compared to our earlier experiments. This is due to the fact that the transformer block used in the model is a rather complex architectural solution performing a large number of operations. The number of these operations grows in a quadratic progression as the size of the analyzed sequence increases, leading to an increase in memory consumption and model training time.

However, we recognize the limited resources available to improve the model. Therefore, there is a need to optimize the model with minimal loss of quality.

 
Sergey Golubev #:

Experiments with neural networks (Part 2): Smart neural network optimization

The main objective of this article is the development of a full-fledged trading robot based on a neural network and using MetaTrader 5 without third-party software.
This is a really silly equity curve. A 37 dollar gain after 10 months?
 
phade #:
This is a really silly equity curve. A 37 dollar gain after 10 months?
I think - it is just an example.
Anyway, you can speak with the author of this article on the discussion thread here: https://www.mql5.com/en/forum/434069

By the way, he (the autor of this article) is having good thread on Russian forum:
Pairs trading and multicurrency arbitrage with several EAs and indicators uploaded on the main post of the thread by source codes.
Discussion of article "Experiments with neural networks (Part 2): Smart neural network optimization"
Discussion of article "Experiments with neural networks (Part 2): Smart neural network optimization"
  • 2022.10.05
  • www.mql5.com
New article Experiments with neural networks (Part 2): Smart neural network optimization has been published: Author: Roman Poshtar...
 
Sergey Golubev #:
I think - it is just an example.
Anyway, you can speak with the author of this article on the discussion thread here: https://www.mql5.com/en/forum/434069

By the way, he (the autor of this article) is having good thread on Russian forum:
Pairs trading and multicurrency arbitrage with several EAs and indicators uploaded on the main post of the thread by source codes.
Alright 👍 
Reason: