Rss & SiteMap

金字塔客服中心 - 专业程序化交易软件提供商 http://www.weistock.com/bbs/

专业程序化软件提供商
共2 条记录, 每页显示 10 条, 页签: [1]
[浏览完整版]

标题:[原创]将K线插入数据库

1楼
z7c9 发表于:2010/12/15 22:03:33

阅读版:

以下内容为程序代码:

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编辑过]
2楼
guotx2010 发表于:2011/1/9 1:08:20
这个东西不错,我已经使用到我的公式中了
共2 条记录, 每页显示 10 条, 页签: [1]


Powered By Dvbbs Version 8.3.0
Processed in 0.00781 s, 3 queries.