Rss & SiteMap

金字塔客服中心 - 专业程序化交易软件提供商 http://www.weistock.com/bbs/

专业程序化软件提供商
共8 条记录, 每页显示 10 条, 页签: [1]
[浏览完整版]

标题:止损问题

1楼
yuanman 发表于:2015/10/26 13:07:24
请教;在图表程序化模型中,有多个开仓指令,可不可以根据不同的指令需要而设置不同幅度的止损?
2楼
jinzhe 发表于:2015/10/26 13:13:13
这个根据用户自己的需求来设定,多样性也好,统一设置止损也好,这个都可以,根据用户自己的需求从来进行设定
3楼
yuanman 发表于:2015/10/26 13:57:52

我要在下面两个指令上采用不同幅度的止损设置,第一个亏损10个点止损,第二个亏20点止损,

请老师给编写个范例吧;

 

if  SXGUIJU and cross(k,j)  then begin

平多1:sell(holding>0,holding,market);
开空1: buyshort(holding=0,jisl,market);
end

 

if  KXGUIJU and cross(zj,zk) and  mnnS  then begin
平多2:sell(holding>0,holding,market);
开空2: buyshort(holding=0,jisl,market);
end

4楼
jinzhe 发表于:2015/10/26 14:07:44

variable:n=0,m=0;

 

if  SXGUIJU and cross(k,j)  then begin

sell(holding>0,holding,market);

  if holding=0 and n=0 then begin
     buyshort(holding=0,jisl,market);

     n:=1;

  end
end

 

if  KXGUIJU and cross(zj,zk) and  mnnS  then begin
   sell(holding>0,holding,market);

   if m=0 and holding=0 then begin
      buyshort(holding=0,jisl,market);

      m:=1;

   end
end

 

if holding<0 and n=1 and close>=enterprice+10 then begin

    sellshort(1,0,market);

    n:=0;

end

 

if holding<0 and m=1 and close>=enterprice+20 then begin

    sellshort(1,0,market);

    m:=0;

end

5楼
yuanman 发表于:2015/10/26 15:30:05

请教老师下面两句该如何编写;

当前K线上轨大于前6根K线的上轨且大于n,当前K线下轨小于前6根K线的下轨且小于n,且最新价阳线;
6楼
jinzhe 发表于:2015/10/26 15:31:49

当前K线上轨大于前6根K线的上轨且大于n: 上轨>ref(hhv(上轨,6),1) and 上轨>n;

当前K线下轨小于前6根K线的下轨且小于n: 下轨<ref(llv(下轨,6),1) and 下轨<n;

且最新价阳:isalstbar and isup

7楼
yuanman 发表于:2015/10/27 16:10:27

老师;我上面的表述不准确,应该是;

当前K线上轨大于前6根K线的上轨,当前K线上轨减去前6根K线的上轨之差大于n:

当前K线下轨小于前6根K线的下轨,  前6根K线的下轨减去当前K线下轨之差大于n:
麻烦老师了。谢谢

8楼
jinzhe 发表于:2015/10/27 16:13:46

上轨>ref(hhv(上轨,6),1) and 上轨-ref(hhv(上轨,6),1) >n

下轨<ref(llv(下轨,6),1) and ref(llv(下轨,6),1) -下轨>n

共8 条记录, 每页显示 10 条, 页签: [1]


Powered By Dvbbs Version 8.3.0
Processed in 0.03516 s, 3 queries.