Rss & SiteMap

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

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

标题:[求助]连亏之后限损

1楼
skylands 发表于:2013/12/2 12:33:19

求教如何表达:

日内连亏N次之后,平仓离场,当日不再交易;次日重新遵循原系统开始。


 

2楼
jinzhe 发表于:2013/12/2 13:15:48

varaible:n=0;

if  numprofit(1)<0 and numprofit(2)<0 and ref(平多条件,1) and ref(holding>0,1) and holding<=0  then begin

   n:=N+1;

end

 

if  numprofit(1)<0 and numprofit(2)<0 and ref(平空条件,1) and ref(holding<0,1) and holding>=0  then begin

   n:=N+1;

end

 

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

if n>=既定的连亏次数 then exit;

 

3楼
skylands 发表于:2013/12/2 14:07:38
我好好消化一下,多谢先……
4楼
skylands 发表于:2013/12/2 14:29:29
能不能请你用文字解释一下……那么多个and连接起来后我有点云山雾绕的……资质愚钝,拜托!
5楼
yang507035 发表于:2013/12/2 14:31:50
用户已锁定!
6楼
jinzhe 发表于:2013/12/2 14:32:26

if  numprofit(1)<0 and numprofit(2)<0 and ref(平多条件,1) and ref(holding>0,1) and holding<=0  then begin

 

 

numprofit(1)<0 and numprofit(2)<0判断连亏

ref(平多条件,1) and ref(holding>0,1) and holding<=0判断上根k线是否平仓

 

 

连亏+平仓,都满足之后,才能记录连亏的次数

 

 

7楼
skylands 发表于:2013/12/2 15:21:26
5楼仁兄能否详细解释一下你的解决方案……好像你这里numprofit并不能看出是盈是亏的判断?
8楼
jinzhe 发表于:2013/12/2 15:23:54

 

[此贴子已经被作者于2013/12/2 15:24:25编辑过]
9楼
skylands 发表于:2013/12/2 15:25:38
jinzhe: 我是要将其嵌入一个“平仓即反手”的系统中的。你这里关于仓位判断的部分要怎么改?
10楼
jinzhe 发表于:2013/12/2 15:27:35
写在你的那个系统后面
共19 条记录, 每页显示 10 条, 页签: [1] [2]


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