[求助] 为什么平多以后 还是马上开多 怎么才能止损以后 不在开同向的仓 , 知道反向信号出现在开仓 [金字塔]
- 咨询内容:
if barpos = 0 then
stopprice := l - stopnum;
if aspect = 0 then begin
//多头处理
if l <= stopprice then begin
sell(holding>0,holding,0);aspect:= 1;
stopprice := h+stopnum;
end
//处理移动的底部
if l - stopnum > stopprice then
stopprice := l-stopnum;
end
if aspect = 1 then begin
//空头处理
if h >= stopprice then begin
sellshort(holding<0,holding,0);
aspect:= 0;
stopprice := l-stopnum;
end
//处理移动的底部
if h + stopnum < stopprice then
stopprice := h+stopnum;
end
dt:=Buy(开仓时间 AND NOT(TYPE(1)=1) and h>=UpperBand and (HOLDING=0) ,lots,LIMITR,Max(Open,UpperBand)+1*MINDIFF),orderqueue;
kt:=BuyShort(开仓时间 and NOT(TYPE(3)=1) and l<=LowerBand and (HOLDING=0) ,lots,LIMITR,Min(Open,LowerBand)-1*MINDIFF),orderqueue;
if dt then beginbuy(dt and NOT(TYPE(1)=1),10%,0);
end;
if kt then beginbuyshort(kt and NOT(TYPE(1)=3),10%,0);
end; - 金字塔客服:
此主题相关图片如下:6h(%n$8ie9yl~15@5v5wnl2.jpg
- 用户回复:
variable:n=0;
variable:m=0;
if barpos = 0 then
stopprice := l - stopnum;
if aspect = 0 then begin
//多头处理
if l <= stopprice then begin
sell(holding>0,holding,0);aspect:= 1;
stopprice := h+stopnum;n:=1;
m:=0;
end
//处理移动的底部
if l - stopnum > stopprice then
stopprice := l-stopnum;
end
if aspect = 1 then begin
//空头处理
if h >= stopprice then begin
sellshort(holding<0,holding,0);
aspect:= 0;
stopprice := l-stopnum;m:=1;
n:=0;
end
//处理移动的底部
if h + stopnum < stopprice then
stopprice := h+stopnum;
end;
dt:=开仓时间 AND NOT(TYPE(1)=1) and h>=UpperBand and (HOLDING=0);kt:=开仓时间 and NOT(TYPE(3)=1) and l<=LowerBand and (HOLDING=0);
if dt and m=1 then beginbuy(1,10%,0);
end;
if kt and n=1 then beginbuyshort(1,10%,0);
end;这两句用来是干什么的?
dt:=Buy(开仓时间 AND NOT(TYPE(1)=1) and h>=UpperBand and (HOLDING=0) ,lots,LIMITR,Max(Open,UpperBand)+1*MINDIFF),orderqueue;
kt:=BuyShort(开仓时间 and NOT(TYPE(3)=1) and l<=LowerBand and (HOLDING=0) ,lots,LIMITR,Min(Open,LowerBand)-1*MINDIFF),orderqueue;这样的胡乱赋值有什么意义?
[此贴子已经被作者于2013/11/13 9:08:10编辑过] - 网友回复:
不好意思我新学的, 有的地方还是不太懂 现在又出来一个问题, if h >= stopprice then begin
sellshort(holding<0,holding,0); 会平空 不在开空 但是 l <= stopprice 会开空 我的 策略是 最低价突破下轨做空 h >= stopprice 时平空 不在开仓 直到 最低价突破下轨在做空 - 网友回复:
l <= stopprice 上面代码里面哪里有根据这个判断条件开仓的?不都是l<=LowerBand 才开仓的?
有思路,想编写各种指标公式,程序化交易模型,选股公式,预警公式的朋友
可联系技术人员 QQ: 1145508240 进行 有偿 编写!(不贵!点击查看价格!)
相关文章
-
没有相关内容