以文本方式查看主题 - 金字塔客服中心 - 专业程序化交易软件提供商 (http://weistock.com/bbs/index.asp) -- 公式模型编写问题提交 (http://weistock.com/bbs/list.asp?boardid=4) ---- 请问这个怎么写,大师们给看下。 (http://weistock.com/bbs/dispbbs.asp?boardid=4&id=12267) |
-- 作者:masterxl -- 发布时间:2012/6/6 19:32:29 -- 请问这个怎么写,大师们给看下。 一下内容实际执行的不一样,想要的结果是当前周期开仓后条件不成立(信号消失了),则立即恢复上一次交易信号的持仓,但是执行的结果不对,不仅不对,连开仓信号也不对。 给看看问题出在哪里。 bOpen:=false; sopen:=false; if QQ and SS=1 and T0 then begin if JZ or TT then end if JD or TT then |
-- 作者:masterxl -- 发布时间:2012/6/7 6:23:17 -- 我在表述清楚一点吧 K1 and C>O//买开仓条件 K2 and C<O//卖开仓条件 S1 and C<O //平多仓条件 B1 and C>O //平空仓条件
要达到的结果如果K1满足且C>o则买入,否则一旦C<=O则平仓并恢复持仓;同样,如果K2满足且C<O则卖出开仓,否则一旦C>=O就平仓并恢复持仓; 如果S1满足且C<O,就平多,否则一旦C>=O就恢复持仓,如果B1满足且C>O就平空,否则一旦C<=O就恢复持仓。 |
-- 作者:jinzhe -- 发布时间:2012/6/7 9:54:01 -- 平仓并恢复持仓
这个恢复持仓做何解释? |
-- 作者:masterxl -- 发布时间:2012/6/7 12:15:05 -- 就是恢复上一次原有持仓 比如均线交叉系统,盘中肯定有交叉后又不成功的,那么当交叉后平反手的仓位在,交叉信号消失后,应该恢复原来的仓位。
如果原来是金叉,现在死叉成立,就平多做空,随着行情的发展死叉消失,那么平多做空就不成立,这样就需要把现在的空单平掉,并迅速恢复原来的多单仓位。这样说可说明白了? |
-- 作者:masterxl -- 发布时间:2012/6/7 12:18:22 -- 其实就是有些软件里面的“全自动交易信号消失后,自动恢复持仓”,这个和“信号消失后次周期恢复持仓”或者“当前K线走完恢复持仓”差别还是很大的 |
-- 作者:王锋 -- 发布时间:2012/6/7 12:58:16 -- 这个在图表上很难实现的,建议你使用后台 |