欢迎使用金字塔普通技术服务论坛,您可以在相关区域发表技术支持贴。
我司技术服务人员将优先处理 VIP客服论坛 服务贴,普通区问题处理速度慢,请耐心等待。谢谢您对我们的支持与理解。


金字塔客服中心 - 专业程序化交易软件提供商金字塔软件公式模型编写问题提交 → 我想每赚10个点平一手可第一个10点就全平了,老大帮看看哪写错了

   

欢迎使用金字塔普通技术服务论坛,您可以在相关区域发表技术支持贴。
我司技术服务人员将优先处理 VIP客服论坛 服务贴,普通区问题处理速度慢,请耐心等待。谢谢您对我们的支持与理解。    


  共有4861人关注过本帖树形打印复制链接

主题:我想每赚10个点平一手可第一个10点就全平了,老大帮看看哪写错了

帅哥哟,离线,有人找我吗?
阿火
  1楼 | QQ | 信息 | 搜索 | 邮箱 | 主页 | UC


加好友 发短信 原leevolvo
等级:版主 帖子:2160 积分:10563 威望:0 精华:11 注册:2010/11/3 11:21:19
  发帖心情 Post By:2012/7/27 8:56:27    Post IP:218.66.121.220[显示全部帖子]

已经做好了修改

另外,楼主注意顺序。你自己写的顺序是错的。

如果穿越当根最高价比收盘价高10个点,按你的写法,你会平仓的

但是在收盘价的位置产生信号,却在当根平仓。这是不符合逻辑的,因为盘中价早于收盘价出现。怎么可能“开仓在后,平仓在前”呢!

 

这种方法要实盘,还有2点要注意:

1,同一根K线多次符合止盈条件,图表只会自动下一次。除非规定一根K线只能止盈一次

2,盘中下单和K线走完下单并存,实盘交易时还需要作稍微的修改,请参考 阿火秘笈

 

INPUT:N(8,1,100,1); //设置参数时;
INPUT:M(21,1,100,1); //设置参数时;;
INPUT:M2(10,1,100,1); //设置参数时;
INPUT:M4(10,1,100,1); //设置参数时;
variable:price=drawnull;
MA1:MA(C,n);
MA3:MA(C,m);
if holding>0 then begin
 cis:=intpart((h-price)/10);
 if cis>0 then begin
  //如果同一根K线上涨了20个点以上,虽然有2个平仓信号,但图表只会执行一次
  for i=1 to cis do begin
   sell(1,1,limitr,price+10*i);
  end
  price:=price+10*cis;
 end
end
if holding<0 then begin
 cis:=intpart((price-l)/10);
 if cis>0 then begin
  for i=1 to cis do begin
   sellshort(1,1,limitr,price-10*i);
  end
  price:=price-10*cis;
 end
end

//建立多头的进场条件
long := time>093000 and time<140000;

if long  and cross(ma1,ma3) then
 begin
 sellshort(holding < 0 , 0, thisclose);
 end
if cross(ma3,ma1) and time>140000 and time<145500 then
begin
sellshort(holding < 0, 0, thisclose);
end
if holding = 0 and long and cross(ma1,ma3) then
 begin
 buy(1 , N, thisclose);
 price:=c;
 end
//14:00-14:55平空仓


//开空条件
short :=  time > 093000 and time < 140000;

if short  and cross(ma3,ma1) then
 begin
 sell(holding > 0, 0, thisclose);
 end
if cross(ma3,ma1) and time>=140000 and time<=145500 then
begin
sell(holding > 0, 0, thisclose);
end
if holding = 0 and short and l < cross(ma3,ma1) then
 begin
 buyshort(1 ,N, thisclose);
 price:=c;
 end
 //140000-1455平多仓

//收盘前5分钟平仓
if time > 145400 then
 begin
 sell(holding > 0, 0, thisclose);
 sellshort(holding < 0, 0, thisclose);
 end

[此贴子已经被作者于2012-7-27 9:23:37编辑过]

 回到顶部