Rss & SiteMap

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

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

标题:多仓空仓亏损加一起,达5次---则开仓----点写

1楼
lyt369 发表于:2013/4/17 16:37:09
多仓空仓亏损加一起,达5次---则开仓----怎样写
2楼
jinzhe 发表于:2013/4/17 16:38:29
亏损满5次后,在第5次亏损的k线上无条件开仓?
3楼
lyt369 发表于:2013/4/17 16:40:41
ok

4楼
lyt369 发表于:2013/4/17 16:41:25
5楼
lyt369 发表于:2013/4/17 16:42:27
你想想办法实现日内连续亏损5次则开仓----必顺连续亏
6楼
lyt369 发表于:2013/4/17 16:46:01
连续亏损:NUMSEQLOSS; -----这个不行
7楼
every 发表于:2013/4/17 16:48:25

//日内连续亏损5次则不开仓

VARIABLE:ks=0;//连续亏损次数

num:=5;

 

buycond:=ref(count(c>o,2)=2,1);
sellcond:=ref(count(c<o,2)=2,1);

 

if holding>0 and sellcond then
 begin
 sell(1,1,market);
  if c<ENTERPRICE then ks:=ks+1;
  else
  if c>ENTERPRICE then ks:=0;//赢利一次,重新计算亏损次数
 end

 

if holding<0 and buycond then
 begin
 sellshort(1,1,market);
  if c>ENTERPRICE then ks:=ks+1;
  else
  if c<ENTERPRICE then ks:=0;//赢利一次,重新计算亏损次数
 end

 

if buycond and holding=0 and ks<=num then
 begin
 buy(1,1,market);
 end
 
if holding=0 and sellcond and ks<=num then buyshort(1,1,market);

 

if time=closetime(0) then ks:=0;//收盘的同时,赋值为0

[此贴子已经被作者于2013-4-17 16:49:05编辑过]
8楼
lyt369 发表于:2013/4/17 17:09:18
ok

9楼
chengjun1201 发表于:2013/5/27 14:50:17

if holding=0 and sellcond and ks<=num then

  begin buyshort(1,1,market);

  end

 

if time=closetime(0) then ks:=0;//收盘的同时,赋值为0

10楼
chengjun1201 发表于:2013/5/27 14:51:06

VARIABLE:ks=0;//连续亏损次数

num:=5;

 

buycond:=ref(count(c>o,2)=2,1);
sellcond:=ref(count(c<o,2)=2,1);

 

if holding>0 and sellcond then
 begin
 sell(1,1,market);
  if c<ENTERPRICE then ks:=ks+1;
  else
  if c>ENTERPRICE then ks:=0;//赢利一次,重新计算亏损次数
 end

 

if holding<0 and buycond then
 begin
 sellshort(1,1,market);
  if c>ENTERPRICE then ks:=ks+1;
  else
  if c<ENTERPRICE then ks:=0;//赢利一次,重新计算亏损次数
 end

 

if buycond and holding=0 and ks<=num then
 begin
 buy(1,1,market);
 end
 
if holding=0 and sellcond and ks<=num then

 begin 

buyshort(1,1,market);

 end

 

if time=closetime(0) then ks:=0;//收盘的同时,赋值为0

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


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