以文本方式查看主题

-  金字塔客服中心 - 专业程序化交易软件提供商  (http://weistock.com/bbs/index.asp)
--  公式模型编写问题提交  (http://weistock.com/bbs/list.asp?boardid=4)
----  止损到价成交,请问怎么解决?  (http://weistock.com/bbs/dispbbs.asp?boardid=4&id=147415)

--  作者:sunywell
--  发布时间:2017/2/6 10:33:04
--  止损到价成交,请问怎么解决?

下面是我的止损条件,要求到价成交,可我试了一下,都只能收盘成交,请问怎么解决?

stoppoint:=P1;//止损点

winpoint:=P2;//止赢点

floststopstartpoint:=P3;//浮动止损启动条件

floststoppoint:=P4;//浮动止损点

tradernint:=SS;//每次交易手数

...........


if c-enterprice>P2 then sell(1,ss,THISCLOSE);
if enterprice-c>P2 then sellshort(1,ss,THISCLOSE);

if enterprice-c>P1 then sell(1,ss,THISCLOSE);
if c-enterprice>P1 then sellshort(1,ss,THISCLOSE);
A:=hhv(h,enterbars+1);
B:=llv(l,enterbars+1);
if A>enterprice+P3 and c<=A-P4 then sell(1,ss,THISCLOSE);
if B<enterprice-P3 and c>=B+P4 then sellshort(1,ss,THISCLOSE);


--  作者:sunywell
--  发布时间:2017/2/8 15:54:18
--  

还没回复吗


--  作者:jinzhe
--  发布时间:2017/2/8 15:57:35
--  
不要用走完k线下单,用固定时间间隔模式
--  作者:sunywell
--  发布时间:2017/2/8 16:07:21
--  
那是改什么地方呢
--  作者:jinzhe
--  发布时间:2017/2/8 16:10:15
--  

图片点击可在新窗口打开查看此主题相关图片如下:1.png
图片点击可在新窗口打开查看

--  作者:sunywell
--  发布时间:2017/2/8 17:17:40
--  
开仓要走完k线下单,止损要及时下单,写上去不是有冲突吗

--  作者:jinzhe
--  发布时间:2017/2/8 17:23:37
--  
那就没办法了,总归你要取舍下,要么都是即时开仓,要么都是走完k线下单
--  作者:中东商人
--  发布时间:2017/2/10 13:56:38
--  
如果用后台交易模式是不是一个系统中就可以同时有固定轮询和走完k线模式?
--  作者:pyd
--  发布时间:2017/2/10 14:00:24
--  

不是,图表和后台里 固定轮询和走完k都是二选一

http://www.weistock.com/bbs/dispbbs.asp?boardid=10&Id=9439

可以参照帖子里的方法代码实现 两种模式的混合

[此贴子已经被作者于2017-2-10 14:02:01编辑过]