以文本方式查看主题 - 金字塔客服中心 - 专业程序化交易软件提供商 (http://weistock.com/bbs/index.asp) -- 公式模型编写问题提交 (http://weistock.com/bbs/list.asp?boardid=4) ---- 为什么我的交易系统在某个价位上就不做空,某个价位下就做空?? (http://weistock.com/bbs/dispbbs.asp?boardid=4&id=30003) |
-- 作者:gongxiangban -- 发布时间:2012/10/21 20:38:03 -- 为什么我的交易系统在某个价位上就不做空,某个价位下就做空?? 如附件中,。 为什么在3771到3765区间 一下才做空?? 上方就不做空? 我根本没有审定这个区间参数啊。 ![]() [此贴子已经被作者于2012-10-21 20:39:30编辑过]
|
-- 作者:gongxiangban -- 发布时间:2012/10/21 20:39:17 -- ![]() |
-- 作者:gongxiangban -- 发布时间:2012/10/21 21:00:05 -- 就是那个灰色的线, |
-- 作者:gongxiangban -- 发布时间:2012/10/21 22:10:17 -- 代码是这样的 short:=close[DATACOUNT-1]>MA1 and close<=MA1-10*MINDIFF and MACD<0 and MACD5>0 and holding =0; if short then begin flag :=1; stloss :=maxlow; stprice := close - (maxlow -close ); buyshort(holding=0,lots,THISCLOSE); end; if (close <stprice and flag=1 and holding <0) then begin
sellshort(holding<0,lots/2,THISCLOSE);
flag :=0;
stloss := close + (maxlow - close)/2.0; end; if ((MA1+MINDIFF*STOPLINE <close or close> stloss )and holding<0 ) THEN begin sellshort(holding<0,-holding,THISCLOSE); flag:=0; end; |
-- 作者:gongxiangban -- 发布时间:2012/10/21 22:36:05 -- 问题已经解决了 datacount的问题 改成ref(close,1) 就可以了
|