The Ultimate AI EA Project - page 6

 

<Deleted>

 
Rogério Santana #:

Hello


I do have some libraries I've developed myself. The most interesting things  I have related to AI are a Convolutional Neural Networks (which I'm using for 1D convolution of timeseries) and a Generic Q Learning Algorithm for reinforcement learning (which can be used coupled with neural networks or any function that is an approximation of a q-table) both in programmed in mql5.  I do have a git repository with all that content.

About "Shared projects", I personally love to use git in order to track my personal AI project.

If you guys have any interest, let me know.

how is  your project going so far i am interested in sharing ideas

 
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

 
Joseph Scott Little #:

I have found some factor(s) that have often caused me trouble and caused me to lose a few trades to the point where I had to call the broker to find out why I lost instead of winning.


1. Spread:  You cannot see nor test for this when back-testing.  This has caused havoc on many trade ideas I am sure.  They use this to prevent perfect entry on tops and bottoms as well as to pop Stop Loss without it showing on the chart.  We only see the Bid price, not the ASK price.  I plan to change that with you guys help.  I have an indicator that stores the ASK price data as a csv file in the MT4 platform files section.  I will attach it below.  I am getting it modified because I think there is a problem with the code but I will also attach how it is supposed to work if someone wants to fix it.


2. Price Manipulation:  I often see that most (if not all) indicators are based on the Bid price.  I see the charts on the Forex charts as a canvas the Bank Movers use to get retail traders like ourselves to place our trades in certain directions, at certain times, and in at a certain price zone.  They tend to move price in a way that gets entry/exit signals to trigger on most indicators on any given day.  They then proceed to stop hunt and trap traders as described above.

<ex4 file deleted>

1. You can use spread when backtesting. "...without it showing on chart" You can show the bid and ask lines directly on the chart. Go to Charts/Properties/ check the box "show ask price line". A chart by default usually draws price bars based on the bid price but you can create custom charts that do whatever you want.

2. Most indicators are based on the Bid price but they don't have to be. You can build a custom indicator and use either bid or ask prices or any source of data you want. 

 
Is the project still running? I would like to participate
 

Neural Networks in Trading: A Multi-Agent Self-Adaptive Model (Final Part)

Neural Networks in Trading: A Multi-Agent Self-Adaptive Model (Final Part)

In the previous article, we we introduced the MASA framework — a multi-agent system built on a unique integration of interacting agents. Within the MASA architecture, the RL agent, based on reinforcement learning (RL), optimizes the overall return of an investment portfolio. At the same time, an alternative algorithm-based agent attempts to optimize the portfolio proposed by the RL agent, focusing on minimizing potential risks.
Neural Networks in Trading: A Multi-Agent Self-Adaptive Model (MASA)
Neural Networks in Trading: A Multi-Agent Self-Adaptive Model (MASA)
  • 2025.08.26
  • www.mql5.com
I invite you to get acquainted with the Multi-Agent Self-Adaptive (MASA) framework, which combines reinforcement learning and adaptive strategies, providing a harmonious balance between profitability and risk management in turbulent market conditions.
 

Neural Networks in Trading: Models Using Wavelet Transform and Multi-Task Attention

Neural Networks in Trading: Models Using Wavelet Transform and Multi-Task Attention

Today, we introduce the Multitask-Stockformer framework, presented in the paper "Stockformer: A Price-Volume Factor Stock Selection Model Based on Wavelet Transform and Multi-Task Self-Attention Networks". Despite the similarity in name to the previously discussed StockFormer framework, these two models are unrelated - except for their shared objective: generating a profitable stock portfolio for trading in financial markets.
Neural Networks in Trading: Models Using Wavelet Transform and Multi-Task Attention
Neural Networks in Trading: Models Using Wavelet Transform and Multi-Task Attention
  • 2025.10.07
  • www.mql5.com
We invite you to explore a framework that combines wavelet transforms and a multi-task self-attention model, aimed at improving the responsiveness and accuracy of forecasting in volatile market conditions. The wavelet transform allows asset returns to be decomposed into high and low frequencies, carefully capturing long-term market trends and short-term fluctuations.