思路:长短仓,长仓用日线条件见,短仓只交易长仓的相反方向。
长仓条件:
条件1,价格上穿66日均线买入30%仓位。
2,价格下穿66日均线平仓并做空30%仓位。
短仓条件:
1、长仓有多头持仓 and 条件1,做空与长仓相等的仓位。
2、长仓有空头持仓 and 条件2,做多与长仓相等的仓位。
3、短仓盈利>3%,掉短仓。//保留长仓。
4、长仓出现平仓信号,全部平仓。
//谢谢
条件1您自己会写吗?
这边帮你写下短舱的部分,一个简单模板,具体还请客户自行完善
if tbuyholding(1)>0 and 条件1 then
begin
tbuyshort(1,tbuyholding(1),mkt);
n:=1;
end
if tsellholding(1) >0 and 条件2 then
begin
tbuy(1,tbuyholding(1),mkt);
n:=2;
end
if n=2 and close-TAVGENTERPRICEEX2('' ,'' ,0 )>TAVGENTERPRICEEX2('' ,'' ,0 )*1.03 then tsell()