以文本方式查看主题

-  金字塔客服中心 - 专业程序化交易软件提供商  (http://weistock.com/bbs/index.asp)
--  公式模型编写问题提交  (http://weistock.com/bbs/list.asp?boardid=4)
----  如何在图表程序化交易里实现绝对止损  (http://weistock.com/bbs/dispbbs.asp?boardid=4&id=86440)

--  作者:青风
--  发布时间:2015/10/21 9:31:38
--  如何在图表程序化交易里实现绝对止损

在图表程序化交易中,开仓后,只要亏损5个点位就无条件止损。

请问:如何用语句实现?

谢谢。


--  作者:jinzhe
--  发布时间:2015/10/21 9:36:14
--  

if holding>0 and close<enterprice-5 then sell(1,0,market);

if holding<0 and close>enterprice+5 then sellshort(1,0,market);