julia笔记

来源:互联网 发布:淘宝卖家怎么改类目 编辑:程序博客网 时间:2024/04/27 09:28

1. 为上层提供一些可以让用户选择的参数,如股票代码,时间参数,预测股票价格类型(开盘收盘最高最低)

include("predict.jl")#example#stockCode ="000001"#startDateTime ="2012-03-01"#endDateTime ="2013-03-01"#predictName = "close"#predict(stockCode,startDateTime,endDateTime,predictName)#examplestockCode ="000002"startDateTime ="2012-03-01"endDateTime ="2013-12-01"predictName = "close"result=predict(stockCode,startDateTime,endDateTime,predictName)println("---------------------------------------")println("Predict Result ----->" * string(result))

using DataFramesusing ODBCusing MATLABfunction predict(stockCode::String, startDateTime::String, endDateTime::String, predictName::String)        co = ODBC.connect("stock",usr="stock",pwd="root")        count = query("select count(*) from day_quotes t where stockcode = " * stockCode * " and datetime >= to_date('"* startDateTime *"','yyyy-MM-dd') and datetime <= to_date('"* endDateTime *"','yyyy-MM-dd')")        dataFrame=query("select " * predictName * " from day_quotes t where stockcode = " * stockCode * " and datetime >= to_date('"* startDateTime *"','yyyy-MM-dd') and datetime <= to_date('"* endDateTime *"','yyyy-MM-dd')",co,"",',', int(count[1][1]))        mx = float(dataFrame[1])        result = mxcall(:esmoothSerie,2,mx,0.6)        return result[1]end


0 0
原创粉丝点击