请教老师,以下平一半仓位怎么写?
if ref(c,1)>=ref(o,1) and c<o and holding>o then begin
(此处平一半仓位);
if ref(c,1)<ref(o,1) and c<o and holding>0 then begin
sell(1,0,limitr,c);//------------此处平掉余下的仓位。
if c>o and holding=o then begin
buy(1,1,limitr,c);
if c>o and holding=1 then begin
buy(1,1,limitr,c);
if c>o and holding=2 then begin
buy(1,1,limitr,c);
if c>o and holding=3 then begin
buy(1,1,limitr,c);
if c>o and holding=4 then begin
buy(1,1,limitr,c);
if c>o and holding=5 then begin
buy(1,1,limitr,c);
if c>o and holding=6 then begin
buy(1,1,limitr,c);
......
好懒,自己随便写个程序加载一下看看就清楚了
11*0.55取整是6,6手.
按4楼的方法,在图上一看,很明显的