請(qǐng)教版主關(guān)于全局變量控制a_sendorder的問題
作者:開拓者 TB 來源:cxh99.com 發(fā)布時(shí)間:2015年01月02日
- 咨詢內(nèi)容:
開頭星號(hào)部分我的本意是隔夜以后全局變量會(huì)清0 開盤后通過倉(cāng)位重新賦值 這樣就不會(huì)重復(fù)開倉(cāng) 但是加了這一段運(yùn)行沒問題但是不會(huì)下單了 去了就可以了
if(BarStatus==0)
SetGlobalVar(0,0);
/* if(GetGlobalVar(0)==0 and A_BuyPosition>0)
SetGlobalVar(0,1);
if(GetGlobalVar(0)==0 and A_SellPosition>0)
SetGlobalVar(0,-1); */
If(BarStatus==2 and A_BuyPosition==0 and GetGlobalVar(0)==0 and l2[1]==l3[1] and l2>l3 )
{A_SendOrder(Enum_Buy,Enum_Entry,1,Q_Last);
SetGlobalVar(0,1);
PlotString("1","開多",low,red);
}
If(BarStatus==2 and A_BuyPosition>0 and GetGlobalVar(0)==1 and h1[1]==h2[1] and h1<h2 )
{A_SendOrder(Enum_Sell,Enum_Exit,1,Q_Last);
SetGlobalVar(0,0);
PlotString("2","平多",high,Yellow); }
If(BarStatus==2 and A_sellPosition==0 and GetGlobalVar(0)==0 and h2[1]==h3[1] and h2<h3 )
{A_SendOrder(Enum_Sell,Enum_Entry,1,Q_Last);
SetGlobalVar(0,-1);
PlotString("22","開空",high,Green);
}
If(BarStatus==2 and A_sellPosition>0 and GetGlobalVar(0)==-1 and l1[1]==l2[1] and l1>l2 )
{ A_SendOrder(Enum_buy,Enum_Exit,1,Q_Last);
SetGlobalVar(0,0);
PlotString("3","平空",low,Yellow);}
- TB技術(shù)人員:
來個(gè)高人指點(diǎn)下 痛苦中
- TB客服:
怎么沒人回復(fù)啊 急求啊