以文本方式查看主题

-  金字塔客服中心 - 专业程序化交易软件提供商  (http://weistock.com/bbs/index.asp)
--  公式模型编写问题提交  (http://weistock.com/bbs/list.asp?boardid=4)
----  股票第一买入第二天卖出模型请教  (http://weistock.com/bbs/dispbbs.asp?boardid=4&id=12301)

--  作者:Hongzhou
--  发布时间:2012/6/8 10:44:38
--  股票第一买入第二天卖出模型请教

一支股票 我想第一天开盘9:30-10:00 如果涨幅>=5% ,买入  ;第二天开盘9:30就市价,卖出.(但是如果开盘就涨停,不卖)

 

应该怎么写,谢谢!


--  作者:rushtaotao
--  发布时间:2012/6/8 10:49:16
--  
正在处理
--  作者:rushtaotao
--  发布时间:2012/6/8 12:36:49
--  

//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

[此贴子已经被作者于2012-6-8 12:45:09编辑过]