以文本方式查看主题

-  金字塔客服中心 - 专业程序化交易软件提供商  (http://weistock.com/bbs/index.asp)
--  公式模型编写问题提交  (http://weistock.com/bbs/list.asp?boardid=4)
----  关于enterprice  (http://weistock.com/bbs/dispbbs.asp?boardid=4&id=30660)

--  作者:leonxu
--  发布时间:2012/11/15 10:44:40
--  DBVALUE引用错误的问题~
variable:pp=0;
持仓价:pp,LINETHICK0;
交易。。。。
pp:=enterprice;
结果老是显示持仓价为0?
为什么会这样?
改成 if islastbar then pp:=enterprice;
也不行

--  作者:jinzhe
--  发布时间:2012/11/15 11:23:10
--  
没有开仓语句?
--  作者:leonxu
--  发布时间:2012/11/15 11:28:55
--  

开仓语句不都是正常的吗


--  作者:leonxu
--  发布时间:2012/11/15 11:30:52
--  

if holding>0 and (sellcond or exittime) then begin
 sell(1,0,market);
 cc:=0;
end
 
if holding<0 and (sellshortcond or exittime) then begin
 sellshort(1,0,market);
 cc:=0;
end

if holding=0 and entertime and buyshortcond then begin
 buyshort(acc or tsellholding(1)>0,1,market);
 if islastbar then extgbdataset(\'isbook\',0);
 cc:=-1;
 maxprofit:=0;
end

if holding=0 and entertime and buycond then begin
 buy(acc or tbuyholding(1)>0,1,market);
 if islastbar then extgbdataset(\'isbook\',0);
 cc:=1;
 maxprofit:=0;
end

if not(islastbar and workmode=3) then exit;

if tholding2=0 and cc>0 and extgbdata(\'isbook\')=0 then begin
 buy(1,1,market);
 if islastbar then pp:=enterprice;
 extgbdataset(\'isbook\',1);
end

if tholding2=0 and cc<0 and extgbdata(\'isbook\')=0 then begin
 buyshort(1,1,market);
 if islastbar then pp:=enterprice;
 extgbdataset(\'isbook\',1);
end


--  作者:leonxu
--  发布时间:2012/11/15 12:04:38
--  

持仓:holding,LINETHICK0;
variable:cc=0;
runmode:0;
entertime:=time<closetime(0) and time>opentime(1)+100;
exittime:=time>=closetime(0);
buycond:=ref(count(c>o,2)=2,1);
sellcond:=ref(count(c<o,2)=2,1);
acc:=not(islastbar);
if holding>0 and (sellcond or exittime) then begin
 sell(1,5,limitr,o);
 cc:=0;
end

if holding<0 and (buycond or exittime) then begin
 sellshort(1,5,limitr,o);
 cc:=0;
end

if holding=0 and entertime and buycond then begin
 buy(acc or tbuyholding(1)>0,5,limitr,o);
 if islastbar then extgbdataset(\'isbook\',0);
 cc:=5;
end

if holding=0 and entertime and sellcond then begin
 buyshort(acc or tsellholding(1)>0,5,limitr,o);
 if islastbar then extgbdataset(\'isbook\',0);
 cc:=-5;
end

if not(islastbar and workmode=3) then exit;

if tholding2=0 and cc>0 and extgbdata(\'isbook\')=0 then begin
 buy(1,5,limitr,o);
  if islastbar then pp:=enterprice;
 extgbdataset(\'isbook\',1);
end

if tholding2=0 and cc<0 and extgbdata(\'isbook\')=0 then begin
 buyshort(1,5,limitr,o);
  if islastbar then pp:=enterprice;
 extgbdataset(\'isbook\',1);
end


--  作者:leonxu
--  发布时间:2012/11/15 12:04:52
--  
直接用阿火的程序加了这几句