-- 作者:FJ6008
-- 发布时间:2015/2/9 15:45:44
-- 金老师:看看我可以这样记录开仓的亏损,为何不对
//判断当前持仓状态下的亏损 variable1:minloss=0;//有仓位时亏损幅度 win0:=0; win02:=0; if holding > 0 and enterbars > 0 then begin win0:=(c-enterprice)/enterprice*100; //记录亏损 minloss:=win0; win02:=5*MINDIFF; //亏损 end if holding < 0 and enterbars > 0 then begin win0:=(enterprice-c)/enterprice*100; //记录亏损
if win0 > minloss then minloss:=win0; WIN02:=5*MINDIFF; end //出现亏损win0=win02=5*MINDIFF后平仓出场 止损1:SELL(win>=win02 and openprofit > 0, 0);
系统提示:没有定义minloss。有可能请金老师帮忙写一下记录亏损和亏损达到5*MINDIFF平仓!
谢谢
|