請教版主關于全局變量控制a_sendorder的問題 [開拓者 TB]
- 咨詢內容:
開頭星號部分我的本意是隔夜以后全局變量會清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客服: 怎么沒人回復啊 急求啊
有思路,想編寫各種指標公式,程序化交易模型,選股公式,預警公式的朋友
可聯系技術人員 QQ: 1145508240 進行 有償 編寫!(不貴!點擊查看價格!)
相關文章
-
沒有相關內容