- 精华
- 1
- 在线时间
- 401 小时
- UID
- 404
- 积分
- 1434
- 帖子
- 236
- 阅读权限
- 60
- 注册时间
- 2007-9-23
- 最后登录
- 2014-7-25
- 精华
- 1
- UID
- 404
- 积分
- 1434
- 帖子
- 236
- 主题
- 74
- 阅读权限
- 60
- 注册时间
- 2007-9-23
- 最后登录
- 2014-7-25
|
一个增加头寸管理两根均线的简单日内交易系统
问题:
1.为什么只能在日线上用?我希望是在5MINS 或更小尺度用
2.版主能否详细介绍下Time怎么用
比如怎么控制在开盘后15分钟内不交易
收盘前平仓
0.145930什么意思?
If(Time > 0.145930 && Time < 0.150030 && preMP!=0) // 收盘平仓
Params
Numeric Length(20); // 短周期
Numeric LengthMA1(5);
Numeric LengthMA2(25);
Vars
Numeric N; // N 值
Numeric TurtleUnits; // 单位
Numeric preMP;
NumericSeries MA1;
NumericSeries MA2;
Bool Condition1;
Bool Condition2;
Bool Condition3;
Bool Condition4;
Bool Condition5;
Bool Condition6;
Begin
preMP = MarketPosition;
N = AverageFC(TrueRange,Length);
TurtleUnits = (CurrentCapital()*0.01) /(N * BigPointValue());
TurtleUnits = IntPart(TurtleUnits);
MA1 = AverageFC(Close,LengthMA1);
MA2 = AverageFC(Close,LengthMA2);
SetStopLoss(0,N,True);
condition1 = CrossOver(MA1, MA2) ;
condition2 = CrossUnder(MA1, MA2) ;
If(Time > 0.145930 && Time < 0.150030 && preMP!=0) // 收盘平仓
{
If(preMP == 1)
{
Sell;
return;
}else if(preMP == -1)
{
BuyToCover;
return;
}
}
If(preMP == 0)
{
If(condition1)
{
Buy(TurtleUnits,0);
}Else If(condition2)
{
SellShort(TurtleUnits,0);
}
}Else If(preMP == 1) // long
{
If ( condition2 ) // 获利反转
{
SellShort(TurtleUnits,0);
}
}else If(preMP == -1) // short
{
If (condition1 ) // 获利反转
{
Buy(TurtleUnits,0);
}
}
End |
|