以文本方式查看主题 - 金字塔客服中心 - 专业程序化交易软件提供商 (http://weistock.com/bbs/index.asp) -- 公式模型编写问题提交 (http://weistock.com/bbs/list.asp?boardid=4) ---- 怎样将日内模型中的时间删除? (http://weistock.com/bbs/dispbbs.asp?boardid=4&id=29901) |
|
-- 作者:a290380438 -- 发布时间:2012/10/17 16:34:35 -- 怎样将日内模型中的时间删除?
公式如下(将日内模型中的时间和止损部份删除): time1:= time>090300 and time<112700 or (time>133300 and time<145700); time:= time> 112700 and time<113000 or (time>145700 and time<150000);
if c>均线 and time1 then begin sellshort(); buy(); end//价在均线上平空开多
if c<均线 and time1 then begin sell(); buyshort(); end//价在均线下平多开空
if c<0.99*enterprice and holding>0 then sell();//1%多头止损 if c>enterprice*1.01 and holding<0 then sellshort();//1%空头止损
if time2 then begin//收盘前平仓 sell(); sellshort(); end |
|
-- 作者:lichenghu -- 发布时间:2012/10/17 16:42:16 -- if c>均线 then begin sellshort(); buy(); end//价在均线上平空开多
if c<均线 and begin sell(); buyshort(); end//价在均线下平多开空 if time>145900 then begin//收盘前平仓 sell(); sellshort(); end
|
|
-- 作者:a290380438 -- 发布时间:2012/10/17 17:38:15 -- 多周期公式测试问题 不知为何公式测试通不过?文字提示为: 函数 所调用的参数与预定义参数不符。 请再帮我测试通过一下。 另外,收盘前平仓部份可以直接删除吗? 谢谢!
均线:=ma(c,M); if c>均线 then begin
if c<均线 and begin
if time>145900 then begin//收盘前平仓 |
|
-- 作者:RogarZ -- 发布时间:2012/10/17 21:42:18 -- sellshort(); buy(); 这些交易函数,里面的参数都没填。当然通过不了, 具体这些函数该怎么填,属于策略的一部分,由客户决定,金字塔不负责。 不知道您的公式从何而来,若不会用,请联系给你公式的人。 若这个是模板,请在弄清楚函数,公式的意义后,再使用。
[此贴子已经被作者于2012-10-17 21:42:49编辑过]
|
|
-- 作者:a290380438 -- 发布时间:2012/10/18 10:55:49 --
另外, 建议论坛固定贴出一些简单常用的模型编程范例,以方便新手看样照葫芦画瓢。同时也可减少客服的工作量。 |
|
-- 作者:jinzhe -- 发布时间:2012/10/18 11:07:17 -- 模型范例可以参考阿火的秘籍 http://www.weistock.com/bbs/dispbbs.asp?boardid=10&Id=9439
如果对公式不是很熟练,可以先进行学习 http://www.weistock.com/bbs/dispbbs.asp?boardid=2&Id=370 |
|
-- 作者:a290380438 -- 发布时间:2012/10/18 11:55:45 -- 上述怎样填参数问题?还是请老师先帮我指导一下吧!谢谢! |
|
-- 作者:a290380438 -- 发布时间:2012/10/18 19:10:03 -- 我将()内填入M(均线参数),但公式测评仍然通不过? 文字提示为: if 语句缺少 THEN 请帮我设置后并请测试下看是否正常。谢谢!
公式如下:
均线:=ma(M);
if c>均线 then begin sellshort(M); buy(M); end//价在均线上平空开多
if c<均线 and begin sell(M); buyshort(M); end//价在均线下平多开空
//sell(M); //sellshort(M); //end
|
|
-- 作者:RogarZ -- 发布时间:2012/10/18 20:08:38 -- 你鼠标放BUY上 看它的说明 BUY(条件,手数,报价类型,价格) 最简单的部分 还请客户自己学习。可参考上文 jinzhe给出的链接
[此贴子已经被作者于2012-10-18 20:09:27编辑过]
|
|
-- 作者:a290380438 -- 发布时间:2012/10/19 17:37:11 -- 求助! 我现在只需要 价在60日均价线之上平空开多,价在60日均价线之下平多开空,亏损20%强行平仓。谢谢!
|