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


金字塔客服中心 - 专业程序化交易软件提供商金字塔软件公式模型编写问题提交 → 求助????关于止损问题???

   

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


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

主题:求助????关于止损问题???

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


加好友 发短信
等级:新手上路 帖子:52 积分:0 威望:0 精华:0 注册:2014/5/13 16:14:34
求助????关于止损问题???  发帖心情 Post By:2014/5/13 16:16:18    Post IP:59.40.246.72[只看该作者]

原程序:

//止损3个点
if ENTERPRICE-l>=3*mindiff then
sell(1,holding,market);
if h-ENTERPRICE>=3*mindiff then
sellshort(1,holding,market);
//回落到1个点止盈
if h-enterprice>=3*mindiff THEN
n:=1;
if n=1 and h-ENTERPRICE<=1*mindiff then
sell(1,holding,market);
if enterprice-l>=3*mindiff then
m:=1;
if m=1 and ENTERPRICE-l<=1*mindiff then
sellshort(1,holding,market);


改成带“后台”程序按下述安求:

    A.当亏损:1个点 平仓
    B.赚钱:1个点或以上,自动设置止盈:0.2个点,如果价格没有回到止盈价格,让利润去漂。
                                                               如果价格回到止盈价格,自动平仓。


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


加好友 发短信
等级:罗宾汉 帖子:46311 积分:50819 威望:0 精华:2 注册:2011/3/23 8:50:25
  发帖心情 Post By:2014/5/13 16:34:19    Post IP:58.246.57.26[只看该作者]

if dynainfo(7)-tenterprice>1 and tsellholding(0)>0 then tsellshort(1,0,mkt);

if tenterprice-dynainfo(7)>1 and tbuyholding(0)>0 then tsell(1,0,mkt);

 

if dynainfo(7)-tenterprice>1 and dynainfo(7)<hhv(h,tenterbars+1)-0.2 and tbuyholding(0)>0 then tsell(1,0,mkt);

if tenterprice-dynainfo(7)>1 and dynainfo(7)>llv(l,tenterbars+1)+0.2 and tsellholding(0)>0 then tsellshort(1,0,mkt);



金字塔—专业程序化交易量化投资平台

客户服务部

----------------------------------------------------------- 欢迎您参加我公司的技术培训,具体培训需求请发邮件到service@weistock.com

您的宝贵建议或者投诉,请发往邮箱:weiwei@weistock.com

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


加好友 发短信
等级:新手上路 帖子:52 积分:0 威望:0 精华:0 注册:2014/5/13 16:14:34
  发帖心情 Post By:2014/5/14 10:47:02    Post IP:119.123.122.203[只看该作者]

if dynainfo(7)-tenterprice>1 and tsellholding(0)>0 then tsellshort(1,0,mkt);

if tenterprice-dynainfo(7)>1 and tbuyholding(0)>0 then tsell(1,0,mkt);

 

经测试:相差0.2就自动平仓。 是不是你们软件定义:1个点止损,就是0.2????


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


加好友 发短信
等级:新手上路 帖子:52 积分:0 威望:0 精华:0 注册:2014/5/13 16:14:34
  发帖心情 Post By:2014/5/14 11:00:35    Post IP:119.123.122.203[只看该作者]

if dynainfo(7)-tenterprice>1 and dynainfo(7)<hhv(h,tenterbars+1)-0.2 and tbuyholding(0)>0 then tsell(1,0,mkt);

if tenterprice-dynainfo(7)>1 and dynainfo(7)>llv(l,tenterbars+1)+0.2 and tsellholding(0)>0 then tsellshort(1,0,mkt);

 

B.赚钱:1个点或以上,自动设置止盈:0.2个点,如果价格没有回到止盈价格,让利润去漂。
                                                               如果价格回到止盈价格,自动平仓。

 

经测试:不会自动设置止盈:0.2个点。


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


加好友 发短信
等级:新手上路 帖子:52 积分:0 威望:0 精华:0 注册:2014/5/13 16:14:34
经测试编写的止损,自动止盈有问题???  发帖心情 Post By:2014/5/14 11:02:41    Post IP:119.123.122.203[只看该作者]

if dynainfo(7)-tenterprice>1 and tsellholding(0)>0 then tsellshort(1,0,mkt);

if tenterprice-dynainfo(7)>1 and tbuyholding(0)>0 then tsell(1,0,mkt);

 

经测试:相差0.2就自动平仓。 是不是你们软件定义:1个点止损,就是0.2????


  单帖管理 | 引用 | 回复 | 编辑 | 回到顶部
golding
4楼 | 信息 | 搜索 | 邮箱


加好友 发短信
等级:新手上路 帖子:3 积分:0 威望:0 精华:0 注册:2014/5/13 16:14:34
   发帖心情Post By:2014/5/14 11:00:35

if dynainfo(7)-tenterprice>1 and dynainfo(7)<hhv(h,tenterbars+1)-0.2 and tbuyholding(0)>0 then tsell(1,0,mkt);

if tenterprice-dynainfo(7)>1 and dynainfo(7)>llv(l,tenterbars+1)+0.2 and tsellholding(0)>0 then tsellshort(1,0,mkt);

 

B.赚钱:1个点或以上,自动设置止盈:0.2个点,如果价格没有回到止盈价格,让利润去漂。
                                                               如果价格回到止盈价格,自动平仓。

 

经测试:不会自动设置止盈:0.2个点。


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


加好友 发短信
等级:罗宾汉 帖子:46311 积分:50819 威望:0 精华:2 注册:2011/3/23 8:50:25
  发帖心情 Post By:2014/5/14 11:15:57    Post IP:58.246.57.26[只看该作者]

if dynainfo(7)-tenterprice>1 and tsellholding(0)>0 then tsellshort(1,0,mkt);

if tenterprice-dynainfo(7)>1 and tbuyholding(0)>0 then tsell(1,0,mkt);

 

if dynainfo(7)-tenterprice>1 and dynainfo(7)<(hhv(h,tenterbars+1)-0.2) and tbuyholding(0)>0 then tsell(1,0,mkt);

if tenterprice-dynainfo(7)>1 and dynainfo(7)>(llv(l,tenterbars+1)+0.2) and tsellholding(0)>0 then tsellshort(1,0,mkt);

加了一个括号,让后面的计算先进行了,看看这个效果怎么样



金字塔—专业程序化交易量化投资平台

客户服务部

----------------------------------------------------------- 欢迎您参加我公司的技术培训,具体培训需求请发邮件到service@weistock.com

您的宝贵建议或者投诉,请发往邮箱:weiwei@weistock.com

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


加好友 发短信
等级:新手上路 帖子:52 积分:0 威望:0 精华:0 注册:2014/5/13 16:14:34
关于止损,止盈的问题,最好你们写个简单的程序测试一些,给到客户好。  发帖心情 Post By:2014/5/14 14:27:08    Post IP:119.123.122.203[只看该作者]

关于止损,止盈的问题,最好你们写个简单的程序测试一些,给到客户最好。总之,后面加了括号的,也是有问题的。

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


加好友 发短信
等级:罗宾汉 帖子:46311 积分:50819 威望:0 精华:2 注册:2011/3/23 8:50:25
  发帖心情 Post By:2014/5/14 14:36:11    Post IP:58.246.57.26[只看该作者]

举例说明问题


金字塔—专业程序化交易量化投资平台

客户服务部

----------------------------------------------------------- 欢迎您参加我公司的技术培训,具体培训需求请发邮件到service@weistock.com

您的宝贵建议或者投诉,请发往邮箱:weiwei@weistock.com

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


加好友 发短信
等级:新手上路 帖子:52 积分:0 威望:0 精华:0 注册:2014/5/13 16:14:34
  发帖心情 Post By:2014/5/14 15:06:04    Post IP:119.123.122.203[只看该作者]

第一个问题: 

if dynainfo(7)-tenterprice>1 and tsellholding(0)>0 then tsellshort(1,0,mkt);

if tenterprice-dynainfo(7)>1 and tbuyholding(0)>0 then tsell(1,0,mkt);

 

经测试:相差0.2就自动平仓。

 

第二个问题:

if dynainfo(7)-tenterprice>1 and dynainfo(7)<(hhv(h,tenterbars+1)-0.2) and tbuyholding(0)>0 then tsell(1,0,mkt);

if tenterprice-dynainfo(7)>1 and dynainfo(7)>(llv(l,tenterbars+1)+0.2) and tsellholding(0)>0 then tsellshort(1,0,mkt);

 

经测试:说明一些股指1个点就是300元,是由5个0.2组成的。 赚1个或以上,自动设定止盈0.2 ,上面的0.2止盈,没有作用。


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


加好友 发短信
等级:新手上路 帖子:52 积分:0 威望:0 精华:0 注册:2014/5/13 16:14:34
给出的条件有不理解的吗? 请说。我来解释。  发帖心情 Post By:2014/5/14 15:13:34    Post IP:119.123.122.203[只看该作者]

求助????关于止损问题???  发帖心情 Post By:2014/5/13 16:16:18 [只看该作者]

原程序:

//止损3个点
if ENTERPRICE-l>=3*mindiff then
sell(1,holding,market);
if h-ENTERPRICE>=3*mindiff then
sellshort(1,holding,market);
//回落到1个点止盈
if h-enterprice>=3*mindiff THEN
n:=1;
if n=1 and h-ENTERPRICE<=1*mindiff then
sell(1,holding,market);
if enterprice-l>=3*mindiff then
m:=1;
if m=1 and ENTERPRICE-l<=1*mindiff then
sellshort(1,holding,market);


改成带“后台”程序按下述安求:

    A.当亏损:1个点 平仓
    B.赚钱:1个点或以上,自动设置止盈:0.2个点,如果价格没有回到止盈价格,让利润去漂。
                                                               如果价格回到止盈价格,自动平仓。


 回到顶部
总数 80 1 2 3 4 5 6 7 8 下一页