- 精华
- 0
- 在线时间
- 47 小时
- UID
- 62357
- 积分
- 129
- 帖子
- 18
- 阅读权限
- 40
- 注册时间
- 2011-8-29
- 最后登录
- 2017-6-21
- 精华
- 0
- UID
- 62357
- 积分
- 129
- 帖子
- 18
- 主题
- 2
- 阅读权限
- 40
- 注册时间
- 2011-8-29
- 最后登录
- 2017-6-21
|
请管理员老大,看下以下的代码有无问题?我在模拟中买卖都在一条K线上
另,我想增加一条策略,止赢20跳,止损10跳,请问怎么加比较合适?
Params
Numeric x(8);//
Numeric lots(1); //
Numeric y(4);//
Numeric offset(0); //
Vars
Numeric ma1;//
Numeric i_offset;//
Numeric OnePoint;//
Numeric myExitPrice(0); //
Begin
OnePoint = MinMove*PriceScale;//
ma1=Average(Close[1],x);//
PlotNumeric("ma1",ma1);//
i_offset = offset*MinMove*PriceScale;//
myexitPrice=AvgEntryPrice();//
If(CurrentBar > X);
{
If (MarketPosition==0)
{
If (Close[1]<ma1 && time>0.0915 && Time < LastTradeMins/100)
{
SellShort(lots,open-i_offset);//
}
}
//空仓平
If(marketposition==-1)
{
BuyToCover(lots,myExitPrice+y*OnePoint);
If(open>ma1)
{
BuyToCover(lots,open+i_offset);//
Return;
}
}
}
End |
|