以文本方式查看主题

-  金字塔客服中心 - 专业程序化交易软件提供商  (http://weistock.com/bbs/index.asp)
--  公式模型编写问题提交  (http://weistock.com/bbs/list.asp?boardid=4)
----  老师您好,请帮我  (http://weistock.com/bbs/dispbbs.asp?boardid=4&id=139975)

--  作者:ZXCVBNM123
--  发布时间:2016/9/23 11:49:25
--  老师您好,请帮我
老师您好,我想写个止盈五个点平仓,止损六个点平仓,止盈点和止损点要能简单操作可以调整的,开仓是,M1五日线,M2十日线,五日线上穿十日线,开仓多单,十日线下穿五日线开仓空单,如果赢了,止盈五个点平仓,如果错了,止损六个点平仓,每次只开三手,不加仓,固定手数开仓,平仓也是固定的三手,这个止损要求是,盈利的利润到达目的地止盈,亏损也是价格到达亏损的点位止损,
--  作者:jinzhe
--  发布时间:2016/9/23 13:10:22
--  
处理中请稍等
--  作者:jinzhe
--  发布时间:2016/9/23 13:27:01
--  

ss:=3;
m1:ma(c,5);
m2:ma(c,10);

if cross(m1,m2) then buy(holding=0,1,marketr);
if cross(m2,m1) then buyshort(holding=0,1,marketr);

if c-enterprice>5 and holding>0 then sell(1,0,marketr);
if enterprice-c>6 and holding>0 then sell(1,0,marketr);


if c-enterprice>6 and holding<0 then sellshort(1,0,marketr);
if enterprice-c>5 and holding<0 then sellshort(1,0,marketr);