Rss & SiteMap

金字塔客服中心 - 专业程序化交易软件提供商 http://www.weistock.com/bbs/

专业程序化软件提供商
共5 条记录, 每页显示 10 条, 页签: [1]
[浏览完整版]

标题:[求助]

1楼
zxlwrz123 发表于:2016/9/21 10:35:43
设定 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);//止损空头

2楼
pyd 发表于:2016/9/21 10:39:12

多头是虚拟持仓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编辑过]
3楼
zxlwrz123 发表于:2016/9/21 10:47:54
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
4楼
wenarm 发表于:2016/9/21 10:58:27

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

5楼
jinzhe 发表于:2016/9/21 11:14:31
你另外发的帖子里面已经有回答了
共5 条记录, 每页显示 10 条, 页签: [1]


Powered By Dvbbs Version 8.3.0
Processed in 0.00781 s, 3 queries.