- 精华
- 0
- 在线时间
- 320 小时
- UID
- 188
- 积分
- 597
- 帖子
- 91
- 阅读权限
- 50
- 注册时间
- 2007-8-24
- 最后登录
- 2019-4-5
- 精华
- 0
- UID
- 188
- 积分
- 597
- 帖子
- 91
- 主题
- 27
- 阅读权限
- 50
- 注册时间
- 2007-8-24
- 最后登录
- 2019-4-5
|
如果 condtion 条件继续成立 怎么编写加仓命令呢 ?
Numeric extryLots; // 加仓数量
、、、、、、、
//加仓
if (BarStatus == 2 and MarketPosition == -1 )
{extryLots=A_FreeMargin /(Q_AskPrice*ContractUnit*MarginRatio);
extryLots = IntPart(extryLots );
if(condtion and Time<0.144500 )
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 )
SellShort( extryLots ,Close,True);
}
在 condtion 第一次成立后 ,开仓, 在部分仓位止赢后, 还剩下部分仓位 !这个时候 condtion 条件又成立了!
在这样的情况如何加仓!
我写的是加空的 代码 好象不行!
[ 本帖最后由 dengwenle 于 2007-9-14 01:26 编辑 ] |
|