+ Reply to Thread
Results 1 to 2 of 2

Thread: Simulation of technical analysis indicators

  1. #1
    Points: 5, Level: 1
    Level completed: 9%, Points required for next Level: 45

    Posts
    1
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Simulation of technical analysis indicators




    Hello!
    I have to test effectiveness of technical analysis indicators. Major problem is that I don't know how to correctly use output of arima.sim. I did sequantially: In order to conduct this study I created ARIMA model based on real data:
    Code: 
        data <-read.csv(file="enea.csv", header=TRUE, sep=";",dec=".")
        dates = as.POSIXct(strptime(dane[,1], format="%Y-%m-%d"))
        closnigPrice= xts(dane[,c(5)], order.by = dates)
        model <- auto.arima(closingPrice, stepwise=FALSE,approx=FALSE)
        model
        Acf(model$residuals)
    Next I need to generate data based on the coefficient of this model (created above):

    Code: 
     fit <- arima.sim(model=as.list(coef(model)), n=1249)
        fit
    arima.sim return values such as:

    Code: 
        [1]  0.847159832 -0.013145894 -0.693873961 -0.369817368  0.159847319 -1.205464018  0.726248204
           [8] -1.053571191  1.119042946  1.002395435 -0.388118449 -0.438277787  0.550959984  1.257593875
          [15] -0.781547747 -1.419707655  1.395393362  0.950545042 -0.382795625 -1.808498408  0.712247879
          [22] -0.346448159  0.431701619 -0.111542058 -0.074330765  1.344385279 -1.448159915  0.361477760
    What should I do next? I used function diffinv to reverse differencing (closing price are non-stationary time series so I had to use differencing).

    Code: 
    fit <- diffinv(fit)
    result:

    Code: 
    0.847159832 -0.013145894 -0.693873961 -0.369817368  0.159847319 -1.205464018  0.726248204
           [8] -1.053571191  1.119042946  1.002395435 -0.388118449 -0.438277787  0.550959984  1.257593875
    But I still have negative(and small) values, So I did:

    Code: 
    fit <- fit+100
    Please tell me, Is this a good way? In next step I need to use technical analysis on this simulated data to check how big is the profits thanks to using indicators.

  2. #2
    Points: 8,120, Level: 60
    Level completed: 85%, Points required for next Level: 30

    Posts
    169
    Thanks
    1
    Thanked 7 Times in 7 Posts

    Re: Simulation of technical analysis indicators


    You do not present much data.

    So I cannot make sure.

    But I guess, you should use diff() before building your ARIMA model.

    Consuli
    Prediction is very difficult, especially about the future. (Niels Bohr)

+ Reply to Thread

           




Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts






Advertise on Talk Stats