只有IB才支持“停损”的方式;您正常用限价、市价委托的方式委托即可IB(美国赢透)交易平台 这个平台支持所有限价、市价、停损、限价停损这个4个指令。在IB平台发出停损指令后会将指令单发送到IB的交易服务器上保存,等待触发。
另外,您止损可以用策略止损,或者系统中自带的止盈止损方式:
此主题相关图片如下:temp.png

[此贴子已经被作者于2018/4/11 16:03:05编辑过]
//追踪止损
step:=20;
D:10;
stps:ref(if(holding<0,if(enterprice-llv(l,openbar)>=mindiff*step,enterprice+d*mindiff-CEILING((enterprice-llv(l,openbar))/mindiff/step)*step*mindiff,enterprice+d*mindiff),drawnull),1);
stpl:ref(if(holding>0,if(hhv(h,openbar)-enterprice>=mindiff*step,floor(((hhv(h,openbar)-enterprice)/mindiff/step))*step*mindiff+enterprice-d*mindiff,enterprice-d*mindiff),drawnull),1);
IF h>=stps and HOLDING<0 THEN BEGIN //D---D个价位止损;step---步长;stps----空单止损位;
SELLshort(HOLDING<0,HOLDING,stopr,stps);
//止空
END;
IF l<=stpl THEN BEGIN //D---D个价位止损;step---步长;stpl----多单止损位;
SELL(HOLDING>0,HOLDING,stopr,stpl);
//止多
END;怎么能把这个代码改的金字塔能用
//追踪止损
step:=20;
D:10;
stps:ref(if(holding<0,if(enterprice-llv(l,openbar)>=mindiff*step,enterprice+d*mindiff-CEILING((enterprice-llv(l,openbar))/mindiff/step)*step*mindiff,enterprice+d*mindiff),drawnull),1);
stpl:ref(if(holding>0,if(hhv(h,openbar)-enterprice>=mindiff*step,floor(((hhv(h,openbar)-enterprice)/mindiff/step))*step*mindiff+enterprice-d*mindiff,enterprice-d*mindiff),drawnull),1);
IF h>=stps and HOLDING<0 THEN BEGIN //D---D个价位止损;step---步长;stps----空单止损位;
SELLshort(HOLDING<0,HOLDING,stopr,stps);
//止空
END;
IF l<=stpl THEN BEGIN //D---D个价位止损;step---步长;stpl----多单止损位;
SELL(HOLDING>0,HOLDING,stopr,stpl);
//止多
END;怎么能把这个改的金字塔能用
step:=20;
D:10;
stps:ref(if(holding<0,if(enterprice-llv(l,openbar)>=mindiff*step,enterprice+d*mindiff-CEILING((enterprice-llv(l,openbar))/mindiff/step)*step*mindiff,enterprice+d*mindiff),drawnull),1);
stpl:ref(if(holding>0,if(hhv(h,openbar)-enterprice>=mindiff*step,floor(((hhv(h,openbar)-enterprice)/mindiff/step))*step*mindiff+enterprice-d*mindiff,enterprice-d*mindiff),drawnull),1);
IF h>=stps and HOLDING<0 THEN BEGIN //D---D个价位止损;step---步长;stps----空单止损位;
SELLshort(HOLDING<0,HOLDING,LIMIT,stps);
//止空
END;
IF l<=stpl THEN BEGIN //D---D个价位止损;step---步长;stpl----多单止损位;
SELL(HOLDING>0,HOLDING,LIMIT,stpl);
//止多
END;//怎么能把这个改的金字塔能用
一般止损用市价方式,
[此贴子已经被作者于2018/4/11 16:27:37编辑过]
SELL(HOLDING>0,HOLDING,market);// 市价委托SELL(HOLDING>0,HOLDING,limit,指定价格);// 限价委托
具体您可以看下软件中的函数介绍