Rss & SiteMap

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

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

标题:关于TORDERPRICE

1楼
leonxu 发表于:2015/3/31 16:28:34
为了控制不要在同价连续下单,用了这样一个控制,即比如,不连续同价平仓,

if tbuyholding(1)>0 then begin
if TISPRVREMAIN(2)=1 and TORDERPRICE(2,1)=TE then bc:=1;
if bc=0 then tsell(nTE-close>m,1,lmt,TE); 
bc:=1
end

但还是总是连续平到tbuyholding(1)=0为止,不知问题在哪
2楼
jinzhe 发表于:2015/3/31 16:35:24
请问从哪里能够体现平仓之后留仓的?
3楼
leonxu 发表于:2015/3/31 16:44:44
整节程序如此
if (CS>CS1 or (nTE<=nTE1-0.4)) then begin//排名下降,下跌一个区间//nBE改成nTE
bc:=if(TISPRVREMAIN(2)=1 and TORDERPRICE(2,1)=TE,1,0);
so:=if(TISPRVREMAIN(3)=1 and TORDERPRICE(3,1)=TE,1,0);
if tholding2<e then begin
if tholding2>-e  then begin
if tholding2<=0 then begin
if tbuyholding(1)>0 then begin
if bc=0 then tsell(nTE-close>m,1,lmt,TE);
bc:=1;so:=1;
end
if tbuyholding(1)=0 then begin
if so=0 then tbuyshort(nTE-close>m,1,lmt,TE);
so:=1;bc:=1;
end
end
if tholding2=1 then begin
if tbuyholding(1)>1 then begin
if bc=0 then tsell(nTE-close>m,2,lmt,TE);
bc:=1;so:=1;
end
if tbuyholding(1)=1 then begin
if bc=0 then tsell(nTE-close>m,1,lmt,TE);
bc:=1;
if so=0 then tbuyshort(nTE-close>m,1,lmt,TE);
so:=1;
end
if tbuyholding(1)=0 then begin
if so=0 and bc=0 then tbuyshort(nTE-close>m,2,lmt,TE);
bc:=1;so:=1;
end
end
if tholding2>1 then begin
if tbuyholding(1)>=2 then begin
if bc=0 then tsell(nTE-close>m,2,lmt,TE);
bc:=1;
if so=0 then tbuyshort(nTE-close>m,1,lmt,TE);
so:=1;
end
if tbuyholding(1)=1 then begin
if bc=0 then tsell(nTE-close>m,1,lmt,TE);
bc:=1;
if so=0 then tbuyshort(nTE-close>m,1,lmt,TE);
so:=1;
end
if tbuyholding(1)=0 then begin
if bc=0 and so=0 then tbuyshort(nTE-close>m,2,lmt,TE);
bc:=1;so:=1;
end
end
end
if tholding2<=-e then begin//极限再平多开空
if ERSI1<=32 then so:=1;
if bc=0 and ERSI1>32 and tbuyholding(1)>1 then begin
tsell(nTE-close>m,2,lmt,TE);
bc:=1;
end
if bc=0 and ERSI1>32 and tbuyholding(1)=1 then begin
tsell(nTE-close>m,1,lmt,TE);
bc:=1;
end
if so=0 and ERSI1ms>32 then begin
tbuyshort(nTE-close>m,1,lmt,TE);
so:=1;
end
end
end
if tholding2>=e and taccount(4)<0 and ERSI1>-32 and down=1 then begin
if bc=0 and tbuyholding(1)>2 then begin
tsell(nTE-close>m,3,lmt,TE);
bc:=1;
so:=1;
end
if bc=0 and tbuyholding(1)>1 then begin
tsell(nTE-close>m,2,lmt,TE);
bc:=1;
end
if bc=0 and tbuyholding(1)=1 then begin
tsell(nTE-close>m,1,lmt,TE);
bc:=1;
end
if so=0 then begin
tbuyshort(nTE-close>m,1,lmt,TE);
tbuyshort(nTE-close>m,1,lmt,TE);
tbuyshort(nTE-close>m,1,lmt,TE);
so:=1;
end
end
end
4楼
leonxu 发表于:2015/3/31 16:46:45
什么留仓?

5楼
jinzhe 发表于:2015/3/31 17:20:16

以私信发代码调试

[此贴子已经被作者于2015/3/31 17:20:29编辑过]
共5 条记录, 每页显示 10 条, 页签: [1]


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