Machine learning in trading: theory, models, practice and algo-trading - page 3532

 
Aleksey Vyazmikin #:
Earlier I showed how such quantum segments disappear with each iteration, now I was able to understand the reason and try to control this process.

Here is an example of the first experiments, on the figure the probability of choosing a stable quantum segment at each iteration - separately for each class (I think it is clear by the curve name), where the curve name contains the letter D - the described method was used there - red curve.

In general, we can talk about a positive effect. Yes, it is not significant yet, but there are different variations on the implementation of the process. I am satisfied with the preliminary positive result.

 
Maxim Dmitrievsky #:

I like to remember the long term predictions

So bought bitcoin on a fallen angel?

 
Aleksey Vyazmikin #:

So bought bitcoin on a fallen angel?

On a black swan maybe? ) history is silent.

 
Aleksey Vyazmikin #:

Here is an example of the first experiments, on the figure the probability of choosing a stable quantum segment at each iteration - separately for each class (I think, by the name of the curve it is clear), where in the name of the curve the letter D - there the described method was used - red curve.

In general, we can talk about a positive effect. Yes, it is not significant yet, but there are different variations on the implementation of the process. I am satisfied with the preliminary positive result.

I don't get it again. What do these curves mean? :)

 
Maxim Dmitrievsky #:

Again, I don't get it. What do these curves mean? :)

It's normal.)
 
mytarmailS #:
What is the tacon nb in the code?
Could you please provide a more reproducible code

code in R

r <- read.delim("EURUSD60.txt", sep = " ")
#  nb - число баров данного таймфрейма в сутках
#  передаётся в первой строке файла после заголовка
nb <- r[1,2]
r <- r[-1,]
NBAR <- 1:nb

COR <- rep(0,nb)
for (i in 1:nb) {
indx <- which(r$n[-length(r$n)]==i)
COR[i] <- cor(r$r[indx],r$r[indx+1], method="p")}
plot(NBAR,COR,type="l")

SD <- rep(0,nb)
for (i in 1:nb) SD[i] <- sd(r$r[r$n==i])
plot(NBAR,SD,type="l")

#  интерквартильный размах, как более робастный аналог
#  среднеквадратичного отклонения
IQR <- rep(0,nb)
for (i in 1:nb) IQR[i] <- IQR(r$r[r$n==i])
plot(NBAR,IQR,type="l")
code in mql5 for a script to get increments (log-returns, to be more precise)
//+------------------------------------------------------------------+
#property script_show_inputs
//+------------------------------------------------------------------+
input string smbl = "EURUSD";
input ENUM_TIMEFRAMES prd = PERIOD_M1;
input datetime t0 = D'2023.10.15 00:00';
input datetime t1 = D'2024.03.15 00:00';
//+------------------------------------------------------------------+
int SEC_IN_DAY = 24 * 60 * 60;
//+------------------------------------------------------------------+
void OnStart()
{  MqlRates rates[];
   int nbars = CopyRates(smbl, prd, t0, t1, rates);
   if (nbars < 1)
   {  Print("no history");
      return;
   }
   int tfs = PeriodSeconds(prd);
   string fn = "rtrns\\" + smbl + string(tfs) + ".txt";
   int f = FileOpen(fn, FILE_WRITE | FILE_TXT | FILE_ANSI | FILE_COMMON);
   if (f == INVALID_HANDLE)
   {  Print("File error!");
      return;
   }
   FileWriteString(f, "r n\n0 " + IntegerToString(SEC_IN_DAY / tfs));
   string s;
   for (int i = 0; i < nbars; ++i)
   {  s = "\n" + DoubleToString(log(rates[i].close / rates[i].open));
      s += " " + IntegerToString((rates[i].time % SEC_IN_DAY) / tfs + 1);
      FileWriteString(f, s);
   }
   Print(IntegerToString(nbars) + " bars recorded to file: " + fn);
   FileClose(f);
}
//+------------------------------------------------------------------+
 
Aleksey Nikolayev #:

code in R

code in mql5 for a script to get increments (log-returns, to be more precise)

thanks

 
Aleksey Nikolayev #:

code in R

code in mql5 for a script to get increments (log-returns, to be more precise)

small, nasty, annoying error for schedules, sessions and everything about real time: real number of minute bars per day != 1440 (not always equal)..also for 5 minutes and even for 15 minutes.

it is necessary either to add the missed bars to 1440 or to add the "time" field to the data and calculations.

 
Maxim Dmitrievsky #:
in the figure the probability of choosing a stable quantum segment at each iteration
in the figure the probability of choosing a stable quantum segment at each iteration
 
Aleksey Vyazmikin #:
on the figure the probability of choosing a stable quantum segment at each iteration

What are the iterations? Hardly training additional trees. Some kind of loop of your own. What's it doing?