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

 

Should I try to write a bot entirely in ONNX? )

except for trading functions and quote requests.

https://cloudblogs.microsoft.com/opensource/2023/08/01/introducing-onnx-script-authoring-onnx-with-the-ease-of-python/

Introducing ONNX Script: Authoring ONNX with the ease of Python
Introducing ONNX Script: Authoring ONNX with the ease of Python
  • 2023.08.01
  • Aaron Bockover
  • cloudblogs.microsoft.com
ONNX Script is a new open-source library for directly authoring ONNX models in Python with a focus on clean, idiomatic Python syntax and composability through ONNX-native functions.
 

I decided to dilute a little bit the cool MO with a cheesy matstat)
I remembered the statement of a local comrade that "prices turn around on schedule". If this were true, it would affect the correlation of neighbouring increments - at times of reversal it would be negative, and at other times it would be positive. I calculated the correlation. Naturally, we could not see any "scheduled reversal". Below is the graph for the correlation between bars within a day with numbers X and X+1. Typical noise around zero, no patterns. For comparison, below is the chart of intraday volatility - there is noise on it too, but it does not prevent from seeing a clear pattern. Both charts were calculated on EURUSD minutes (for gold the pictures are similar).

correlation

volatility

 
Aleksey Nikolayev #:

I decided to dilute a little bit the cool MO with a cheesy matstat)
I remembered the statement of a local comrade that "prices turn around on schedule". If this were true, it would affect the correlation of neighbouring increments - at times of reversal it would be negative, and at other times it would be positive. I calculated the correlation. Naturally, we could not see any "scheduled reversal". Below is the graph for the correlation between bars within a day with numbers X and X+1. Typical noise around zero, no patterns. For comparison, below is the chart of intraday volatility - there is noise on it too, but it does not prevent from seeing a clear pattern. Both charts were calculated on EURUSD minutes (for gold the pictures are similar).



The chart of volatility within a day shows first of all that there are moments when other calculations turn into a pumpkin. Multiple increases/decreases over a short period of time drive the window functions (correlation, among others) crazy

 
Aleksey Nikolayev #:

Decided to dilute the cool MO a bit with a cheesy matstat)
I remembered a local comrade saying that "prices unfold on schedule".

I should have checked the timetable, if it's not "five minutes to half past five", then only pay attention :)
 
Maxim Kuznetsov #:

The intraday volatility chart shows first of all that there are moments when other calculations turn into a pumpkin. Multiple increases/decreases over a short period of time drive window functions (including correlation) crazy

What does that have to do with it? Correlation is essentially the same as volatility. For example, for X=1 a sample of all increments for the 1st minute was taken and its correlation with a sample of all subsequent increments for the 2nd minute was looked at. And so on for all X<=1440. The window function is organised differently.

Code in R

#  r - датафрейм с двумя столбцами:
#  r$r - последовательность минутных ретурнов, упорядоченная по времени
#  r$n - номер минутного бара в сутках
COR <- rep(0,nb); NBAR <- 1:1440
for (i in NBAR) {
indx <- which(r$n[-length(r$n)]==i)
COR[i] <- cor(r$r[indx],r$r[indx+1], method="pearson")}

plot(NBAR,COR,type="l")
 
Aleksey Nikolayev #:

What does that have to do with it? Correlation was calculated, in fact, the same way as volatility. For example, for X=1, a sample of all increments for the 1st minute was taken and its correlation with a sample of all subsequent increments for the 2nd minute was looked at. And so on for all X<=1440. The window function is organised differently.

Code in R

let's be precise in our wording: the HOOH... was counted. correlation counted as volatility is exactly that. And it's auto :-) auto-NYOH.

a question with no hope for an answer: what did you want to see ?

 
Maxim Dmitrievsky #:
You should have checked the schedule, if it's not "five minutes to five minutes past five", then only pay attention :)
What if there is a grail buried there?) I should have checked)
 

Maxim Kuznetsov #:

What did you want to see?

Obviously the price reversal schedule)

Too bad it turned out not to exist)

 
Well, how else to look for a reversal "on schedule"? If it always occurs immediately after the bar with the number X, then the correlation between the increments of X and X+1 should be negative, while the previous and subsequent ones should be positive. Isn't it obvious?
 
Maxim Dmitrievsky #:

If we don't touch the technical part (the concrete implementation, which is very simple), it is more competent to separate the classes in the feature space, so that the classes overlap less, but the labels remain profitable. Then entropy is reduced. I'll try to do a visualisation later, because it's interesting to see visually what makes it better. Are there any visible differences.

You can just fantasise about any feature space and think how you can distribute labels in it. Then the importance of features decreases, and the importance of markup increases.

All I'm fantasising about is my method - where predictor ranges are essentially zeroed out if a probability bias is detected for the null class, thus avoiding inconsistencies.

What is the point of your method?