- 精华
- 0
- 在线时间
- 57 小时
- UID
- 2276
- 积分
- 317
- 帖子
- 66
- 阅读权限
- 50
- 注册时间
- 2008-9-4
- 最后登录
- 2008-10-20
- 精华
- 0
- UID
- 2276
- 积分
- 317
- 帖子
- 66
- 主题
- 20
- 阅读权限
- 50
- 注册时间
- 2008-9-4
- 最后登录
- 2008-10-20
|
Param
Numeric nLots(1);
Numeric nPoint(200);
Numeric nFirstEntry(0);
Vars
Numeric nHLots(0);//目前价格应该持仓的手数
Numeric nAddLots(0);//当实际持仓与应当持仓数量不等时,应该补上的手数
Numeric nAddPrice(0);//补仓时的开仓价格
Begin
nHlots=(IntPart((Q_BidPrice-nFirstEntry)/nPoint)+1)*nLots;
If(Q_BidPrice>nFirstEntry && A_SellPosition<nHlots && A_GetOpenOrderCount==0)
{
nAddLots=(nHlots-A_SellPosition)*nLots;
nAddPrice=nFirstEntry+(nHlots-1)*nPoint;
A_SendOrder(Enum_Sell,Enum_Entry,nAddLots,nAddPrice);
//将交易数据输出到硬盘:
FileAppend("F:\\逆势.txt","第"+Text(nHlots)+"次建仓时间:"+Text(LastEntryDate)+" "+Text(LastEntryTime)+"| 价格:"+Text(LastEntryPrice));
}
End |
|