- 精华
- 0
- 在线时间
- 378 小时
- UID
- 234307
- 积分
- 153
- 帖子
- 103
- 阅读权限
- 40
- 注册时间
- 2016-5-12
- 最后登录
- 2023-7-26
- 精华
- 0
- UID
- 234307
- 积分
- 153
- 帖子
- 103
- 主题
- 29
- 阅读权限
- 40
- 注册时间
- 2016-5-12
- 最后登录
- 2023-7-26
|
本帖最后由 laofu602 于 2017-2-17 13:41 编辑
我把自己的限制语句加在前面,CallAuctionFilter在后面
......
if (
(CurrentTime>0.0830&&CurrentTime<0.0900011)
or (CurrentTime>0.2030&&CurrentTime<0.2100011)
or (ExchangeName == "中国金融期货交易所"&&CurrentTime>0.090000&&CurrentTime<0.0915011)
or (ExchangeName == "中国金融期货交易所"&&(SymbolType == "IF" || SymbolType == "IH" || SymbolType == "IC")&&CurrentTime>0.091500&&CurrentTime<0.093011) ) Return;//开盘后11秒前禁止发单
If(!CallAuctionFilter()) Return; //等待开盘
......
if (A_SellPosition>0&&HasSendBuyToCover==0&&Data1.Q_Last>Data1.H[1]&&uptpjs>1 )//超越前高平空
{
SetTBProfileString("TotalPosition_Kl",Symbol,Text(0));//平空后数据库清零
A_SendOrder(Enum_buy,Enum_Exit,A_SellPosition,Min(Q_UpperLimit,Q_Last+wtpyl));
HasSendBuyToCover = 1;
SetGlobalVar(4,HasSendBuyToCover);
HasSendSellShort = 0;
SetGlobalVar(3,HasSendSellShort);
}
if (EnableBulls>0&&A_BuyPosition==0&&HasSendbuy==0&&Data1.Q_Last>Data1.H[1]&&uptpjs>1)//开多
{
SetTBProfileString("TotalPosition_Kl",Symbol,Text(Buyss));//开多手数记录到数据库
A_SendOrder(Enum_Buy,Enum_Entry,Buyss,Min(Q_UpperLimit,Q_Last+wtpyl));
HasSendbuy = 1;//开仓后,禁止重复发单
SetGlobalVar(1,HasSendbuy);
HasSendsell = 0;//开仓后,允许平仓
SetGlobalVar(2,HasSendsell);
}
......
|
|