Rss & SiteMap

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

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

标题:请教怎么实现每小姐达到盈利目标该小节就不再交易

1楼
a383623133 发表于:2017/2/20 11:17:53
举个例子:上午盈利达到1000块的话,上午就不再开仓,下午才能允许开仓
2楼
jinzhe 发表于:2017/2/20 11:26:02

做个标记

variable:bj=0;

variable:yl=0;

开仓条件加入bj=0

 

if 平多条件  and holding>0 then begin

   sell(1,0,marketr);

   yl:=yl+numprofit(1);

   if yl>=1000 then bj:=1;

end

 

if 平空条件  and holding<0 then begin

   sellshort(1,0,marketr);

   yl:=yl+numprofit(1);

   if yl>=1000 then bj:=1;

end

 

if time=closetime(1) then bj:=0;

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

 

 

 

   

    

3楼
a383623133 发表于:2017/2/20 12:28:38
后台程序化的怎么编写?
4楼
jinzhe 发表于:2017/2/20 13:18:58

globalvariable:bj=0;

globalvariable:yl=0;

开仓条件加入bj=0

 

if 平多条件  and tholding>0 then begin

   tsell(1,0,mkt);

   yl:=yl+numprofit(1);

   if yl>=1000 then bj:=1;

end

 

if 平空条件  and tholding<0 then begin

   tsellshort(1,0,mkt);

   yl:=yl+numprofit(1);

   if yl>=1000 then bj:=1;

end

 

if time=closetime(1) then bj:=0;

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

 

这样用要走完k线下单,不然会重复累加的迭代

5楼
a383623133 发表于:2017/2/20 14:18:26
用间隔1秒模式不行吗?
6楼
jinzhe 发表于:2017/2/20 14:28:18
后台的全局变量和图表的不一样,弄不好就是在同根k线上反复的自我迭代累加,所以用走完k线下单比较好
共6 条记录, 每页显示 10 条, 页签: [1]


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