等级: 免费版
- 注册:
- 2024-7-16
- 曾用名:
|

楼主 |
发表于 2024-12-25 13:07
|
显示全部楼层
老师好,帮忙看下这段代码的问题,好像不能按照代码平仓
//止盈止损
Win_Buy:=c-enterprice>=1;//多头盈利1点
Win_Sell:=enterprice-c>=1;//空头盈利1点
Lose_Buy:=enterprice-l>=2;//多头亏损2点
Lose_Sell:=h-enterprice>=2;//空头亏损2点
//市价止盈止损
if Win_Buy and holding>0 then 多止盈:Sell(enterbars=0,0,marketr);
if Win_Sell and holding<0 then 空止盈:Sellshort(enterbars=0,0,marketr);
if Lose_Buy and holding>0 then 多止损:Sell(enterbars=0,0,marketr);
if Lose_Sell and holding<0 then 空止损:Sellshort(enterbars=0,0,marketr); |
|