以文本方式查看主题 - 金字塔客服中心 - 专业程序化交易软件提供商 (http://www.weistock.com/bbs/index.asp) -- 金字塔软件问题提交 (http://www.weistock.com/bbs/list.asp?boardid=2) ---- 找不出问题答案的我 (http://www.weistock.com/bbs/dispbbs.asp?boardid=2&id=9521) |
-- 作者:solarhe2006 -- 发布时间:2011/12/28 15:42:56 -- 找不出问题答案的我 序号 时间 品种 方向 价格 数量 开平 帐户 投保 [此贴子已经被作者于2011-12-28 15:45:46编辑过]
|
-- 作者:jinzhe -- 发布时间:2011/12/28 15:45:08 -- 这个是神马? |
-- 作者:solarhe2006 -- 发布时间:2011/12/28 15:51:01 -- 问题;后台策略,模拟交易,股指开仓后马上平仓 我的思路是一个策略同时监控三个周期,比如一分钟,五分钟,15分钟,各个周期各下各的单,互相不干扰,动用了全局变量等。 模拟交易中,铜、胶品种基本正常,偶尔下单自动平掉,股指一直是下单后自动平掉。 1、如果是策略问题,为什么股指不正常,胶正常? 2、如果监控三个周期不正常,我停止监控三个周期,用一个周期还是自动平掉?
|
-- 作者:fly -- 发布时间:2011/12/28 16:09:11 -- (1)策略A监控1分钟的 铜、胶和IF, 其中用全局变量A (2)策略A监控5分钟的 铜、胶和IF, 其中用全局变量B (3)策略A监控15分钟的 铜、胶和IF,其中用全局变量C 是吗?
是全自动的开仓和平仓? |
-- 作者:solarhe2006 -- 发布时间:2011/12/28 16:15:49 -- 1、全局变量精确到多账户,多策略、多周期、多品种、多持仓 A_A_14_IF_MH 0 数字 全自动开仓和平仓 |
-- 作者:solarhe2006 -- 发布时间:2011/12/28 16:21:44 -- 多账户多策略多周期多品种后台交易模板 input:account(888888,1,999999,1);
runmode:0; begintime:=currenttime>=091500 and currenttime<=145500; endtime:=currenttime>=145930; buycond:=begintime; sellcond:=begintime; myaccount:=\'\'+account; mycash:=taccount2(19,myaccount); myholding:=extgbdata(myaccount+\'_\'+formulaname+\'_\'+datatype+\'_\'+stklabel+\'_holding\'); slippage:=2*mindiff; if myholding=0 then begin if buycond then begin buyprice:=close+slippage; lots:=intpart(mycash/(buyprice*multiplier*taccount(41))); if lots>=1 then begin tbuy(1,lots,lmt,buyprice,0,myaccount,0); extgbdataset(myaccount+\'_\'+formulaname+\'_\'+datatype+\'_\'+stklabel+\'_holding\',lots); end end end if myholding=0 then begin if sellcond then begin sellprice:=close-slippage; lots:=intpart(mycash/(sellprice*multiplier*taccount(42))); if lots>=1 then begin tbuyshort(1,lots,lmt,sellprice,0,myaccount,0); extgbdataset(myaccount+\'_\'+formulaname+\'_\'+datatype+\'_\'+stklabel+\'_holding\',-lots); end end end if myholding>0 then begin if endtime then begin tsell(1,myholding,lmt,close-slippage,myaccount,0); extgbdataset(myaccount+\'_\'+formulaname+\'_\'+datatype+\'_\'+stklabel+\'_holding\',0); end end if myholding<0 then begin if endtime then begin tsellshort(1,myholding,lmt,close+slippage,myaccount,0); extgbdataset(myaccount+\'_\'+formulaname+\'_\'+datatype+\'_\'+stklabel+\'_holding\',0); end end |
-- 作者:solarhe2006 -- 发布时间:2011/12/28 16:23:04 -- 参考上面模板写的 |
-- 作者:jinzhe -- 发布时间:2011/12/28 16:32:40 -- 看不清你的公式 |
-- 作者:solarhe2006 -- 发布时间:2011/12/28 16:39:37 -- 论坛的浏览器对IE以外的浏览器支持不好,所以你看不清 |
-- 作者:solarhe2006 -- 发布时间:2011/12/28 16:48:54 -- 明天把代码分成几部分,分别加注释后测试不同品种看看,如果被注释的代码正常,说明是那部分的问题,希望是代码的问题 |