变化仓位交易代码编写
谁帮我写一个股票的买卖变动仓位指标啊
20日均线之上参与买卖,收盘价格大于5日线和20日线上持仓60%仓位,收盘价格低于5日线且大于20日线,持有30%仓位,收盘价格低于20日线空仓!
ma5:ma(c,5);
ma20:ma(c,20);
if c>ma20 and c>ma5 and holding=0 THEN
buy(1,60%,market);
if c<ma5 and c>ma20 and holding=0 THEN
buy(1,30%,market);
if c<ma20 and holding>0 then
sell(1,holding,market);