以文本方式查看主题 - 金字塔客服中心 - 专业程序化交易软件提供商 (http://222.73.7.161/bbs/index.asp) -- 公式模型编写问题提交 (http://222.73.7.161/bbs/list.asp?boardid=4) ---- [原创]将K线插入数据库 (http://222.73.7.161/bbs/dispbbs.asp?boardid=4&id=4448) |
-- 作者:z7c9 -- 发布时间:2010/12/15 22:03:33 -- [原创]将K线插入数据库 阅读版: 以下内容为程序代码:
1 runmode:0; 2 3 database(\'provider=microsoft.jet.oledb.4.0;data source=d:\\dbdemo\\test.mdb\'); 4 5 if barpos=1 then begin 6 sql1:=\'create table \'+marketlabel+\'\'+stklabel+\'(stockdate date,stockopen number,stockhigh number,stocklow number,stockclose number)\'; 7 dbexecute(sql1); 8 end else begin 9 sql2:=\'insert into \'+marketlabel+\'\'+stklabel+\'(stockdate,stockopen,stockhigh,stocklow,stockclose) values("\'+numtostr(year,0)+\'/\'+numtostr(month,0)+\'/\'+numtostr(day,0)+\'",\'+numtostr(open,0)+\',\'+numtostr(high,0)+\',\'+numtostr(low,0)+\',\'+numtostr(close,0)+\')\'; 10 dbexecute(sql2); 11 end; 12
拷贝版: runmode:0;
database(\'provider=microsoft.jet.oledb.4.0;data source=d:\\dbdemo\\test.mdb\'); if barpos=1 then begin sql1:=\'create table \'+marketlabel+\'\'+stklabel+\'(stockdate date,stockopen number,stockhigh number,stocklow number,stockclose number)\'; dbexecute(sql1); end else begin sql2:=\'insert into \'+marketlabel+\'\'+stklabel+\'(stockdate,stockopen,stockhigh,stocklow,stockclose) values("\'+numtostr(year,0)+\'/\'+numtostr(month,0)+\'/\'+numtostr(day,0)+\'",\'+numtostr(open,0)+\',\'+numtostr(high,0)+\',\'+numtostr(low,0)+\',\'+numtostr(close,0)+\')\'; dbexecute(sql2); end;
[此贴子已经被作者于2010-12-15 22:25:25编辑过]
|
-- 作者:guotx2010 -- 发布时间:2011/1/9 1:08:20 -- 这个东西不错,我已经使用到我的公式中了 |