一支股票 我想第一天开盘9:30-10:00 如果涨幅>=5% ,买入 ;第二天开盘9:30就市价,卖出.(但是如果开盘就涨停,不卖)
应该怎么写,谢谢!
//1分钟周期 仅供参考
思路就是按照你给的写的,在9点30到10点之间(收盘价-当日开盘价)/收盘价>0.05 就买入
variable:oo:=o;
variable:date1:=0;
if date1=0 and time>=093000 and time<=100000 then
begin
if date<>ref(date,1) then oo:=o;
cond:(c-oo)/oo>0.05;
if cond then
begin
buy(1,1,market);
date1:=date;
end
end
cond1:c/ref(c,1)>1.1;
if DATEDIFF(date1 ,date )=1 and cond1=0 then
begin
sell(1,1,market);
date1:=0;
end