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

请老师帮忙看一下这个怎么计算

作者:开拓者 TB 来源:cxh99.com 发布时间:2021年03月28日
  • 咨询内容:
    源码如下,利用两条均线金叉后的最高点和死叉后的最低点画转折线,帮忙看一下怎么求取图中转折点的位置和价格:

    //------------------------------------------------------------------------

    Params
    Numeric N1(5);
    Numeric N2(20);
    Vars
    Series<Numeric> Line1;
    Series<Numeric> Line2;
    Series<Numeric> exhl;
    Series<Numeric> hhbar;
    Series<Numeric> llbar;

    Events
    OnBar(ArrayRef<Integer> indexs)
    {
    Line1 = XAverage(c,n1);
    Line2 = XAverage(c,n2);
    if(line1<line2)
    {
    exhl=Min(l,exhl);
    }
    if(line1>line2)
    {
    exhl=max(h,exhl);
    }
    hhbar=NthCon(h==exhl,1);
    llbar=NthCon(l==exhl,1);

    //PlotNumeric("Line1",Line1);
    //PlotNumeric("Line2",Line2);
    if(h==exhl)
    {
    if(hhbar[1]>llbar[1])
    {Unplot("exhl",llbar+1);
    PlotNumeric("exhl",exhl);
    }else if(hhbar[1]<llbar[1])
    {Unplot("exhl",hhbar[1]+1);
    PlotNumeric("exhl",exhl);
    }
    }
    if(l==exhl)
    {
    if(hhbar[1]<llbar[1])
    {
    Unplot("exhl",hhbar+1);
    PlotNumeric("exhl",exhl);
    }else if (hhbar[1]>llbar[1])
    {
    Unplot("exhl",llbar[1]+1);
    PlotNumeric("exhl",exhl);
    }
    }


    }

    //------------------------------------------------------------------------
    // 编译版本 GS2015.12.25
打印本文打印本文 关闭窗口关闭窗口