我是想在信号出来后,如果前边已连续亏损两次及以上,那就只开10%的仓位;反之就开50%的仓位。多单的就可以实现,但是空单部分的没有开到10%,我看了交易记录,其实前边已经有亏损2次了的,但是不知道为什么空单还是按50%来开仓的?????求老师帮我看看,非常感谢!下边是我的开仓代码。
if type(1)<>3 and ccs>=0 and NUMSEQLOSS>=2 then
{开空,无空单情况下,前边连续亏损2次及以上}
buyshort(ma5<ma10 and close<aa,10%,thisclose);
if type(1)<>3 and ccs>=0 and NUMSEQLOSS<2 then
{开空,无空单情况下,前边连续亏损不及2次}
buyshort(ma5<ma10 and close<aa,50%,thisclose);
if type(1)<>1 and ccs<=0 and NUMSEQLOSS>=2 then
{开多,无多单情况下,前边连续亏损2次及以上}
buy(ma5>ma10 and close>aa,10%,thisclose);
if type(1)<>1 and ccs<=0 and NUMSEQLOSS<2 then
{开多,无多单情况下,前边连续亏损不及2次}
buy(ma5>ma10 and close>aa,50%,thisclose);
if type(3)<>1 and ccs>=0 and NUMSEQLOSS>=2 then
{开空,无空单情况下,前边连续亏损2次及以上}
buyshort(ma5<ma10 and close<aa,10%,thisclose);
if type(3)<>1 and ccs>=0 and NUMSEQLOSS<2 then
{开空,无空单情况下,前边连续亏损不及2次}
buyshort(ma5<ma10 and close<aa,50%,thisclose);