useDynLib(fts)

importFrom("grDevices", "xy.coords")
importFrom("graphics", "plot", "plot.xy")
importFrom("stats", "cor", "lag")
importFrom("utils", "read.csv", "write.csv")

importFrom(zoo,coredata)
importFrom(zoo, index)
importFrom(zoo,'index<-')
importFrom(zoo,'time<-')

export(
       fts,
       as.fts,
       as.fts.default,
       as.fts.data.frame,
       as.fts.zoo,
       as.matrix.fts,
       template.fts,
       Ops.fts,
       "[.fts",
       "[<-.fts",
       as.data.frame.fts,
       cbind.fts,
       rbind.fts,
       pad,
       trim,
       read.csv.fts,
       write.csv.fts,
       print.fts,

       to.yearly,
       to.quarterly,
       to.monthly,
       to.weekly,
       to.daily,
       to.hourly,
       to.minute,
       to.second,
       to.day.of.week,

       moving.mean,
       moving.sum,
       moving.product,
       moving.max,
       moving.min,
       moving.rank,
       moving.sd,
       expanding.max,
       expanding.min,
       moving.cor,
       moving.cov,
       since.na,
       lead,
       lead.fts,
       lag.fts,
       diff.fts,
       fill.fwd,
       fill.bwd,
       fill.value,
       monthly.sum,

       plot.fts,

       event.dates,
       intersect.all,

       remove.na.rows,
       remove.all.na.rows,
       row.apply,
       row.any,
       row.all,
       column.apply,
       col.any,
       col.all,
       filter.min.obs,

       ## technical analysis
       ema,
       rsi,
       year,
       month,
       mday,
       wday,
       ma.crossover.up,
       ma.crossover.down,
       lower.low,
       higher.high,
       repeated,
       new.low,
       new.high,
       above.ma,
       below.ma,
       ma.d,
       higher.low,
       lower.high,
       up,
       down,
       pct.chg,
       inside.day,
       inside.day.up,
       inside.day.down,
       inside.day.direction,
       ma.crossover.up,
       ma.crossover.down,
       ma.crossover,
       outside.day,
       outside.day.up,
       outside.day.down,
       outside.day.direction,
       hl.oc.ratio,
       gap.up,
       gap.down,
       gap.up.continue,
       gap.down.continue,
       gap.continue,
       gap.up.reverse,
       gap.down.reverse,
       gap.reverse,
       gap.direction,
       rsi.crossover.up,
       rsi.crossover.down,
       rsi.crossover,
       ma.distance,
       trend.day,
       trend.day.up,
       trend.day.down,
       cor.by.row
)

S3method("Ops", "fts")
S3method("[", "fts")
S3method("cummax", "fts")
S3method("cummin", "fts")
S3method("cumprod", "fts")
S3method("cumsum", "fts")

S3method("lag", "fts")

S3method("plot", "fts")
S3method("print", "fts")

S3method("[<-", "fts")
S3method("as.data.frame", "fts")
S3method("as.fts", "data.frame")
S3method("as.fts", "default")
S3method("as.fts", "zoo")
S3method("as.matrix", "fts")
S3method("cbind", "fts")
S3method("diff", "fts")
S3method("lead", "fts")
S3method("rbind", "fts")
