Rss & SiteMap

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

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

标题:止损问题请教阿火

1楼
cxyr99 发表于:2012/3/14 22:50:53

请教阿火   下列代码   我想用两个条件得出不同的退出价exitprice   但是都使用同一变量名在随后的sell语句中退出 。测试时第一部分可以止损,

但第二部分使用均线止损满足条件没有平仓信号显示无法平仓    我查看说明好像是跟序列运行模式有关  导致用close赋给变量无效

应该怎么解决。或者是我这样写本身结构就不对

 

 

 exitprice{初始化}

 

  if  条件1    then

        {  exitprice:= stoplossprice  } 

 

  if  条件2    then

 

       { if  cross(ma(close,60),close) then


           exitprice: = close;  }

      

   

sell(1,exitprice)

2楼
阿火 发表于:2012/3/14 22:53:46

看不懂。语法错误 if then 的结构也是错的

金字塔不像开拓者那样使用 { }

3楼
cxyr99 发表于:2012/3/14 23:02:12

 不好意思,不是为了写成开拓者那样 ,是像搞清楚 第2部分用均线平仓是没信号的,我觉得是满足条件时得不得exitprice,和说明书里序列运行模式有关,但不知道怎么改写才对

 

 if  cond1    then   begin

 

               ·········语句··········

 

              exitprice:= stoplossprice ;

 end 

        

  if  cond2    then  begin

       

              if  cross(ma(close,60),close) then


              exitprice:= close ;

 end 

 

      

   

sell(1,exitprice)

[此贴子已经被作者于2012-3-14 23:06:51编辑过]
4楼
阿火 发表于:2012/3/15 6:55:02

cond3:=cross(ma(close,60),close) ;//放if结构外面

if  cond2    then  begin

       

              if  cond3  then


              exitprice:= close ;

 end 

5楼
cxyr99 发表于:2012/3/15 10:36:13
阿火真火图片点击可在新窗口打开查看, 十分感谢
共5 条记录, 每页显示 10 条, 页签: [1]


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