請教版主關于全局變量控制a_sendorder的問題
作者:開拓者 TB 來源:cxh99.com 發布時間:2015年01月02日
- 咨詢內容:
開頭星號部分我的本意是隔夜以后全局變量會清0 開盤后通過倉位重新賦值 這樣就不會重復開倉 但是加了這一段運行沒問題但是不會下單了 去了就可以了
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技術人員:
來個高人指點下 痛苦中
- TB客服:
怎么沒人回復啊 急求啊