以文本方式查看主题 - 金字塔客服中心 - 专业程序化交易软件提供商 (http://www.weistock.com/bbs/index.asp) -- 公式模型编写问题提交 (http://www.weistock.com/bbs/list.asp?boardid=4) ---- 求助????关于止损问题??? (http://www.weistock.com/bbs/dispbbs.asp?boardid=4&id=64959) |
||||||||
-- 作者:golding -- 发布时间:2014/5/13 16:16:18 -- 求助????关于止损问题??? 原程序: //止损3个点
A.当亏损:1个点 平仓 |
||||||||
-- 作者:jinzhe -- 发布时间:2014/5/13 16:34:19 -- 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); |
||||||||
-- 作者:golding -- 发布时间:2014/5/14 10:47:02 -- 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 -- 发布时间: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个点。 |
||||||||
-- 作者:golding -- 发布时间:2014/5/14 11:02:41 -- 经测试编写的止损,自动止盈有问题???
|
||||||||
-- 作者:jinzhe -- 发布时间:2014/5/14 11:15:57 -- 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); 加了一个括号,让后面的计算先进行了,看看这个效果怎么样 |
||||||||
-- 作者:golding -- 发布时间:2014/5/14 14:27:08 -- 关于止损,止盈的问题,最好你们写个简单的程序测试一些,给到客户好。 关于止损,止盈的问题,最好你们写个简单的程序测试一些,给到客户最好。总之,后面加了括号的,也是有问题的。 |
||||||||
-- 作者:jinzhe -- 发布时间:2014/5/14 14:36:11 -- 举例说明问题 |
||||||||
-- 作者:golding -- 发布时间:2014/5/14 15:06:04 -- 第一个问题: 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 -- 发布时间:2014/5/14 15:13:34 -- 给出的条件有不理解的吗? 请说。我来解释。 求助????关于止损问题??? Post By:2014/5/13 16:16:18 [只看该作者] |