- 精华
- 0
- 在线时间
- 10 小时
- UID
- 267274
- 积分
- 6
- 帖子
- 4
- 阅读权限
- 10
- 注册时间
- 2018-7-5
- 最后登录
- 2021-6-1
- 精华
- 0
- UID
- 267274
- 积分
- 6
- 帖子
- 4
- 主题
- 2
- 阅读权限
- 10
- 注册时间
- 2018-7-5
- 最后登录
- 2021-6-1
|
if(MarketPosition==1) //有多单情况
{
if (high >=myentryprice+stop_win ) //止赢条件表达式
{
myexitprice=myentryprice+stop_win ;
if(open >myexitprice)myexitprice=open; //如果该BAR开盘价有跳空触发,则用开盘价代替
sell(0,myexitprice);
}else
if Low <=myentryprice-stop_loss // 止损条件表达式
{
myexitprice=myexitprice-stop_loss;
if (open <myexitprice) myexitprice=open ; //如果该BAR开盘价有跳空触发,则用开盘价代替
sell(0,myexitprice);
}else if (MarketPosition==-1) //有空仓的情况
{
if (low <=myentryprice-stop_win ) //止赢条件表达式
{
myexitprice=myentryprice-stop_win;
if(open<myexitprice) myexitprice=open ;
BuyToCover(0,myentryprice);
}else if (high >=myentryprice+stop_loss) // 止损条件表达式
{
myexitprice=myentryprice+stop_loss;
if (open>myexitprice) myexitprice=open;
BuyToCover(0,myexitprice);
}
End |
|