管理员救命.单程序老出问题,老会多补一手,然后平掉. [开拓者 TB]
- 咨询内容:
sjdc=A_buyPosition;
sjkc=A_SellPosition;
FileAppend("D:\\false.txt","实际多仓校验前"+Text(sjdc));
FileAppend("D:\\false.txt","实际多仓校验前"+Text(sjkc));
If(sjdc!=InvalidNumeric and sjkc!=InvalidNumeric)
{ If(A_GetOpenOrderCount()>0 )// and (CurrentTime-A_OpenOrderTime(0))*1000000>2
{FileAppend("D:\\false.txt","未成交挂单前"+Text(A_GetOpenOrderCount()));
A_DeleteOrder(A_OpenOrderContractNo());
}
FileAppend("D:\\false.txt","未成交挂单后"+Text(A_GetOpenOrderCount()));
If(A_GetOpenOrderCount()==0 )
{if(MyRealMP>=0)
{If(sjkc>0)
{A_SendOrder(Enum_buy,Enum_Exit,sjkc,Q_askPrice);
}else
If(sjdc>MyRealMP*EveryLots)
{ A_SendOrder(Enum_sell,Enum_Exit,sjdc-MyRealMP,Q_BidPrice);
}else
if(sjdc<MyRealMP*EveryLots)
{A_SendOrder(Enum_buy,Enum_Entry,MyRealMP-sjdc,Q_AskPrice);
}
}
IF(MyRealMP<0)
{If(sjdc>0)//实际多仓,A_sellpositon==NA
{A_SendOrder(Enum_Sell,Enum_Exit,sjdc,Q_BidPrice);
}else
if(sjkc>Abs(MyRealMP)*EveryLots)
{A_SendOrder(Enum_buy,Enum_Exit,sjkc-Abs(MyRealMP),Q_AskPrice);
}else
if(sjkc<Abs(MyRealMP)*EveryLots)
{A_SendOrder(Enum_Sell,Enum_Entry,Abs(MyRealMP)-sjkc,Q_BidPrice);
}
}
}
}
FileAppend("D:\\false.txt","实际多仓校验后"+Text(A_buyPosition));
FileAppend("D:\\false.txt","实际多仓校验后"+Text(A_buyPosition)); - TB技术人员: 交易的时候该补1手多单,老是会先开2手多单,再平掉1手。或者先开3手再平2手。有时候是正常的
如果以上指标公式不适用于您常用的行情软件
或者您想改编成选股公式,以便快速选出某种形态个股的话,
相关文章
-
指定的模型还没有相关内容!