打印本文打印本文 关闭窗口关闭窗口

平仓条件,如果想做止盈止损怎么写?

作者:金字塔 来源:cxh99.com 发布时间:2017年01月24日
  • 咨询内容: 例如,盈利或亏损1.5倍ATR出场。需要判断先后吗?

     

  • 金字塔客服:

    atr:=stkindi('','atr.atr',0,datatype);

     

    if openprofit/multipler>1.5*atr then begin

       sell(1,0,marketr);

       sellshort(1,0,market);

    end

     

    if openprofit<0 and abs(openprofit)/multipler>1.5*atr then begin

       sell(1,0,marketr);

       sellshort(1,0,market);

    end

打印本文打印本文 关闭窗口关闭窗口