Hi

 

I am running the examples of technical analysis.

 

 

### Example: extract indicators

 

 

  # Work with Logarithmic Data:

    H = log(fSpi$high)   # log High

    L = log(fSpi$low)   # log Low

    C = log(fSpi$close)   # log Close

    R = c(0, diff(C, 1))    # log Return

 

 

  # Select a Piece of the Time Series to work in:

    n1 = 1; n2 = 6024

  

    ###

 

    # Responses:

    # Tomorrows returns - Shift One Day Back

    response = c(diff(C), 0) 

    ###

 

   # Predictors: 

    # Calculate  some Selected Indicators:

     apd.TA = apdTA(C,H, L, lag1=12, lag2=26, lag3=9, lag4=20) 

     cdo.TA = cdoTA(C, lag1 = 12, lag2 = 26, lag3 = 9) 

     cds.TA = cdsTA(C, lag1 = 12, lag2 = 26, lag3 = 9) 

     ema.TA = emaTA(C, .5, startup = 0) 

     bias.TA = biasTA(C, 3) 

     fpd.TA = fpdTA(C, H, L, lag1=12, lag2=26) 

     fpk.TA = fpkTA(C, H, L, 12)

     fpk.TA2 = fpkTA(C, H, L, 12) - fpdTA(C, H, L, 12, 3)

     macd.TA = macdTA(C, lag1=12, lag2=26) 

     medprice.TA = medpriceTA(H, L) 

     mom.TA = momTA(C, lag=11) 

     odo.TA = cdoTA(C,11, 26, 9)

     osc.TA = oscTA(C,3,10)

     roc.TA = rocTA(C, lag=11) 

     rsi.TA = rsiTA(C, 6)-rsiTA(C, 12)

     stochastic.TA = stochasticTA(C, H, L, lag1=12, lag2=26, type =
c("fast", "slow")) 

     spd.TA = spdTA(C, H, L, lag1=12, lag2=26, lag3=9) 

     typical.TA = typicalpriceTA(H, L, C) 

     vohl.TA = vohlTA(H, L) 

     vor.TA = vorTA(H, L) 

     wclose.TA = wcloseTA(H, L, C) 

     wpr.TA = wprTA(C, H, L, 5)

     

 

     

 

 

   # Save Responses and Predictors Pattern:

      z = cbind.data.frame(response, apd.TA, cdo.TA, cds.TA,ema.TA, bias.TA,
fpd.TA, fpk.TA, fpk.TA2, macd.TA,medprice.TA, mom.TA, odo.TA, osc.TA,
roc.TA, rsi.TA, stochastic.TA,    spd.TA, typical.TA, vohl.TA,  vor.TA,
wclose.TA, wpr.TA )

      names(z) = c("return", "apdTA", "cdoTA", "cdsTA", "emaTA", "biasTA",
"fpdTA", "fpkTA", "fpkTA2", "macdTA","medpriceTA", "momTA", "odoTA",
"oscTA", "rocTA", "rsiTA", "stochasticTA",    "spdTA", "typicalTA",
"vohlTA",  "vorTA", "wcloseTA", "wprTA" )

      write.table(z,"out.tbl",sep = "\t") 

    ### 

   

 

 

 

I have my own data covering the SPI.  Everything goes fine until I get to
three indicators near the bottom of the list where I get these error
messages:

 

 

 

typical.TA = typicalpriceTA(H, L, C) 

>      vohl.TA = vohlTA(H, L) 

Error in inherits(object, "timeSeries") : object "x" not found

>      vor.TA = vorTA(H, L) 

Error in inherits(object, "timeSeries") : object "x" not found

>      wclose.TA = wcloseTA(H, L, C) 

>   vohl.TA = vohlTA(H, L)

 

 

Can anyone cast some light on this?

 

 

Stephen Choularton

02 9999 2226

0413 545 182

 

 

 


-- 
Internal Virus Database is out-of-date.
Checked by AVG Free Edition.

9:58 PM
 

	[[alternative HTML version deleted]]

