- 精华
- 0
- 在线时间
- 35 小时
- UID
- 7457
- 积分
- 110
- 帖子
- 25
- 阅读权限
- 30
- 注册时间
- 2010-3-16
- 最后登录
- 2018-4-20
- 精华
- 0
- UID
- 7457
- 积分
- 110
- 帖子
- 25
- 主题
- 10
- 阅读权限
- 30
- 注册时间
- 2010-3-16
- 最后登录
- 2018-4-20
|
螺纹钢rb1010合约,3月24日,9:30于4760元开多仓,根据交易系统应于13:52在4763或4764元止损,但实际运行情况却是一直到收盘前才平仓,不知道哪里出了问题。同样的系统在天胶1009合约3月24日就进行了移动止损。请nopain帮忙看看是怎么回事,多谢了!
原代码如下:
//------------------------------------------------------------------------
// 简称: LUOWENG
// 名称:
// 类别: 交易指令
// 类型: 其他
// 输出:
//------------------------------------------------------------------------
Params
Numeric MoneyLoss(150);
numeric nnumber(0.70);
Vars
NumericSeries HighestOf30Min;
NumericSeries lowestOf30Min;
Numeric myPrice;
Numeric MinPoint;
Numeric Type(1);
Bool ExitPosition(false);
BoolSeries KG(true);
numeric zsjg;
Begin
MinPoint = MinMove*PriceScale;
If(Date <> Date[1])
{
HighestOf30Min = High;
lowestOf30Min = Low;
}Else If(Time < 0.0900+30*0.0001)
{
HighestOf30Min = max(high,HighestOf30Min[1]);
lowestOf30Min = min(Low,lowestOf30Min[1]);
}Else
{
HighestOf30Min = HighestOf30Min[1];
lowestOf30Min = lowestOf30Min[1];
}
If(High >= HighestOf30Min + 1*MinPoint && MarketPosition == 0 && KG==TRUE && ExitDate!=date)
{
myPrice = HighestOf30Min + 1*MinPoint;
If(Open > myPrice) myPrice = Open;
Buy((CurrentCapital*nnumber)/(myprice*10*0.12),myPrice);
KG=FALSE;
}
If(Low <= lowestOf30Min -1*MinPoint && MarketPosition == 0 && KG==TRUE && ExitDate!=date)
{
myPrice = lowestOf30Min - 1*MinPoint;
If(Open < myPrice) myPrice = Open;
SellShort((CurrentCapital*nnumber)/(myprice*10*0.12),myPrice);
KG=FALSE;
}
IF(TIME>ENTRYTIME())
{
if(MarketPosition==1 && highest(h,BarsSinceLastEntry)>LastEntryPrice) zsjg=abs(((highest(h,BarsSinceLastEntry)-LastEntryPrice)*0.75-MoneyLoss/10)*10);
if(MarketPosition==1 && highest(h,BarsSinceLastEntry)<=LastEntryPrice) zsjg=moneyloss;
if(MarketPosition==-1 && lowest(l,BarsSinceLastEntry)<LastEntryPrice) zsjg=abs(10*(LastEntryPrice-(lowest(l,BarsSinceLastEntry))*0.75-MoneyLoss/10));
if(MarketPosition==-1 && lowest(l,BarsSinceLastEntry)>=LastEntryPrice) zsjg=moneyloss;
SetStopLoss(Type,zsjg,ExitPosition);
KG=FALSE;
if(MarketPosition==1 && highest(h,BarsSinceLastEntry)>LastEntryPrice) Commentary( text( (highest(h,BarsSinceLastEntry)-LastEntryPrice)*0.75-MoneyLoss/10+LastEntryPrice ));
if(MarketPosition==1 && highest(h,BarsSinceLastEntry)<=LastEntryPrice) commentary(Text(LastEntryPrice-moneyloss));
if(MarketPosition==-1 && lowest(l,BarsSinceLastEntry)<LastEntryPrice) commentary(text(LastEntryPrice-((LastEntryPrice-lowest(l,BarsSinceLastEntry))*0.75-MoneyLoss/10)));
if(MarketPosition==-1 && lowest(l,BarsSinceLastEntry)>=LastEntryPrice) commentary(text(moneyloss+LastEntryPrice));
}
If(Time >= 0.1459)
{
Sell(0,Open);
BuyToCover(0,Open);
}
End
//------------------------------------------------------------------------
// 编译版本 GS2004.06.12
// 用户版本 2010/03/18 10:03
// 版权所有 notherask
// 更改声明 TradeBlazer Software保留对TradeBlazer平台
// 每一版本的TrabeBlazer公式修改和重写的权利
//------------------------------------------------------------------------ |
|