以文本方式查看主题 - 金字塔客服中心 - 专业程序化交易软件提供商 (http://weistock.com/bbs/index.asp) -- 公式模型编写问题提交 (http://weistock.com/bbs/list.asp?boardid=4) ---- [原创]如何用分时图做程序测试 (http://weistock.com/bbs/dispbbs.asp?boardid=4&id=145384) |
-- 作者:程序学习者 -- 发布时间:2016/12/28 10:33:07 -- [原创]如何用分时图做程序测试 老师好? 分时图中有分时线和结算线,一根是白的的一根是黄的。 我想把分时线上穿结算线,做多。止损为下穿5个点平仓;止盈价格为收盘前平仓(最好是在14:55分前平仓); 分时线下穿结算线,做空。止损为上穿5个点平仓;止盈价格为收盘前平仓(最好是在14:55分前平仓); 以上的公式如何写?
|
-- 作者:jinzhe -- 发布时间:2016/12/28 11:07:01 -- n1:=todaybar; dm:=4-INTPART(LOG(C)); jsj:=ROUNDS(IF(sum(vol,n1)=0,C,sum(C*vol,n1)/sum(vol,n1)),2+dm); cc:=c; if cross(cc,jsj) then begin
buy(holding=0,1,marketr); end
if cross(jsj,cc) then begin buyshort(holding=0,1,marketr); end
if c<jsj-5 then sell(1,0,marketr); if c>jsj+5 then sellshort(1,0,marketr);
if time0>=timetot0(closetime(0))-5*60 then begin sell(1,0,marketr); sellshort(1,0,marketr); end
|