以文本方式查看主题

-  金字塔客服中心 - 专业程序化交易软件提供商  (http://weistock.com/bbs/index.asp)
--  公式模型编写问题提交  (http://weistock.com/bbs/list.asp?boardid=4)
----  代发贴  (http://weistock.com/bbs/dispbbs.asp?boardid=4&id=72238)

--  作者:FJ6008
--  发布时间:2014/11/21 11:57:14
--  代发贴
请客服帮忙把以下有关头寸管理编程的请教报告贴到论坛合适的老师处,谢谢谢谢了!!
一、资金管理采取浮动手数方式;
二、具体规则是:
1、无论是做多还是做空,首次开仓为1手;
2、如果本次交易盈利,下一次无论是开多还是开空,开仓加1手,即为2手;下一次如连续盈利,还是开2手,也就是最高就是2手。
3、如果本次交易亏损,下一次无论是开多还是开空,开仓恢复到1手。
下面一个,修改了一下,请帮助贴一下,谢谢

--  作者:pyd
--  发布时间:2014/11/21 13:34:42
--  

//多头为例

VARIABLE:n=0;
if 开多条件 and holding=0 then buy(1,ss,market);
if 平多条件 and holding>0 then sell(1,holding,market);
if numprofit>0 then n:=1;
if 开多条件 and holding>0 and n=1 then buy(1,2,market);

if NUMPROFIT<0 then n:=2;
if 开多条件 and n=2 holding>0 then buy(1,1,market);


--  作者:FJ6008
--  发布时间:2014/11/22 0:37:53
--  
谢谢