- 精华
- 0
- 在线时间
- 395 小时
- UID
- 175500
- 积分
- 72
- 帖子
- 36
- 阅读权限
- 30
- 注册时间
- 2013-11-11
- 最后登录
- 2021-6-15
- 精华
- 0
- UID
- 175500
- 积分
- 72
- 帖子
- 36
- 主题
- 17
- 阅读权限
- 30
- 注册时间
- 2013-11-11
- 最后登录
- 2021-6-15
|
// 进场部分
if(MarketPosition==0 && LoBand1[1]>=LoBand2[1])//多头出场信号与之相反
{
MyPrice = HiBand1;
if (Open>MyPrice) MyPrice = Open;
buy(lots, o);
}
// 止损部分
if(barssinceentry>=1)
{
If(MarketPosition==1 )
{
StopLine = entryprice*0.997;
if (StopLine < HigherAfterEntry - ATRValue[1] * B_TrailStopNumATR)
StopLine = HigherAfterEntry - ATRValue[1] * B_TrailStopNumATR;
If(Low <= StopLine)
{
MyPrice = StopLine;
If(Open < MyPrice) MyPrice = Open;
Sell(Lots, o);
}
}
}
//以下空头
// 进场部分
if(MarketPosition==0 && HiBand1[1]<=HiBand2[1])//空头出场信号与之相反
{
MyPrice = LoBand1;
if (Open<MyPrice) MyPrice = Open;
SellShort(lots, o);
}
// 止损部分
if(barssinceentry>=1)
{
If(MarketPosition==-1)
{
StopLine = entryprice*1.003;
if (StopLine > LowerAfterEntry + ATRValue[1] * S_TrailStopNumATR)
StopLine = LowerAfterEntry + ATRValue[1] * S_TrailStopNumATR;
If(high >= StopLine)
{
MyPrice = StopLine;
If(Open > MyPrice) MyPrice = Open;
BuyToCover(Lots, o);
}
}
}
End |
|