以文本方式查看主题

-  金字塔客服中心 - 专业程序化交易软件提供商  (http://www.weistock.com/bbs/index.asp)
--  金字塔软件问题提交  (http://www.weistock.com/bbs/list.asp?boardid=2)
----  分批止盈如何写?  (http://www.weistock.com/bbs/dispbbs.asp?boardid=2&id=156314)

--  作者:qq代人发帖
--  发布时间:2017/7/27 15:40:13
--  分批止盈如何写?
分批止盈如何写
--  作者:qq代人发帖
--  发布时间:2017/7/27 15:40:36
--  
请具体描述您的需求
--  作者:nini0310
--  发布时间:2017/7/27 15:48:10
--  
例如:周期15分钟,根据均线5日均线金叉10日均线买入10手,
第一种分批止盈:每涨10个点分批止盈2手。
第二种分批止盈:收盘件低于5日均线止盈1/2,收盘件价于10日均线,止盈另1/2.
第三种分批止盈:macd红柱变短第二根止盈1/2,macd出现绿柱,止盈另1/2.
谢谢这三种止盈方式如何写?

--  作者:nini0310
--  发布时间:2017/7/27 15:48:48
--  
不知道描述的是否清楚,请指教,谢谢!
--  作者:FireScript
--  发布时间:2017/7/27 16:12:15
--  

1.每涨10点平2手

VARIABLE:temp=0;
if close-ENTERPRICE>=10 and  temp=0  then begin  sell(); temp:=close; end
if temp!=0 and close-temp>=10 then begin sell(); temp:=close; end 

 

2.这里控制了下平仓次序,如果你觉得低于5日和10日任意一个先触发都平,我再改。

VARIABLE:temp=0;
if close<ma(close,5)and temp=0  then  begin sell(1,holding/2,MARKET);temp:=1;end
if temp and close<ma(close,10) then begin sell(1,holding/2,MARKET); end

 

[此贴子已经被作者于2017/7/27 16:12:28编辑过]

--  作者:nini0310
--  发布时间:2017/7/27 16:16:40
--  
好的谢谢,螺纹买入后浮盈 每手回落10个点全部 止盈,如何写,再次感谢
--  作者:pyd
--  发布时间:2017/7/27 16:26:32
--  
fy:=hhv(OPENPROFIT,enterbars+1);
if fy-OPENPROFIT>=10 then

--  作者:FireScript
--  发布时间:2017/7/27 16:30:15
--  
if ENTERPRICE-close<10 then sell(1,holding,MARKET);      回落十点就全平止盈?
--  作者:nini0310
--  发布时间:2017/7/27 16:41:20
--  
谢谢