Rss & SiteMap

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

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

标题:止赢止损后,不同向开仓

1楼
南宁老农民 发表于:2017/5/31 13:08:41
请教。如果止赢止损之后,不在当天同向开仓。这个怎么编写呢。谢谢
2楼
yukizzc 发表于:2017/5/31 13:10:19

variable:n=0;

if 止盈止损 then

begin

sell();

n:=1;

end

 

if 开仓条件 and n=1 then

begin

buy();

end

 

if time =150000 then n:=0;

3楼
pyd 发表于:2017/5/31 13:16:20

楼上笔误,用这个

variable:n=0;

if 开仓条件 and n=0 then

begin

buy();

end

 

if 止盈止损 then

begin

sell();

n:=1;

end

  

if time =closetime(0) then n:=0;

[此贴子已经被作者于2017/5/31 13:17:38编辑过]
4楼
南宁老农民 发表于:2017/5/31 13:18:59

variable:n=0;

if 多单止盈 then

begin

sell();

n:=1;

end

 

if 空单止盈 then

begin

sellshort();

n:=1;

end



if 多单开仓条件 and n=0 then

begin

buy();

end


f 空单开仓条件 and n=0 then

begin

buyshort();

end


 

if time =150000 then n:=0;

5楼
pyd 发表于:2017/5/31 13:45:20

上边是开多的例子,也有开空的话再加一个变量

variable:n=0,m=0;

if 多单止盈 then

begin

sell();

n:=1;

end

 

if 空单止盈 then

begin

sellshort();

m:=1;

end

 

if 多单开仓条件 and n=0 then

begin

buy();

end

 
if 空单开仓条件 and m=0 then

begin

buyshort();

end

  

if time =closetime(0) then begin
n:=0;
m:=0;
end

共5 条记录, 每页显示 10 条, 页签: [1]


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