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


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

   

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


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

主题:[求助]

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


加好友 发短信
等级:新手上路 帖子:25 积分:0 威望:0 精华:0 注册:2016/9/8 10:44:39
[求助]  发帖心情 Post By:2016/9/21 10:35:43    Post IP:221.4.54.93[只看该作者]

设定 x 的止盈线,设定x1 的止损线, 过滤条件为波幅 30 点。

这样写对吗,总是符号搞错
if c>enterprice*(1+x)  and holding>0 then sell(1,0,marketr);//多头止盈
if c<enterprice*(1-x1) and holding>0 then sellshort(1,0,marketr);//止损多头

if c<enterprice*(1+x)  and holding<0 then sellshort(1,0,marketr);///空头止盈
if c>enterprice*(1-x1) and holding<0 then sell(1,0,marketr);//止损空头


 回到顶部
美女呀,离线,留言给我吧!
pyd
  2楼 | 信息 | 搜索 | 邮箱 | 主页 | UC


加好友 发短信
等级:超级版主 帖子:8439 积分:0 威望:0 精华:0 注册:2014/7/14 13:43:36
  发帖心情 Post By:2016/9/21 10:39:12    Post IP:116.226.230.3[只看该作者]

多头是虚拟持仓holding是正的,空头是负的,大于号小于号写错了。

平多前holding>0,平空前holding<0。

if c>enterprice*(1+x) and holding>0 then sell(1,0,marketr);//多头止盈
if c<enterprice*(1-x1) and holding<0 then sellshort(1,0,marketr);//止损多头

if c<enterprice*(1+x) and holding<0 then sellshort(1,0,marketr);///空头止盈
if c>enterprice*(1-x1) and holding>0 then sell(1,0,marketr);//止损空头


 

[此贴子已经被作者于2016-9-21 10:40:09编辑过]

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


加好友 发短信
等级:新手上路 帖子:25 积分:0 威望:0 精华:0 注册:2016/9/8 10:44:39
  发帖心情 Post By:2016/9/21 10:47:54    Post IP:221.4.54.93[只看该作者]

if c>enterprice*(1+x) and holding>0 then sell(1,0,marketr);//多头止盈
if c<enterprice*(1-x1) and holding<0 then sell(1,0,marketr);//止损多头
if c<enterprice*(1+x) and holding<0 then sellshort(1,0,marketr);///空头止盈
if c>enterprice*(1-x1) and holding>0 then sellshort(1,0,marketr);//止损空头
能不能在进行止盈或者止损以后再不进行开仓操作,直到进行平仓
if time>=150000 then begin
收盘平多:sell(1,手数,market);
收盘平空:sellshort(1,手数,market);
end

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


加好友 发短信
等级:管理员 帖子:26632 积分:0 威望:0 精华:7 注册:2015/4/9 14:59:07
  发帖心情 Post By:2016/9/21 10:58:27    Post IP:180.169.30.6[只看该作者]

你修改自己定义的开仓条件。



编程无捷径,技巧靠积累。
 回到顶部
帅哥哟,离线,有人找我吗?
jinzhe
  5楼 | 信息 | 搜索 | 邮箱 | 主页 | UC


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

你另外发的帖子里面已经有回答了


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

客户服务部

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

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

 回到顶部