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

 

I wrote an interactive programme on R to be able to add combinations of sinusoids by hand.

maybe someone would like to poke around)))

my.sin <- function(vec,a,f,p)  a*sin(f*vec+p)

library(shiny)
ui <- fluidPage(
  sidebarPanel(
  sliderInput("am1", "amplitude1", -5, 5,value = 1, step = 0.1),
  sliderInput("frq1", "frequency1", 0, 5,value = 0.2, step = 0.005),
  sliderInput("pha1", "phase1", -10, 10,value = 0.2, step = 0.5),
  
  sliderInput("am2", "amplitude2", -5, 5,value = 1, step = 0.1),
  sliderInput("frq2", "frequency2", 0, 5,value = 0.2, step = 0.005),
  sliderInput("pha2", "phase2", -10, 10,value = 0.2, step = 0.5),
  ),
  mainPanel(  plotOutput("plot1") )
)

server <- function(input, output) {
  
  output$plot1 <- renderPlot({
    s1 <- my.sin(vec = 1:100,input$am1,input$frq1,input$pha1)
    s2 <- my.sin(vec = 1:100,input$am2,input$frq2,input$pha2)
    
    par(mar=(c(2,2,2,2)),mfrow=c(2,1))
    matplot(cbind(s1,s2),t="l",col=c(2,4),lty=1)
    plot(s1+s2,t="l")
    })
}
shinyApp(ui, server)
 
 
mytarmailS #:

I wrote an interactive programme in R to add combinations of sinusoids by hand

maybe someone would like to poke around)))

what to do with it

Try these signs

for i in MA_PERIODS:
        pFixed[str(count)] = price - price.rolling(i).mean().apply(np.log) * price.rolling(i).std() * 150
        count += 1

price - logarithm of MA(i) * moving standard deviation(i) * coefficient

i - averaging period

150 is the coefficient, from 50 to 250 try it. The larger the more stationary the series is.

and for several sliding windows with period i (several such signs)
 
Maxim Dmitrievsky #:

and what to do about it.

Well, this is to be able to explain to the machine what you can't explain to yourself....

like how to control the period of an indicator? You can't explain it to yourself, let alone to a machine, but when you see a good control, you'll say "oh, that's it!".

So this control curve can be made from the sum of a sine wave...

Karoch it is to do with your hands target, which you can not explain to yourself, and therefore programmed I found this solution)

Maxim Dmitrievsky #:

try these signs

price - logarithm of MA(i) * moving standard deviation(i) * coefficient

i - averaging period

150 is the coefficient, from 50 to 250 try it. The larger the more stationary the series is.

and for several sliding windows with period i (several such signs).

How did you measure stationarity?

You need to compare it

Maxim Dmitrievsky #:

Oh, this is your favourite ))

yes

 
mytarmailS #:

Well, it's to be able to explain to the car what you can't explain to yourself...

like how to properly control the period of the indicator? You can't explain it to yourself, let alone to the machine, but when you see a good control, you will definitely say "oh, that's it!".

So this control curve can be made from the sum of sine waves...

It's for making target ones that you can't explain to yourself, and therefore you can't programme them. I've found this solution.)

And how did you measure the stats?

You have to compare it.

Yeah.

I measured stationarity by eye. The smaller the coefficient, the more the graph resembles a normal graph, the larger the graph resembles a retourny graph.
 
mytarmailS #:
Conclusion?

Correlation, if it is a correlation, can be used as a measure of the strength of the influencing factors. Force is not a very appropriate term here either, of course. But I can't think of a better one.

 
Maxim Dmitrievsky #:
I measured stationarity by eye. The smaller the coefficient, the more the graph looks like a normal graph, the larger it is, the more it looks like a retourny graph

Is this a sliding window?

If so, how big is it?

 
mytarmailS #:

Is that a sliding window?

If yes, what size is it?

Yes, any size

from 10 to 200.

in increments of 10, you get 20 signs, for example.
 
Maxim Dmitrievsky #:

yes, anyone

from 10 to 200.

in increments of 10, you get 20 signs, for example.


is that what it's supposed to look like?


P[i] - log( mean(P[ii] ) ) * sd( P[ii] )*150

where " P[ii ] " is the last 20 prices

and " P[i] " is the current
 
mytarmailS #:


is that what it's supposed to look like?


P[i] - log( mean(P[ii] ) ) * sd( P[ii] )*150

where " P[ii ] " is the last 20 prices

and " P[i] " is the current price.
Well, it's a regular MA, it looks like. I'm not at my computer now, I'll check it tomorrow. For Eurobucks H1, make it
Reason: