以文本方式查看主题

-  金字塔客服中心 - 专业程序化交易软件提供商  (http://weistock.com/bbs/index.asp)
--  公式模型编写问题提交  (http://weistock.com/bbs/list.asp?boardid=4)
----  数值变量和逻辑变量  (http://weistock.com/bbs/dispbbs.asp?boardid=4&id=99727)

--  作者:王北浪
--  发布时间:2016/6/28 14:31:16
--  数值变量和逻辑变量
请教怎么编一下情况

    if n<=5 then    
                        if c<平仓数值 then sellshort(holding<0,1,thisclose) ;  
                                当平仓时 n:=0  否则n 不变

    else (也就是n>6)  
                       if  平仓条件  then  sellshort(holding<0,1,thisclose) ;
                             当平仓时 n:=0  否则n 不变

这里平仓数值是数值变量, 平仓条件是逻辑变量   本来想用这个形式  if(n<=5,平仓数值,平仓条件),感觉不对  



--  作者:jinzhe
--  发布时间:2016/6/28 14:50:40
--  

是n小于5用平仓数值,大于6用平仓条件?那么你写的是可以的