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


金字塔客服中心 - 专业程序化交易软件提供商金字塔软件公式模型编写问题提交 → 加入止损公式一直未能成功,郁闷

   

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


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

主题:加入止损公式一直未能成功,郁闷

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


加好友 发短信
等级:新手上路 帖子:18 积分:0 威望:0 精华:0 注册:2014/12/18 21:14:50
加入止损公式一直未能成功,郁闷  发帖心情 Post By:2015/1/14 12:59:05    Post IP:116.252.64.168[显示全部帖子]

buycond:=count(c>o,2)=2;
sellcond:=count(c<o,2)=2;
if holding>0 and sellcond then sell(1,1,thisclose);
if holding<0 and buycond then sellshort(1,1,thisclose);
if holding=0 and buycond then buy(1,1,thisclose);
if holding=0 and sellcond then buyshort(1,1,thisclose);

 

老师,想在该策略上加入止损,一直弄不成,非常郁闷!

我的想法:入场后在次周期内如亏损5个点即时止损;在第二个周期内如亏损2个点即时止损;在第三个周期内如平本即时止损;在第四个周期内如盈利返回10%即时止盈。用于股指使用。


 回到顶部
帅哥哟,离线,有人找我吗?
lty9055
  2楼 | 信息 | 搜索 | 邮箱 | 主页 | UC


加好友 发短信
等级:新手上路 帖子:18 积分:0 威望:0 精华:0 注册:2014/12/18 21:14:50
  发帖心情 Post By:2015/1/14 15:12:09    Post IP:116.252.64.168[显示全部帖子]

if enterbars=1 and enterprice-l>=5 then sell(holding>0,holding,market);
if enterbars=1 and h-enterprice>=5 then sellshort(holding<0,holding,market);
if enterbars=2 and enterprice-l>=2 then sell(holding>0,holding,market);
if enterbars=2 and h-enterprice>=2 then sellshort(holding<0,holding,market);
if enterbars=3 and enterprice-l>=0 then sell(holding>0,holding,market);
if enterbars=3 and h-enterprice>=0 then sellshort(holding<0,holding,market);

if enterbars=4 and h-enterprice>=0.1*enterprice then sell(holding>0,holding,market);
if enterbars=4 and enterprice-l>=0.1*enterprice then sellshort(holding<0,holding,market);

感谢老师!

有个地方改动一下,我不想在次周期开盘价执行止损,我想一当碰到了马上发出指令执行止损。这应该改为哪个?谢谢


 回到顶部
帅哥哟,离线,有人找我吗?
lty9055
  3楼 | 信息 | 搜索 | 邮箱 | 主页 | UC


加好友 发短信
等级:新手上路 帖子:18 积分:0 威望:0 精华:0 注册:2014/12/18 21:14:50
  发帖心情 Post By:2015/1/14 16:14:52    Post IP:116.252.64.168[显示全部帖子]

我的想法:入场后在次周期内如亏损5个点即时止损;在第二个周期内如亏损2个点即时止损;在第三个周期内如平本即时止损;在第四个周期内如盈利返回10%即时止盈。用于股指使用。

 

老师,可能我写的不够明白,应该是次周期内如亏损5个点即时止损;在第二个周期内如比较上周期收盘价低2个点即时止损;在第三个周期内如比较上周期收盘价平本即时止损;在第四个周期内如盈利返回10%即时止盈。

 

已经止损了,就不能再开仓,这个公式放在系统内,经常出现平仓后又马上开仓的情况。

能不能用“止损”“止盈”符号在k线图中标识,如果是平空平多,很混乱。感谢老师!


 回到顶部
帅哥哟,离线,有人找我吗?
lty9055
  4楼 | 信息 | 搜索 | 邮箱 | 主页 | UC


加好友 发短信
等级:新手上路 帖子:18 积分:0 威望:0 精华:0 注册:2014/12/18 21:14:50
  发帖心情 Post By:2015/1/14 17:31:26    Post IP:116.252.64.168[显示全部帖子]

是的,感谢老师

 回到顶部