- 精华
- 0
- 在线时间
- 1695 小时
- UID
- 14994
- 积分
- 2352
- 帖子
- 449
- 阅读权限
- 70
- 注册时间
- 2010-7-31
- 最后登录
- 2021-12-26
- 精华
- 0
- UID
- 14994
- 积分
- 2352
- 帖子
- 449
- 主题
- 54
- 阅读权限
- 70
- 注册时间
- 2010-7-31
- 最后登录
- 2021-12-26
|
if(BarStatus()==2 and jytime==True)
{
buycc=A_BuyPosition();
sellcc=A_SellPosition();
if(buycc==InvalidNumeric or sellcc==InvalidNumeric or buycc>10000 or sellcc>10000 or BuyLotsz01==InvalidNumeric or BuyLotsz02==InvalidNumeric or BuyLotsz01>10000 or BuyLotsz02>10000) {
FileAppend("d:\\A"+Symbol+"_"+Text(CurrentDate)+".txt",DateTimeToString(SystemDateTime)+"多头"+Text(buycc)+"数据库多头"+text(BuyLotsz01)+"空头"+text(sellcc)+"数据库空头"+text(BuyLotsz02)+"无效值返回");
return;}
if(TimeDiff(Myvar0,SystemDateTime)>300)
{
if(strValued_x=="x+1" and buycc<>BuyLotsz01)
{
if(buycc>BuyLotsz01) {A_SendOrder(Enum_Sell,Enum_Exit,buycc-BuyLotsz01,Q_BidPrice-3*chajia);SetGlobalVar(44,SystemDateTime);
FileAppend("d:\\A"+Symbol+"_"+Text(CurrentDate)+".txt",DateTimeToString(SystemDateTime)+"多头"+Text(buycc)+"数据库多头"+text(BuyLotsz01)+"空头"+text(sellcc)+"数据库空头"+text(BuyLotsz02)+"多头错误1");
return;}
if(buycc<BuyLotsz01) {A_SendOrder(Enum_Buy,Enum_Entry,BuyLotsz01-buycc,Q_AskPrice+3*chajia);SetGlobalVar(44,SystemDateTime);
FileAppend("d:\\A"+Symbol+"_"+Text(CurrentDate)+".txt",DateTimeToString(SystemDateTime)+"多头"+Text(buycc)+"数据库多头"+text(BuyLotsz01)+"空头"+text(sellcc)+"数据库空头"+text(BuyLotsz02)+"多头错误2");
return;}
}
if(strValuek_x=="x-1" and sellcc<>BuyLotsz02)
{
if(sellcc>BuyLotsz02) {A_SendOrder(Enum_Buy,Enum_Exit,sellcc-BuyLotsz02,Q_AskPrice+3*chajia);SetGlobalVar(44,SystemDateTime);
FileAppend("d:\\A"+Symbol+"_"+Text(CurrentDate)+".txt",DateTimeToString(SystemDateTime)+"多头"+Text(buycc)+"数据库多头"+text(BuyLotsz01)+"空头"+text(sellcc)+"数据库空头"+text(BuyLotsz02)+"空头错误1");
return;}
if(sellcc<BuyLotsz02) {A_SendOrder(Enum_Sell,Enum_Entry,BuyLotsz02-sellcc,Q_BidPrice-3*chajia);SetGlobalVar(44,SystemDateTime);
FileAppend("d:\\A"+Symbol+"_"+Text(CurrentDate)+".txt",DateTimeToString(SystemDateTime)+"多头"+Text(buycc)+"数据库多头"+text(BuyLotsz01)+"空头"+text(sellcc)+"数据库空头"+text(BuyLotsz02)+"空头错误2");
return;}
}
if(strValued_x=="xdt" and buycc<>0) {A_SendOrder(Enum_Sell,Enum_Exit,buycc,Q_BidPrice-3*chajia);SetGlobalVar(44,SystemDateTime);return;}
if(strValuek_x=="xkt" and sellcc<>0) {A_SendOrder(Enum_Buy,Enum_Exit,sellcc,Q_AskPrice+3*chajia);SetGlobalVar(44,SystemDateTime);return;}
}
if((strValued_x=="x+1" and buycc<>BuyLotsz01) or (strValuek_x=="x-1" and sellcc<>BuyLotsz02) or (strValued_x=="xdt" and buycc<>0) or (strValuek_x=="xkt" and sellcc<>0)) {
FileAppend("d:\\A"+Symbol+"_"+Text(CurrentDate)+".txt",DateTimeToString(SystemDateTime)+"多头"+Text(buycc)+"数据库多头"+text(BuyLotsz01)+"空头"+text(sellcc)+"数据库空头"+text(BuyLotsz02)+"错误返回");
return;}
//记录一下,到底是什么东西错误。下午测了30分钟也没有发现问题,毕竟好像3天左右出现一次。 |
|