- 精华
- 20
- 在线时间
- 2981 小时
- UID
- 4
- 积分
- 22709
- 帖子
- 4802
- 阅读权限
- 255
- 注册时间
- 2007-7-20
- 最后登录
- 2024-1-15
- 精华
- 20
- UID
- 4
- 积分
- 22709
- 帖子
- 4802
- 主题
- 64
- 阅读权限
- 255
- 注册时间
- 2007-7-20
- 最后登录
- 2024-1-15
|
看起来代码没有问题,您用FileAppend函数调试一下,确认是否执行到加仓的代码
代码如下:
- if (BarStatus == 2 and MarketPosition == -1)
- {
- extryLots=A_FreeMargin /(Q_AskPrice*ContractUnit*MarginRatio);
- extryLots = IntPart(extryLots );
- if(condtion and Time<0.144500 )
- {
- FileAppend("C:\\Formula.log","Date_lastbar="+Text(Date)+",Time_lastbar="+Text(100*Time)+",extryLots="+Text(extryLots));
- SellShort( extryLots ,Close,True);
- }
- }Else If(BarStatus <> 2 and MarketPosition == -1 )
- {
- extryLots=CurrentCapital/(Close*ContractUnit*MarginRatio);
- extryLots = IntPart(extryLots ); // 取整
- if(condtion and Time<0.144500 )
- {
- FileAppend("C:\\Formula.log","Date="+Text(Date)+",Time="+Text(100*Time)+",extryLots="+Text(extryLots));
- SellShort( extryLots ,Close,True);
- }
- }
复制代码
[ 本帖最后由 nopain 于 2007-9-14 12:07 编辑 ] |
|