Rss & SiteMap

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

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

标题:关于enterprice

1楼
leonxu 发表于:2012/11/15 10:44:40
variable:pp=0;
持仓价:pp,LINETHICK0;
交易。。。。
pp:=enterprice;
结果老是显示持仓价为0?
为什么会这样?
改成 if islastbar then pp:=enterprice;
也不行
2楼
jinzhe 发表于:2012/11/15 11:23:10
没有开仓语句?
3楼
leonxu 发表于:2012/11/15 11:28:55

开仓语句不都是正常的吗

4楼
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

5楼
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

6楼
leonxu 发表于:2012/11/15 12:04:52
直接用阿火的程序加了这几句
共6 条记录, 每页显示 10 条, 页签: [1]


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