Rss & SiteMap

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

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

标题:加入止盈止损后 出现问题

1楼
tonybig 发表于:2011/11/8 17:12:58

加入止盈止损后  出现问题

runmode:0;

dayopen:=valuewhen(date>ref(date,1),o);

upperband:dayopen+dayopen*0.005;
dnband:dayopen-dayopen*0.005;
centre:(upperband+dnband)/2;
enterlongcond:=high>=upperband;
entershortcond:=low<=dnband;

atr:=ref(ma(tr,10),1);

exittime:=time>1458;


   if enterlongcond and time<=145800 then begin
   sellshort(holding<0 and enterbars>=1,1,limitr,upperband);
   buy(holding=0,1,limitr,upperband);
   end
  
   if entershortcond and time<=145800 then begin
   sell(holding>0 and enterbars>=1,1,limitr,dnband);
   buyshort(holding=0,1,limitr,dnband);
   end

//止损
if ref(c,1)>centre then sellshort(holding<0,holding,limitr,centre+mindiff);
if ref(c,1)<centre then sell(holding>0,holding,limitr,centre-mindiff);

//止盈
if ref(c,1)>enterprice+atr then sell(holding>0,holding,limitr,thisclose);
if ref(c,1)<enterprice-atr then sellshort(holding<0,holding,limitr,thisclose);


if exittime then begin
   sell(holding>0,1,thisclose);
   sellshort(holding<0,1,thisclose);
end

2楼
fly 发表于:2011/11/8 17:19:05

1.金字塔的时间,都是6位数

 

2.直接用centre+mindiff去发委托单,centre是最小变动价位的整数倍吗?

3楼
26327756l 发表于:2011/11/8 17:20:18
什么问题 说明一下.
4楼
tonybig 发表于:2011/11/8 17:36:10
我换成close发委托  ,依然很多  白色无效信号, 所有问题都是加入止盈控制语句后出现
[此贴子已经被作者于2011-11-8 17:37:45编辑过]
5楼
tonybig 发表于:2011/11/9 9:20:25

顶一下 请高手们回复

6楼
fly 发表于:2011/11/9 9:32:38

1.金字塔的时间,都是6位数

2.直接去发委托单的价格,一定要是最小变动价位的整数倍.

   你可以用小数位为奇数的去手工下个个IF的单子,看看效果如果

3.注意看BUY等下单函数及其各个参数.

 

runmode:0;

dayopen:=valuewhen(date>ref(date,1),o);

upperband:dayopen+dayopen*0.005;
dnband:dayopen-dayopen*0.005;
centre:(upperband+dnband)/2;
enterlongcond:=high>=upperband;
entershortcond:=low<=dnband;

atr:=ref(ma(tr,10),1);


   if enterlongcond and time<=145800 then begin
   sellshort(holding<0 and enterbars>=1,1,limitr,c+2*mindiff);
   buy(holding=0,1,limitr,c+2*mindiff);
   end
  
   if entershortcond and time<=145800 then begin
   sell(holding>0 and enterbars>=1,1,limitr,c-2*mindiff);
   buyshort(holding=0,1,limitr,c-2*mindiff);
   end

//止损
if ref(c,1)>centre then sellshort(holding<0,holding,limitr,c+2*mindiff);
if ref(c,1)<centre then sell(holding>0,holding,limitr,c-2*mindiff);

//止盈
if ref(c,1)>enterprice+atr then sell(holding>0,holding,market);
if ref(c,1)<enterprice-atr then sellshort(holding<0,holding,market);


if time>=145800 then begin
   sell(holding>0,1,thisclose);
   sellshort(holding<0,1,thisclose);
end

7楼
tonybig 发表于:2011/11/9 14:58:06
我想确认一下我的模型逻辑是没问题的?     先是两个正反手指令,然后加入止损,再加入入止盈指令。     是否止盈止损指令可以加入到正反手的指令里?
8楼
fly 发表于:2011/11/9 15:24:18

模型逻辑是没问题的.

 

 是否止盈止损指令可以加入到正反手的指令里?

 加入进去干什么,难道你的止盈止损指令也要满足你正反手指令的条件.

 

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


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