- 精华
- 0
- 在线时间
- 14 小时
- UID
- 2079
- 积分
- 70
- 帖子
- 12
- 阅读权限
- 30
- 注册时间
- 2008-8-5
- 最后登录
- 2019-3-31
- 精华
- 0
- UID
- 2079
- 积分
- 70
- 帖子
- 12
- 主题
- 5
- 阅读权限
- 30
- 注册时间
- 2008-8-5
- 最后登录
- 2019-3-31
|
请斑竹帮忙看一下我下面的代码有无问题。
说明:上午开盘后,执行了一次开仓。下午我有重新在一个工作区中插入该指令系统,条件满足但是没有执行。
//------------------------------------------------------------------------
Params
Numeric stopw(6);
Numeric stops(4);
Begin
If(Time > 0.090500 && Time < 0.145500) // 时间在9:05分之后,14:50之前
{
If(MarketPosition == 0)
{
If(Close >Q_AvgPrice&&close[1]<Q_AvgPrice) // 开多仓
{
Buy(1,High);
Return;
}
If(Close <Q_AvgPrice&&close[1]>Q_AvgPrice) // 开空仓
{
SellShort(1,Low);
Return;
}
}
If(MarketPosition==1&&Close>EntryPrice+stopw*PriceScale*MinMove)//多仓的止损止赢
{
Sell(1,Low);
}
If(MarketPosition==-1&&Close>EntryPrice-stopw*PriceScale*MinMove) // 空仓的止损止赢
{ BuyToCover(1,High);
}
}
If(Time > 0.145500) // 时间在14:55之后
{
If(MarketPosition == 1)
{
Sell;
return;
}Else If(MarketPosition == -1)
{
BuyToCover;
Return;
}
}
End |
|