以文本方式查看主题 - 金字塔客服中心 - 专业程序化交易软件提供商 (http://weistock.com/bbs/index.asp) -- 公式模型编写问题提交 (http://weistock.com/bbs/list.asp?boardid=4) ---- 麻烦老师写一下! (http://weistock.com/bbs/dispbbs.asp?boardid=4&id=149020) |
-- 作者:安公子 -- 发布时间:2017/3/13 15:28:31 -- 麻烦老师写一下! 开多:价格〉20日线, 每次投入20%的可用资金,出现连续信号,不再买入。 止盈:与开仓价相比利润率达到5%, 止损:与开仓价相比亏损率达到2%, 开空同理。 麻烦了!!
|
-- 作者:安公子 -- 发布时间:2017/3/13 15:31:02 -- 这个写出来,是图表,还是程序?可以在标准版上自动交易吗 |
-- 作者:jinzhe -- 发布时间:2017/3/13 15:37:47 -- 开多:价格〉20日线, 每次投入20%的可用资金,出现连续信号,不再买入。
止盈:与开仓价相比利润率达到5%,
止损:与开仓价相比亏损率达到2%,
开空同理。
图表交易,标准版即可,代码如下: ma20:=ma(c,20); if c>ma20 and holding=0 then buy(1,20%,market),pertrader; if (c-enterprice)/enterprice>=0.05 then sell(1,0,market); if (enterprice-c)/enterprice>=0.02 then sell(1,0,market);
if c<ma20 and holding=0 then buyshort(1,20%,market),pertrader; if (enterprice-c)/enterprice>=0.05 then sellshort(1,0,market); if (c-enterprice)/enterprice>=0.02 then sellshort(1,0,market); |
-- 作者:安公子 -- 发布时间:2017/3/13 15:40:20 -- 先谢过 |