以文本方式查看主题

-  金字塔客服中心 - 专业程序化交易软件提供商  (http://weistock.com/bbs/index.asp)
--  交易策略发布专区  (http://weistock.com/bbs/list.asp?boardid=10)
----  [原创]基本面量化交易  (http://weistock.com/bbs/dispbbs.asp?boardid=10&id=50226)

--  作者:z7c9
--  发布时间:2013/3/25 17:01:35
--  [原创]基本面量化交易

runmode:1;

account:=\'888888\';

lots:=volunit*10;

pb:=close/finance(34);
roe:=finance(37);

entrylongcond:=pb<3 and roe>8;
exitlongcond:=pb>3 or roe<8;

if tbuyholdingex(account,stklabel,1)=0 then begin
 if entrylongcond then
  tbuy(1,lots,lmt,close,0,account,stklabel); 
end

if tbuyholdingex(account,stklabel,1)>0 then begin
 if exitlongcond then
  tsell(1,lots,lmt,close,0,account,stklabel); 
end