Rss & SiteMap

金字塔客服中心 - 专业程序化交易软件提供商 http://www.weistock.com/bbs/

专业程序化软件提供商
共2 条记录, 每页显示 10 条, 页签: [1]
[浏览完整版]

标题:跟踪止损的公式是怎么写的呢?

1楼
qq代人发帖 发表于:2020/12/7 8:47:42
请教:跟踪止损的公式是怎么写的呢?
2楼
banzhuan 发表于:2020/12/7 9:08:38
跟踪止损是指移动止盈止损吧?  可以参考下列的案例,需要使用全局变量标记

//应用于图表,以多头为例,空头的情况按照反写就行,仅供参考。
variable:maxprofit=0;
if holding>0 and enterbars>0 then
  begin
  win:=high-AVGENTERPRICE;        //记录最大盈利
  if win>maxprofit then maxprofit:=win;
  win2:=maxprofit-win;                   //记录回调幅度
  end
if maxprofit>=50*mindiff and win2>0.2*maxprofit then  
  sell(holding>0,holding,market);                                  //最大盈利高于50*mingdiff 并且回落大于最高值的20%,则止盈
共2 条记录, 每页显示 10 条, 页签: [1]


Powered By Dvbbs Version 8.3.0
Processed in 0.01758 s, 2 queries.