以文本方式查看主题 - 金字塔客服中心 - 专业程序化交易软件提供商 (http://weistock.com/bbs/index.asp) -- 公式模型编写问题提交 (http://weistock.com/bbs/list.asp?boardid=4) ---- 请老师帮忙检查一下模型的问题 (http://weistock.com/bbs/dispbbs.asp?boardid=4&id=97569) |
-- 作者:lliang1022 -- 发布时间:2016/5/18 14:19:30 -- 请老师帮忙检查一下模型的问题 回测无法平仓 代码如下,谢谢:
input:N(9,1,100,10); Variable:position=0; //kdj指标 A1:=every(K<60,30); A3:=Cross(K,d) and K<20.5 and D<20.5 and Count(K>40,10)=0; B1:=C>enterprice+X*MINDIFF or C<enterprice-X*MINDIFF; B3:=every(K>60,15); IF Holding=0 and position =0 THEN BEGIN If Holding = 1 and position =1 then begin If if holding = -1 and position = -1 then begin If holding = 1 and position = 2 then begin If holding = -1 and position = -2 then begin |
-- 作者:jinzhe -- 发布时间:2016/5/18 14:24:52 -- input:N(9,1,100,10); Variable:position=0; //kdj指标 A1:=every(K<60,30); A3:=Cross(K,d) and K<20.5 and D<20.5 and Count(K>40,10)=0;
B3:=every(K>60,15); IF Holding=0 and position =0 THEN BEGIN If Holding = 1 and position =1 then begin If if holding = -1 and position = -1 then begin If holding = 1 and position = 2 then begin If holding = -1 and position = -2 then begin |
-- 作者:jinzhe -- 发布时间:2016/5/18 14:25:25 -- 问题在于
sellshort(1,1,marketr);
类似这样的 position后面都少一个冒号 |
-- 作者:lliang1022 -- 发布时间:2016/5/18 14:30:29 -- 谢谢,但是更新之后只能开到多头空头开不到又是怎么回事? 如题 |
-- 作者:jinzhe -- 发布时间:2016/5/18 14:35:44 -- 说明你的空头条件难以满足,所以没有空头信号
|