- 精华
- 0
- 在线时间
- 192 小时
- UID
- 15246
- 积分
- 704
- 帖子
- 167
- 阅读权限
- 60
- 注册时间
- 2010-8-17
- 最后登录
- 2021-9-5
- 精华
- 0
- UID
- 15246
- 积分
- 704
- 帖子
- 167
- 主题
- 74
- 阅读权限
- 60
- 注册时间
- 2010-8-17
- 最后登录
- 2021-9-5
|
早上7点多开了TB自动交易后就出去了。中午回来发现价格走势符合开仓条件,结果却没开仓,检查后,发现上周五17号的成交记录还保留在账户里。但成交时间却全部变为今天20号早上8点左右。不知道是不是由于这个原因导致全局变量的改变,所以即使出现了符合开仓条件的价格走势,结果却没开仓。请问如何解决?(是实盘)
Begin
If( date!=date[1] )
SetGlobalVar(0,0);
.........
If(CurrentTime > 0.090030 && CurrentTime < 0.144500)
{
If ( A_TotalPosition==0 )
{
If (condition&&GetGlobalVar(0)==0)//满足开多仓条件
{
NewPrice=Q_AskPrice+ShiftUnit*MinMove*PriceScale; //计算开仓价格
A_SendOrder(Enum_Buy,Enum_Entry,Lots,NewPrice);
SetGlobalVar(0,TimeSeconds);
.......
//收盘平仓//
If(CurrentTime > 0.145700)
{
If (A_BuyPosition>0 )//满足收盘平多仓条件
{
NewPrice=Q_BidPrice-ShiftUnit*MinMove*PriceScale;
A_SendOrder(Enum_Sell,Enum_Exit,A_BuyPosition,NewPrice);
SetGlobalVar(0,TimeSeconds);
}
Else If ( A_SellPosition>0)//满足收盘平空仓条件
{
NewPrice=Q_AskPrice+ShiftUnit*MinMove*PriceScale;
A_SendOrder(Enum_Buy,Enum_Exit,A_SellPosition,NewPrice);
SetGlobalVar(0,TimeSeconds);
}
} |
|