老师 看看
if holding=0 then begin
BUY(开多条件,手数,THISCLOSE);
dd:=0;
end
//判断当前持仓状态下的最大盈利
win:=0;
win2:=0;
if holding > 0 and enterbars > 0 then
begin
win:=c-enterprice; //记录最大盈利
if win > dd then
dd:=win;
win2:=dd-win; //最大盈利后的回调幅度
end
d止赢:SELL(win2 >=10 and openprofit > 0,0,THISCLOSE);
if holding=0 then begin
BUYSHORT(开空条件,手数,THISCLOSE);
kd:=0;
end
if holding < 0 and enterbars > 0 then
begin
win:=enterprice-c; //记录最大盈利
if win > kd then
kd:=win;
win2:=kd-win; //最大盈利后的回调幅度
end
k止赢:SELLshort(win2 >=10 and openprofit > 0,0,THISCLOSE);
写出来的效果是回撤10点平仓
怎么修改成 盈利10点 回撤到盈利3点平仓
盈利15点 回撤到盈利6点平仓
盈利25点 回撤到盈利12点平仓
注意是回撤到盈利的点数
写第一个,后面的照着写
variable:win=0;
if 开仓条件 and holding=0 then begin
buy;
win:=c-enterprice;
end
if c-enterprice>win then win:=c-enterprice;
if win>=10*mindiff and c-enterprice<=3*mindiff then sell;