- 精华
- 0
- 在线时间
- 23 小时
- UID
- 19844
- 积分
- 170
- 帖子
- 6
- 阅读权限
- 40
- 注册时间
- 2010-11-17
- 最后登录
- 2011-8-8
- 精华
- 0
- UID
- 19844
- 积分
- 170
- 帖子
- 6
- 主题
- 1
- 阅读权限
- 40
- 注册时间
- 2010-11-17
- 最后登录
- 2011-8-8
|
本帖最后由 roupai 于 2011-1-28 15:41 编辑
我已经把止损设到10000了,还是在第二根bar就平仓,同样的系统用在多头交易中就没问题
Params
Numeric lots(1);
Numeric mytimek(1330);
Numeric mytimep(1450);
Numeric StopPoint(10000);
Numeric GainPoint(10000);
Vars
NumericSeries HigherAfterEntry;
NumericSeries LowerAfterEntry;
Numeric MinPoint;
Numeric StopLine;
Numeric MyEntryPrice;
Numeric MyExitPrice;
Begin
Minpoint = MinMove*PriceScale;
If(BarsSinceEntry==1)
{
HigherAfterEntry = AvgEntryPrice;
LowerAfterEntry = HigherAfterEntry ;
}Else
{
HigherAfterEntry = Max(HigherAfterEntry[1],High[1]);
LowerAfterEntry = Min(LowerAfterEntry[1],Low[1]);
}
If(marketposition!=-1 && time<=mytimek/10000)
{
SellShort(lots,open);
LowerAfterEntry=AvgEntryPrice;
MyEntryPrice=AvgEntryPrice;
}
if(MarketPosition ==-1)
{
If(LowerAfterEntry <= AvgEntryPrice - GainPoint*MinPoint)
{
StopLine = LowerAfterEntry + StopPoint*MinPoint;
}Else
{
StopLine = MyEntryPrice + StopPoint*MinPoint;
}
If(High>=StopLine || Open >= StopLine)
{
MyExitPrice = StopLine;
BuyToCover(Lots,MyExitPrice);
}
}
If(Time>=mytimep/10000 && MarketPosition==-1)
{
buytocover(lots,open);
}
End
|
附件: 你需要登录才可以下载或查看附件。没有帐号?注册
|